Tooluck logoTooluck
SKILL.md

context-compression

Agent skill frommuratcankoylan/Agent-Skills-for-Context-Engineering

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 to install context-compression

install context-compression
# install the Agent-Skills-for-Context-Engineering pack with the skills CLI
npx skills add muratcankoylan/Agent-Skills-for-Context-Engineering

# or add only this skill to Claude Code: copy the folder

skills/context-compression/

# into

~/.claude/skills/context-compression/ (all projects)

.claude/skills/context-compression/ (one project)

skills/context-compression/SKILL.md

MITFull file
1# Context Compression Strategies
2
3When 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.
4
5## When to Activate
6
7Activate this skill when:
8- Agent sessions exceed context window limits
9- Codebases exceed context windows (5M+ token systems)
10- Designing conversation summarization strategies
11- Debugging cases where agents "forget" what files they modified
12- Building evaluation frameworks for compression quality
13- Creating durable handoff summaries that preserve decisions, files, risks, and next actions
14
15Do not activate this skill for adjacent work owned by other skills:
16- General token-efficiency tactics such as masking, prefix caching, or partitioning: `context-optimization`.
17- Diagnosing why a long context is failing before choosing a mitigation: `context-degradation`.
18- Writing raw outputs, logs, or plans to files without summarizing them: `filesystem-context`.
19- Designing long-term semantic memory across sessions: `memory-systems`.
20- The model deciding when and where to rewrite its own context: `self-managed-context`. This skill still owns what the replacement text must preserve.
21
22## Core Concepts
23…

Excerpt shown under the repository's MIT license.

More skills in Agent-Skills-for-Context-Engineering

Keep exploring

Similar skill repositories

thedotmack /

claude-mem
116k

Persistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More

CCCXGHGM+135 skills

Newsletter

Join the Community

Subscribe to our newsletter for the latest news and updates