Agent skill · Workflow & Productivity

context-compression

This skill should be used when long-running agent sessions need context compression, structured summarization, compaction, token-per-task optimization, or durable handoff summaries that preserve decisions, files, risks, and next actions.

guanyanggithub.com/guanyangGitHub ↗
claude-codeships scriptsMIT
Install
npx skills add guanyang/open-agent-hub --skill context-compression --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 4
SKILL.md size: 18 KB
Bundled scripts: yes
Path: skills/context-compression/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 940
Language: TypeScript

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

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 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 Do not activate this skill for adjacent work owned by other skills: - General token-efficiency tactics such as masking, prefix caching, or partitioning: `context-optimization`. - Diagnosing why a long context is failing before choosing a mitigation: `context-degradation`. - Writing raw outputs, logs, or plans to files without summarizing them: `filesystem-context`. - Designing long-term semantic memory a

What's inside
Steps it walks through
  1. When to Activate
  2. Core Concepts
  3. Detailed Topics
  4. Optimize for Tokens-Per-Task, Not Tokens-Per-Request
  5. Solve the Artifact Trail Problem First
  6. Structure Summaries with Mandatory Sections
  7. Choose Compression Triggers Strategically
  8. Evaluate Compression with Probes, Not Metrics
  9. Score Compression Across Six Dimensions
  10. Practical Guidance
  11. Apply the Three-Phase Compression Workflow for Large Codebases
  12. Use Example Artifacts as Compression Seeds
  13. Implement Anchored Iterative Summarization Step by Step
  14. Select the Right Approach for the Session Profile
Ships with 3 files
  • references/evaluation-framework.md
  • scripts/compression_evaluator.py
  • tests/test_compression_evaluator.py
More from open-agent-hub
All skills →
About this skill
What does the context-compression skill do?

This skill should be used when long-running agent sessions need context compression, structured summarization, compaction, token-per-task optimization, or durable handoff summaries that preserve decisions, files, risks, and next actions.

How do I install it?

Run `npx skills add guanyang/open-agent-hub --skill context-compression --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From guanyang/open-agent-hub, a repository with 940 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going