← Skills Library
Intelligence

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

Context Budget · Workflow
Measure what burns your context, then hand back a trim list.
TriggerSession feels sluggish · Frequent compaction, or hygiene check after adding MCPs
1
Inventory context sources
CLAUDE.md · MEMORY.md · MCPs · skills · hooks — measured, not guessed
2
Estimate token overhead
wc -c / 4 per file · ~500 per MCP · ~200 per skill
3
Detect bloat
CLAUDE.md >300 lines · >10 MCPs · MEMORY.md truncation · duplicates
4
Score cost vs value
High token cost + low reference = trim candidate
Budget table + trim list · Available-for-work calc + specific files / servers to cut
  1. Session feels sluggish: Frequent compaction, or hygiene check after adding MCPs
  2. Inventory context sources: CLAUDE.md · MEMORY.md · MCPs · skills · hooks — measured, not guessed
  3. Estimate token overhead: wc -c / 4 per file · ~500 per MCP · ~200 per skill
  4. Detect bloat: CLAUDE.md >300 lines · >10 MCPs · MEMORY.md truncation · duplicates
  5. Score cost vs value: High token cost + low reference = trim candidate
  6. Budget table + trim list: Available-for-work calc + specific files / servers to cut
ↆ download card

Invocation Triggers

/context-budgetcontext audithow much context am I usingcontext windowtoken budget

Use 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

  1. 1
    Estimate 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.

  2. 2
    Rank 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).

  3. 3
    Score 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.

  4. 4
    Produce the trim list

    Specific files to stop loading, tool outputs to summarize rather than keep raw, conversation history to compact before next session.

  5. 5
    Estimate 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

What you get
  • 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
What it doesn't do
  • 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, not the end

Run at the start of a session, not when you're already context-saturated. Prevention is cheaper than recovery.

CLAUDE.md is almost always top 3

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.

Create tier-2 references

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

Pro SkillPRO

Unlock the full Context Budget SKILL.md — drop it into ~/.claude/skills/ and trigger it by name.

What you unlock
  • 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

Skills Library

29 more production skills ready to install.

Browse All Skills