
Context Compression
When your agent session hits hundreds of thousands of tokens and starts forgetting which files it modified, you need compression that doesn't break task continuity. This skill walks through three production approaches: anchored iterative summarization for file-heavy work, opaque compression when you need maximum token savings, and regenerative summaries for readable handoffs. The key insight is optimizing for tokens per task, not per request. If your compression drops a file path and the agent has to re-explore the codebase, you've lost more tokens than you saved. Comes with structured templates, probe-based evaluation tactics, and honest tradeoffs between the approaches.
- skills.sh installs
- 565
- GitHub stars
- 18.3K
- last updated
- May 26, 2026
Install
$ npx -y skills add muratcankoylan/agent-skills-for-context-engineering --skill context-compression --agent claude-codeInstalls into .claude/skills of the current project.
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
Sponsors
Details
- Repository
- github.com/muratcankoylan/agent-skills-for-context-engineering
- Category
- AI & Agent Building
- License
- MIT
- First seen
- Jun 11, 2026
More from muratcankoylan/agent-skills-for-context-engineering
All 17- Context Optimization449
- Filesystem Context378
- Multi Agent Patterns329
- Memory Systems321
- Tool Design291
- Context Degradation280
- Evaluation262
- Context Fundamentals253
- Latent Briefing195
- Harness Engineering189
- Project Development189
- Advanced Evaluation185
- Hosted Agents164
- Bdi Mental States160
- Context Engineering Collection
- Context Engineering Collection4.4K