context-compression
This skill should be used when the user asks to "compress context", "summarize conversation history", "implement compaction", "reduce token usage", or mentions context compression, structured summarization, tokens-per-task optimization, or long-running agent sessions exceeding context limits.
Why use this skill?
Learn how to optimize OpenClaw AI agent sessions with context compression. Reduce token usage and manage long conversation histories effectively.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/leoyessi10-tech/context-engineeringWhat This Skill Does
The context-compression skill provides advanced mechanisms for managing long-running agent sessions and massive codebases. As OpenClaw sessions grow, context window limits can hinder performance and degrade accuracy. This skill implements sophisticated strategies—including anchored iterative summarization and regenerative full summarization—to distill vast amounts of conversation history into concise, actionable summaries without sacrificing critical task information.
By prioritizing 'tokens-per-task' over simple 'tokens-per-request' metrics, this skill ensures that agents maintain necessary awareness of project state, file modifications, and decision trees, effectively preventing the 'forgetfulness' common in extended development sessions.
Installation
To install this skill, run the following command in your terminal: clawhub install openclaw/skills/skills/leoyessi10-tech/context-engineering
Use Cases
- Managing large-scale software development projects where the codebase exceeds 5M tokens.
- Maintaining state persistence across long-running debugging sessions that span multiple days.
- Reducing costs in agent-based systems by optimizing token consumption without losing contextual nuance.
- Evaluation and testing of summarization models for specific agent architectures.
- Assisting agents in tracking complex file-state changes, ensuring they remember which modules were edited, read, or created.
Example Prompts
- "Our session has grown quite long, please trigger context compression and summarize our current progress on the authentication module."
- "Implement a structured compaction strategy for our conversation history to ensure the agent doesn't lose track of the file modification logs."
- "The context window is nearing its limit; summarize the last 50,000 tokens while keeping a detailed registry of all created files and pending tasks."
Tips & Limitations
- The Artifact Trail Problem: Even with structured summarization, keep in mind that tracking file-state (created vs. modified vs. read) is the most challenging aspect of compression. It is recommended to maintain a secondary, explicit file-state index if your agent performs deep coding tasks.
- Optimization Target: Do not optimize for the highest compression ratio alone. Over-compression often forces agents to re-fetch information, which leads to higher net token usage. Always optimize for tokens-per-task.
- Consistency: Use Anchored Iterative Summarization when working on complex, multi-step projects to ensure that previous decisions and session intents are preserved across compression cycles.
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-leoyessi10-tech-context-engineering": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: file-read