New advertisers: 50% off your first month with code FIRSTMONTHSee slots

Optimization suite that isolates background tasks and summarizes context to prevent OpenClaw token bloat.

skills.sh installs
507
GitHub stars
20
last updated
Jun 3, 2026
View on GitHub

What it does

  • Covers periodic task isolation, a Reset & Summarize protocol, local RAG recall, transcript indexing, and hybrid search
  • Isolates cron jobs with sessionTarget: "isolated", keeping heartbeat and check history out of the main session
  • Triggers manual consolidation when context exceeds 100k tokens, appending facts to MEMORY.md before a gateway restart
  • Designed for long-running OpenClaw agents that accumulate context over several days of sessions

Install

$ npx -y skills add d4kooo/openclaw-token-memory-optimizer --skill token-optimizer -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Token Optimizer Skill

This skill provides the procedural knowledge to keep your OpenClaw instance lean and efficient.

Quick Reference

ProblemSolution
Background tasks bloating contextCron isolation (sessionTarget: "isolated")
Reading entire history every turnLocal RAG with memory_search
Context exceeds 100k tokensReset & Summarize protocol
Finding old conversationsSession transcript indexing

Workflow 1: Periodic Task Isolation

To prevent background tasks from bloating your main conversation context, always isolate them.

Steps

  1. Locate your openclaw.json config.
  2. In the cron.jobs array, set sessionTarget: "isolated" for any task that doesn't need to be part of the main chat history.
  3. Use the message tool within the task's payload if human intervention is required.

Example Config

Details

Repository
github.com/d4kooo/openclaw-token-memory-optimizer
Categories
Memory & Context, Agent Workflow & Planning
First seen
Jun 3, 2026

Similar to Token Optimizer

More Memory & Context