
Context Compression
This handles context compression for long-running agent sessions where naive summarization causes the agent to forget which files it modified or lose track of decisions. It recommends anchored iterative summarization with structured sections (files modified, decisions made, next steps) rather than regenerating summaries from scratch each time, which causes cumulative detail loss. The key insight is optimizing for tokens per task, not tokens per request. If your agent keeps re-reading files it already processed, you're compressing too aggressively and wasting more tokens on re-fetching than you save. Use probe-based evaluation (can the agent answer "which files did we modify?") instead of metrics like ROUGE, which miss the functional details that actually matter for continuation.
- skills.sh installs
- 128
- GitHub stars
- 848
- last updated
- Jun 3, 2026
Install
$ npx -y skills add guanyang/antigravity-skills --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/guanyang/antigravity-skills
- First seen
- Jun 3, 2026