token-optimizer
Optimization suite for OpenClaw agents to prevent token leaks and context bloat. Use when an agent needs to implement background task isolation (Cron) or a Reset & Summarize workflow (RAG).
Why use this skill?
Optimize your OpenClaw agent performance. Prevent context bloat, implement local RAG, and automate session summaries with the Token Optimizer skill.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/klautimus/openclaw-token-memory-optimizerWhat This Skill Does
The Token Optimizer skill is a mission-critical utility designed for OpenClaw agents to manage long-term context density and prevent token overflow. By implementing automated background task isolation, structured summarization protocols, and local RAG retrieval, it ensures that your agent remains performant even after weeks of continuous operation. It serves as the primary mechanism for purging ephemeral session data while preserving core project intelligence within a structured MEMORY.md format.
Installation
To integrate this skill into your environment, run the following command via your OpenClaw terminal:
clawhub install openclaw/skills/skills/klautimus/openclaw-token-memory-optimizer
Once installed, you must verify that your openclaw.json configuration reflects the provided path mapping to ensure the RAG engine can access your document storage.
Use Cases
This skill is essential for developers or power users running OpenClaw as a persistent assistant. Primary use cases include: 1) Long-running autonomous projects that accumulate thousands of tokens in chat logs; 2) Systems that utilize frequent cron-based background jobs; 3) Environments with strict context window limitations where aggressive pruning is required to maintain response quality; 4) Agents that need to retrieve historical project decisions without re-reading the entire conversation transcript.
Example Prompts
- "Check my current token usage and tell me if it is time to perform a Digital Soul protocol reset."
- "Search my memory for all design decisions made regarding the database schema last week using memory_search."
- "Isolate the background maintenance task in my config to ensure it stops bloating the main conversation history."
Tips & Limitations
- Pro-Tip: Schedule a monthly session reset to prevent SQLite bloat in your embedding store.
- Constraint: The
sessionTarget: "isolated"configuration is mandatory for high-frequency cron jobs to prevent context corruption. - Limitation: The RAG search quality is highly dependent on the quality of your
MEMORY.mdfile; ensure you follow the 'Daily Log' discipline for the best retrieval results. Do not exceed 100k tokens before triggering a manual reset, as degradation in reasoning capabilities often occurs beyond this point.
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-klautimus-openclaw-token-memory-optimizer": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: file-write, file-read