
Token Optimizer
If your OpenClaw agent is burning through tokens on background tasks or re-reading entire histories every turn, this is the fix. It walks you through isolating cron jobs to separate sessions, setting up local RAG with memory_search to pull only what you need, and running a "Reset & Summarize" protocol when context bloats past 100k tokens. The documentation is practical, with actual config snippets for openclaw.json and a clear troubleshooting section. Written by Pépère and Zayan, it treats token management as infrastructure work, not an afterthought. Most useful once you've hit the pain point of sluggish responses or surprise context overflows.
- skills.sh installs
- 504
- GitHub stars
- 20
- last updated
- Jun 3, 2026
Install
$ npx -y skills add d4kooo/openclaw-token-memory-optimizer --skill token-optimizer --agent claude-codeInstalls into .claude/skills of the current project.
Files
Token Optimizer Skill
This skill provides the procedural knowledge to keep your OpenClaw instance lean and efficient.
Quick Reference
| Problem | Solution |
|---|---|
| Background tasks bloating context | Cron isolation (sessionTarget: "isolated") |
| Reading entire history every turn | Local RAG with memory_search |
| Context exceeds 100k tokens | Reset & Summarize protocol |
| Finding old conversations | Session transcript indexing |
Workflow 1: Periodic Task Isolation
To prevent background tasks from bloating your main conversation context, always isolate them.
Steps
- Locate your
openclaw.jsonconfig. - In the
cron.jobsarray, setsessionTarget: "isolated"for any task that doesn't need to be part of the main chat history. - Use the
messagetool within the task's payload if human intervention is required.
Example Config
Sponsors
Details
- Repository
- github.com/d4kooo/openclaw-token-memory-optimizer
- First seen
- Jun 3, 2026