Context Budget
Audit your Claude context window usage. Ranks top consumers, scores each against value delivered, produces a trim list and runway estimate.
How It Works
- Session feels sluggish: Frequent compaction, or hygiene check after adding MCPs
- Inventory context sources: CLAUDE.md · MEMORY.md · MCPs · skills · hooks — measured, not guessed
- Estimate token overhead: wc -c / 4 per file · ~500 per MCP · ~200 per skill
- Detect bloat: CLAUDE.md >300 lines · >10 MCPs · MEMORY.md truncation · duplicates
- Score cost vs value: High token cost + low reference = trim candidate
- Budget table + trim list: Available-for-work calc + specific files / servers to cut
Invocation Triggers
/context-budgetcontext audithow much context am I usingcontext windowtoken budgetUse Cases
- Audit a long session before context saturation degrades response quality
- Identify which files and tool outputs are burning the most tokens
- Plan next-session setup by generating a concrete trim list
The Problem
Claude's context window is finite. As a session grows, performance degrades — responses slow, key facts get compressed away, the assistant loses the thread on complex tasks. Most Claude Code operators don't know where their context is going until the session is already compromised. By then, the damage is done.
What It Does
- 1Estimate token consumption by source
Reads current session inputs — files loaded, tool outputs returned, CLAUDE.md length, conversation length — and estimates token cost per source category.
- 2Rank the top 5 consumers
Identifies what is taking the most context, broken down by: files read, MCP tool outputs, conversation history, and system prompts (CLAUDE.md, memory files).
- 3Score each against value delivered
For each top consumer: how many times was this actually referenced? Did it change the behavior of the session? High cost + low reference = trim candidate.
- 4Produce the trim list
Specific files to stop loading, tool outputs to summarize rather than keep raw, conversation history to compact before next session.
- 5Estimate remaining runway
Rough estimate of messages/actions remaining before context saturation affects quality. Flags if already in the degradation zone.
What You Get / What It Doesn't Do
- Context budget breakdown by source category (files, tools, prompts, conversation)
- Top 5 consumers ranked by estimated token cost
- Trim list with specific recommendations and expected savings
- Runway estimate for the current session
- Clear your context or start a new session
- Modify CLAUDE.md or memory files for you
- Measure token usage with precision (estimates based on character counts and known token ratios)
- Work without Claude Code's context structure
Tips
Run at the start of a session, not when you're already context-saturated. Prevention is cheaper than recovery.
CLAUDE.md and memory files are almost always in the top 3. Make sure they're earning their token cost — trim anything that hasn't changed behavior in the last month.
If the same large file appears in every session, create a tier-2 reference (load only when needed) instead of always loading it.
Get the Skill
Unlock the full Context Budget SKILL.md — drop it into ~/.claude/skills/ and trigger it by name.
- Context budget breakdown by source category (files, tools, prompts, conversation)
- Top 5 consumers ranked by estimated token cost
- Trim list with specific recommendations and expected savings
- Runway estimate for the current session
Commonly Used With
29 more production skills ready to install.