context-management
Installation
SKILL.md
Context Management
Prevent context exhaustion, enforce spawn discipline, and make compaction survivable.
Core Concepts
- Fixed baseline: Typically 5-15% of context consumed before any conversation — system prompt, workspace files, skill descriptions, tool definitions. Varies by setup (more skills/files = higher baseline).
- 60/40 rule: ~60% of consumed context is tool outputs, ~40% conversation. Tool outputs are the primary target for savings.
- Compaction is lossy: Summaries stack cumulatively. Each cycle raises the floor. After 3+ compactions, summaries alone can consume 30%+ of context.
- Sub-agents are disposable context: A sub-agent can burn most of its context investigating something; only the summary (~500 tokens) enters main context.
All percentages are relative to the model's context window. Check session_status for actual window size and usage.
Procedures
When Context Pressure Rises
After every tool-heavy operation (>5 tool calls), assess: