Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Audits Claude Code context window consumption across agents, skills, MCP servers, and rules. Identifies bloat, redundant components, and produces prioritized token-savings recommendations.
.claude/skills/loulanyue-context-budget/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-08 | ✗→✓ | ▲ Improved | 21% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 39% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 74% | 0% |
| case-06 | ✗→✓ | ▲ Improved | -8% | 0% |
| case-11 | ✗→✓ | ▲ Improved | 11% | 0% |
Analyze token overhead across every loaded component in a Claude Code session and surface actionable optimizations to reclaim context space.
/context-budget command (this skill backs it)Scan all component directories and estimate token consumption:
Agents (agents/*.md)
description frontmatter lengthSkills (skills/*/SKILL.md)
.agents/skills/ — skip identical copies to avoid double-countingRules (rules/**/*.md)
MCP Servers (.mcp.json or active MCP config)
gh, git, npm, supabase, vercel)CLAUDE.md (project + user-level)
Sort every component into a bucket:
| Bucket | Criteria | Action | |--------|----------|--------| | Always needed | Referenced in CLAUDE.md, backs an active command, or matches current project type | Keep | | Sometimes needed | Domain-specific (e.g. language patterns), not referenced in CLAUDE.md | Consider on-demand activation | | Rarely needed | No command reference, overlapping content, or no obvious project match | Remove or lazy-load |
Identify the following problem patterns:
Produce the context budget report:
Context Budget Report
═══════════════════════════════════════
Total estimated overhead: ~XX,XXX tokens
Context model: Claude Sonnet (200K window)
Effective available context: ~XXX,XXX tokens (XX%)
Component Breakdown:
┌─────────────────┬────────┬───────────┐
│ Component │ Count │ Tokens │
├─────────────────┼────────┼───────────┤
│ Agents │ N │ ~X,XXX │
│ Skills │ N │ ~X,XXX │
│ Rules │ N │ ~X,XXX │
│ MCP tools │ N │ ~XX,XXX │
│ CLAUDE.md │ N │ ~X,XXX │
└─────────────────┴────────┴───────────┘
⚠ Issues Found (N):
[ranked by token savings]
Top 3 Optimizations:
1. [action] → save ~X,XXX tokens
2. [action] → save ~X,XXX tokens
3. [action] → save ~X,XXX tokens
Potential savings: ~XX,XXX tokens (XX% of current overhead)In verbose mode, additionally output per-file token counts, line-by-line breakdown of the heaviest files, specific redundant lines between overlapping components, and MCP tool list with per-tool schema size estimates.
Basic audit
User: /context-budget
Skill: Scans setup → 16 agents (12,400 tokens), 28 skills (6,200), 87 MCP tools (43,500), 2 CLAUDE.md (1,200)
Flags: 3 heavy agents, 14 MCP servers (3 CLI-replaceable)
Top saving: remove 3 MCP servers → -27,500 tokens (47% overhead reduction)Verbose mode
User: /context-budget --verbose
Skill: Full report + per-file breakdown showing planner.md (213 lines, 1,840 tokens),
MCP tool list with per-tool sizes, duplicated rule lines side by sidePre-expansion check
User: I want to add 5 more MCP servers, do I have room?
Skill: Current overhead 33% → adding 5 servers (~50 tools) would add ~25,000 tokens → pushes to 45% overhead
Recommendation: remove 2 CLI-replaceable servers first to stay under 40%words × 1.3 for prose, chars / 4 for code-heavy files| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-08 | fail→pass | 12,208 | 6,204 | -49% | 1 | 1 | 0% | 1,856 | 2,244 | +21% | 0 | 0 | — |
case-01 | fail→fail | 17,984 | 7,257 | -60% | 1 | 1 | 0% | 2,847 | 1,829 | -36% | 0 | 0 | — |
case-02 | fail→fail | 22,581 | 4,210 | -81% | 1 | 1 | 0% | 2,463 | 1,923 | -22% | 0 | 0 | — |
case-03 | fail→fail | 26,356 | 9,802 | -63% | 1 | 1 | 0% | 4,005 | 2,694 | -33% | 0 | 0 | — |
case-22 | pass→pass | 9,808 | 4,406 | -55% | 1 | 1 | 0% | 1,837 | 2,144 | +17% | 0 | 0 | — |
case-04 | fail→pass | 7,578 | 2,825 | -63% | 1 | 1 | 0% | 1,304 | 1,809 | +39% | 0 | 0 | — |
case-05 | fail→pass | 6,065 | 2,177 | -64% | 1 | 1 | 0% | 1,009 | 1,758 | +74% | 0 | 0 | — |
case-06 | fail→pass | 11,942 | 2,755 | -77% | 1 | 1 | 0% | 2,040 | 1,873 | -8% | 0 | 0 | — |
case-07 | pass→pass | 10,472 | 3,527 | -66% | 1 | 1 | 0% | 1,606 | 1,993 | +24% | 0 | 0 | — |
case-09 | pass→pass | 9,075 | 3,948 | -56% | 1 | 1 | 0% | 1,386 | 1,941 | +40% | 0 | 0 | — |
case-10 | pass→pass | 17,852 | 3,049 | -83% | 1 | 1 | 0% | 2,792 | 1,789 | -36% | 0 | 0 | — |
case-11 | fail→pass | 15,579 | 8,101 | -48% | 1 | 1 | 0% | 2,489 | 2,759 | +11% | 0 | 0 | — |
case-12 | pass→pass | 12,674 | 7,121 | -44% | 1 | 1 | 0% | 1,946 | 2,449 | +26% | 0 | 0 | — |
case-13 | pass→pass | 12,338 | 4,633 | -62% | 1 | 1 | 0% | 1,989 | 2,000 | +1% | 0 | 0 | — |
case-14 | fail→pass | 8,293 | 2,342 | -72% | 1 | 1 | 0% | 1,201 | 1,807 | +50% | 0 | 0 | — |
case-15 | fail→pass | 7,103 | 2,311 | -67% | 1 | 1 | 0% | 1,153 | 1,770 | +54% | 0 | 0 | — |
case-16 | fail→pass | 14,156 | 3,875 | -73% | 1 | 1 | 0% | 2,124 | 2,036 | -4% | 0 | 0 | — |
case-17 | pass→pass | 4,602 | 3,337 | -27% | 1 | 1 | 0% | 692 | 1,995 | +188% | 0 | 0 | — |
case-18 | fail→pass | 9,449 | 2,661 | -72% | 1 | 1 | 0% | 1,146 | 1,751 | +53% | 0 | 0 | — |
case-19 | fail→pass | 14,727 | 7,791 | -47% | 1 | 1 | 0% | 2,224 | 2,725 | +23% | 0 | 0 | — |
case-20 | pass→pass | 15,747 | 18,698 | +19% | 1 | 1 | 0% | 3,067 | 5,297 | +73% | 0 | 0 | — |
case-21 | pass→pass | 12,063 | 9,102 | -25% | 1 | 1 | 0% | 2,156 | 2,899 | +34% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 21 counted toward the lift figure. The other 1 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +45 percentage points is the difference between those two pass rates over the 21 comparable cases. 2 cases got worse with the skill loaded, and they are included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.