context-compression

Installation
SKILL.md

Context Compression Strategies

When agent sessions generate millions of tokens of conversation history, compression becomes mandatory. Optimize for tokens per task (total tokens to complete a task, including re-fetching costs), not tokens per request.

When to Activate

  • Agent sessions exceeding context window limits
  • Codebases exceeding context windows (5M+ token systems)
  • Designing conversation summarization strategies
  • Debugging cases where agents "forget" modified files

Three Approaches

  1. Anchored Iterative Summarization: Maintain structured, persistent summaries with explicit sections for session intent, file modifications, decisions, and next steps. On compression, summarize only the newly-truncated span and merge with 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.

  3. Regenerative Full Summary: Generate detailed structured summaries on each compression. Readable output but may lose details across repeated cycles due to full regeneration rather than incremental merging.

Installs
2
GitHub Stars
5
First Seen
Jul 2, 2026