
Context Budget
Audit how much of Claude Code’s context window agents, skills, MCP servers, and rules consume so you can trim bloat before sessions slow down or quality drops.
Overview
context-budget is an agent skill most often used in Build (also Ship, Operate) that audits Claude Code context consumption across agents, skills, rules, and MCP servers and recommends prioritized token savings.
Install
npx skills add https://github.com/affaan-m/everything-claude-code --skill context-budgetWhat is this skill?
- Four-phase audit: inventory agents, skills, rules, and MCP servers with token estimates
- Flags heavy agents (>200 lines), bloated skill frontmatter, oversized SKILL.md (>400 lines), and rule overlap
- Detects duplicate skill copies under `.agents/skills/` to avoid double-counting
- Estimates MCP schema overhead from configured servers and tool counts
- Produces prioritized token-savings recommendations for sluggish or crowded sessions
- Flags agent files heavier than 200 lines and SKILL.md files heavier than 400 lines
Adoption & trust: 4.1k installs on skills.sh; 210k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You loaded dozens of skills and MCP tools but do not know which pieces are eating the context window or making sessions feel slow.
Who is it for?
Solo builders running heavy Claude Code stacks who want a structured audit before adding more skills or MCP servers.
Skip if: Teams that never customize agents, skills, or MCP—or anyone optimizing application runtime rather than agent session context.
When should I use this skill?
Session performance feels sluggish, you recently added skills/agents/MCP, you want context headroom visibility, or you run `/context-budget`.
What do I get? / Deliverables
You get a component-by-component token inventory, bloat flags, and a prioritized list of what to remove or slim so the next session has more usable context.
- Token inventory by component type
- Bloat and redundancy flags
- Prioritized token-savings recommendations
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Canonical shelf is Build because the skill inventories loaded agent components (skills, MCP, rules) in an active coding session—the core solo-builder setup phase. agent-tooling is the right facet: it measures and optimizes the agent runtime stack, not product app code.
Where it fits
After importing ten marketplace skills, run an inventory before wiring another MCP server into `.mcp.json`.
Pre-launch, verify rules and agent files are not duplicating guidance that will crowd the context window during final review passes.
When daily agent sessions feel slower, re-audit token overhead to decide which components to retire.
How it compares
Use this structured component audit instead of guessing which skill or MCP server to disable ad hoc in settings.
Common Questions / FAQ
Who is context-budget for?
Solo and indie builders using Claude Code with multiple agents, skills, rules, and MCP servers who need measurable context headroom.
When should I use context-budget?
During Build when expanding your agent toolkit, in Ship when hardening your coding workflow before release, and in Operate when session speed or output quality degrades after recent tooling changes.
Is context-budget safe to install?
It is a read-and-analyze workflow over local project and config paths; review the Security Audits panel on this page and confirm it only scans directories you intend before running in sensitive repos.
SKILL.md
READMESKILL.md - Context Budget
# Context Budget Analyze token overhead across every loaded component in a Claude Code session and surface actionable optimizations to reclaim context space. ## When to Use - Session performance feels sluggish or output quality is degrading - You've recently added many skills, agents, or MCP servers - You want to know how much context headroom you actually have - Planning to add more components and need to know if there's room - Running `/context-budget` command (this skill backs it) ## How It Works ### Phase 1: Inventory Scan all component directories and estimate token consumption: **Agents** (`agents/*.md`) - Count lines and tokens per file (words × 1.3) - Extract `description` frontmatter length - Flag: files >200 lines (heavy), description >30 words (bloated frontmatter) **Skills** (`skills/*/SKILL.md`) - Count tokens per SKILL.md - Flag: files >400 lines - Check for duplicate copies in `.agents/skills/` — skip identical copies to avoid double-counting **Rules** (`rules/**/*.md`) - Count tokens per file - Flag: files >100 lines - Detect content overlap between rule files in the same language module **MCP Servers** (`.mcp.json` or active MCP config) - Count configured servers and total tool count - Estimate schema overhead at ~500 tokens per tool - Flag: servers with >20 tools, servers that wrap simple CLI commands (`gh`, `git`, `npm`, `supabase`, `vercel`) **CLAUDE.md** (project + user-level) - Count tokens per file in the CLAUDE.md chain - Flag: combined total >300 lines ### Phase 2: Classify 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 | ### Phase 3: Detect Issues Identify the following problem patterns: - **Bloated agent descriptions** — description >30 words in frontmatter loads into every Task tool invocation - **Heavy agents** — files >200 lines inflate Task tool context on every spawn - **Redundant components** — skills that duplicate agent logic, rules that duplicate CLAUDE.md - **MCP over-subscription** — >10 servers, or servers wrapping CLI tools available for free - **CLAUDE.md bloat** — verbose explanations, outdated sections, instructions that should be rules ### Phase 4: Report 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 │ └─────────────────┴────────┴───────────┘ WARNING: 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. ## Examples **Basic audit** ``` User: /context-budget Skill: Scans setup → 16 agents (12,400 tokens), 2