Context Compression
When agent sessions generate millions of tokens of conversation history, compression becomes mandatory. The naive approach is aggressive compression to minimize tokens per request.
Install
npx skills add lucaspmarie-a11y/claude-skills-vault --skill context-compressiongit clone --depth 1 https://github.com/lucaspmarie-a11y/claude-skills-vault.git /tmp/claude-skills-vault
mkdir -p ~/.claude/skills
cp -r /tmp/claude-skills-vault/plugins/antigravity-awesome-skills-claude/skills/context-compression ~/.claude/skills/context-compressionPersonal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.
From the SKILL.md
# 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 Use 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 ## Core Concepts Context compression trades token savings against information loss. Three production-ready approaches exist: 1. **Anchored Iterative Summarization**: Maintain structured, persistent summaries with explicit sections for session intent, file modifications, decisions, and next steps. When compression triggers, summarize only the newly-truncated span and merge with the existing summary. Structure forces preservation by dedicating sections to specific information types. 2. **Opaque Compression**: Produce compressed representations optimized for reconstruction fidelity. Achieves highest compression ratios (99%+) but sacrifices interpretability. Cannot verify what was preserved.
Details
- Skill name
context-compression- Repository
- lucaspmarie-a11y/claude-skills-vault
- Path
plugins/antigravity-awesome-skills-claude/skills/context-compression/SKILL.md- License
- MIT
- Repo updated
- 6 June 2026
FAQ
What does the Context Compression skill do?
When agent sessions generate millions of tokens of conversation history, compression becomes mandatory. The naive approach is aggressive compression to minimize tokens per request.
How do I install the Context Compression skill?
skills CLI (Claude Code, Cursor, Codex and more): npx skills add lucaspmarie-a11y/claude-skills-vault --skill context-compression. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.
Is Context Compression popular?
It lives in lucaspmarie-a11y/claude-skills-vault, which has 5 GitHub stars and 0 forks.
Related skills
Apify Influencer Discovery
5lucaspmarie-a11y/claude-skills-vault
Find and evaluate influencers for brand partnerships, verify authenticity, and track collaboration performance across Instagram, Facebook, YouTube, and TikTok.
00 Andruia Consultant
5lucaspmarie-a11y/claude-skills-vault
Arquitecto de Soluciones Principal y Consultor Tecnológico de Andru.ia. Diagnostica y traza la hoja de ruta óptima para proyectos de IA en español.
10 Andruia Skill Smith
5lucaspmarie-a11y/claude-skills-vault
Ingeniero de Sistemas de Andru.ia. Diseña, redacta y despliega nuevas habilidades (skills) dentro del repositorio siguiendo el Estándar de Diamante.
Context Degradation
5lucaspmarie-a11y/claude-skills-vault
Language models exhibit predictable degradation patterns as context length increases. Understanding these patterns is essential for diagnosing failures and designing resilient systems.
Context Agent
5lucaspmarie-a11y/claude-skills-vault
Agente de contexto para continuidade entre sessoes. Salva resumos, decisoes, tarefas pendentes e carrega briefing automatico na sessao seguinte.
Context Fundamentals
5lucaspmarie-a11y/claude-skills-vault
Context is the complete state available to a language model at inference time. It includes everything the model can attend to when generating responses: system instructions, tool definitions, retrieved documents, message history, and tool outputs.
Browse the most popular Claude skills, all ai, llms & agents skills, or write your own with the skills generator.