Context Compression
Structured context compression for long agent sessions, optimizing total tokens per task rather than per request.
- CCM score
- 58 of 100
- skills.sh installs
- 388
- GitHub stars
- 1K
- last updated
- Jun 3, 2026
Own this skill? Claim it
What it does
- Covers three approaches: anchored iterative summarization, opaque compression, and regenerative full summaries, each with a stated tradeoff
- Includes mandatory summary sections for session intent, files modified, decisions, current state, and next steps, plus probe-based evaluation
- Enforces artifact trail preservation with explicit file paths, function names, and identifiers, recommending a separate artifact index over summarizer-only tracking
- Designed for coding and long-running agents, with a clear boundary against adjacent skills such as
context-optimizationandmemory-systems
Install
$ npx -y skills add guanyang/open-agent-hub --skill context-compression -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
Context Compression Strategies
When agent sessions generate millions of tokens of conversation history, compression becomes mandatory. The naive approach is aggressive compression to minimize tokens per request. The correct optimization target is tokens per task: total tokens consumed to complete a task, including re-fetching costs when compression loses critical information.
When to Activate
Activate this skill when:
- Agent sessions exceed context window limits
- Codebases exceed context windows (5M+ token systems)
- Designing conversation summarization strategies
- Debugging cases where agents "forget" what files they modified
- Building evaluation frameworks for compression quality
- Creating durable handoff summaries that preserve decisions, files, risks, and next actions
Details
- Repository
- github.com/guanyang/open-agent-hub
- Categories
- Memory & Context, AI Agents & LLM Apps
- First seen
- Jun 3, 2026
Questions
What does the context-compression skill do for coding agents?
The context-compression skill helps long-running agent sessions compress their context, using structured summaries that preserve decisions, files, risks, and next actions. It targets tokens per task rather than tokens per request, so compression does not force costly re-reading of files.
How do I install the context-compression skill?
Run npx -y skills add guanyang/open-agent-hub --skill context-compression -y in your project. The skill then lets the agent summarize long sessions while keeping file changes and next steps intact.
Which other skills are in the Memory & Context category with context-compression?
Context-compression sits in the Memory & Context category alongside handoff, caveman-compress, caveman-stats, caveman-learn and caveman-optimize. Its own focus is structured summarization for durable handoffs and artifact tracking during long sessions.
When should I use context-compression instead of related skills?
Use it when agent sessions exceed context window limits or when the agent forgets which files it modified. The SKILL.md says general token tactics belong to context-optimization, and long-term semantic memory belongs to memory-systems.
More from guanyang/open-agent-hub
All 8Similar to Context Compression
More Memory & Contextcontext-optimizationSkillsickn33/agentic-awesome-skills561 installsStrategies for stretching limited context windows through compaction, observation masking, KV-cache reuse, and partitioning.
session-compressionSkillbobmatnyc/claude-mpm-skills680 installsCompression techniques for long multi-turn AI conversations, from progressive summarization to prompt caching.
agentmemoryPluginrohitg00/agentmemory30.6K starsPersistent memory for AI coding agents -- captures tool usage, compresses via LLM, injects context into future sessions
context-engineeringSkillrohitg00/pro-workflow180 installsFour-operation guide for managing context in AI coding sessions: Write, Select, Compress, Isolate.
memory-systemsSkillguanyang/open-agent-hub417 installsPersistent semantic memory for agents that covers cross-session retention, entity tracking, temporal validity, and retrieval strategy selection.
context-management-context-saveSkillsickn33/agentic-awesome-skills317 installsDesign guide for capturing and restoring project context across AI sessions, with explicit data-handling rules.