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-code

Installs 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

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

Sponsors

Details

Repository
github.com/d4kooo/openclaw-token-memory-optimizer
First seen
Jun 3, 2026

Recommended

1juliusbrussee avatarcavemanjuliusbrussee/cavemanUltra-compressed communication mode. Cuts output tokens 65% (measured) by speaking like caveman while keeping full technical accuracy. Supports intensity levels618.3Kskills.sh installs
2mattpocock avatargrill-memattpocock/skillsA relentless interview to sharpen a plan or design.1.5Mskills.sh installs
3shadcn avatarimproveshadcn/improveSurvey any codebase as a senior advisor and produce prioritized, self-contained implementation plans for OTHER models/agents to execute. Strictly read-only on s40Kskills.sh installs
4obra avatarsystematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes326.7Kskills.sh installs
5forrestchang avatarkarpathy-guidelinesforrestchang/andrej-karpathy-skillsBehavioral guidelines to reduce common LLM coding mistakes through explicit assumptions, simplicity, and verifiable success criteria.17.9Kskills.sh installs
6vercel-labs avatarfind-skillsvercel-labs/skillsHelps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express int4.3Mskills.sh installs