context-budget
/context-budget
Audit token consumption across agents, skills, MCP servers, and rules. Identifies bloat, redundant components, and produces prioritized token-savings recommendations. Use when the context window is filling up too fast or before adding new components.
- Author
- coco-research ↗
- Repository
- coco ↗
- Licence
- MIT
- Last repository change
- 25.10.2026
Assessment and security
- Files in this package
- 1
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 25.10.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
What it does and when to use it
Audit token consumption across agents, skills, MCP servers, and rules. Identifies bloat, redundant components, and produces prioritized token-savings recommendations. Use when the context window is filling up too fast or before adding new components.
Original author description
Audit token consumption across agents, skills, MCP servers, and rules. Identifies bloat, redundant components, and produces prioritized token-savings recommendations. Use when the context window is filling up too fast or before adding new components.
How it works
- When to Use
- Audit Procedure
- Token Estimation Formula
- Integration Points
SKILL.md preview
---
name: context-budget
description: "Audit token consumption across agents, skills, MCP servers, and rules. Identifies bloat, redundant components, and produces prioritized token-savings recommendations. Use when the context window is filling up too fast or before adding new components."
domain: meta
supports: [claude-code, cursor, codex, generic, windsurf, zed, cline, roo-code, amazon-q]
version: 0.1.0
tags: [context, tokens, optimization, audit]
---
@agents/PROMPT-DEFENSE.md
# Context Budget Audit
Analyze token overhead across every loaded component in a 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
- Planning to add more components and need to know if there's room
- Running `/context-budget` command (this skill backs it)
## Audit Procedure
### 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 — skip identical copies to avoid double-counting
**Rules** (`rules/**/*.md`, `rules/**/*.mdc`)
- Count tokens per file
- Flag: files >100 lines
- Detect content overlap between rule files
**MCP Servers** (active MCP config)
- Count configured servers and total tool count
- Estimate schema overhead at ~500 tokens per tool
- Flag: servers with >20 tools
**CLAUDE.md / System Prompts**
- Count tokens in 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 active command, matches project type | Keep |
| **Sometimes needed** | Domain-specific, not referenced in CLAUDE.md | Consider on-demand activation |
| **Rarely needed** | No command reference, overlapping content, no project match | Remove or lazy-load |
### Phase 3: Report
Generate a prioritized savings report:
```
CONTEXT BUDGET AUDIT
====================
Total estimated tokens: {total}
Context headroom: {headroom}%
TOP SAVINGS OPPORTUNITIES:
1. {component} — {tokens} tokens ({bucket}) → {recommendation}
2. {component} — {tokens} tokens ({bucket}) → {recommendation}
...
ALWAYS NEEDED (keep):
- {component} ({tokens} tokens)
SOMETIMES NEEDED (lazy-load candidates):
- {component} ({tokens} tokens)
RARELY NEEDED (removal candidates):
- {component} ({tokens} tokens)
```
## Token Estimation Formula
- English text: ~1.3 tokens per word
- Code: ~1.5 tokens per word (more punctuation/symbols)
- YAML frontmatter: ~1.2 tokens per word
- MCP tool schema: ~500 tokens per tool definition
## Integration Points
- Run automatically before `/team:ship` to verify context headroom
- Feed results to learning system as optimization instincts
- Cross-reference with Brain DB decisions about past context issues
Versions
| Repository | Score | Licence |
|---|---|---|
| This page · coco-research/coco | 100 | MIT |
| ericrisco/rsc-harness | 100 | MIT |
| Guild-Build/Build | 100 | Apache-2.0 |
| hugrverk/riggverk | 100 | MIT |
| affaan-m/ECC | 100 | MIT |
| OneWave-AI/claude-skills | 100 | MIT |
| SHRIJANAGAIN/Nemo-Cli | 100 | Apache-2.0 |
| drayline/rootnode-skills | 100 | Apache-2.0 |
| afterrealm/father-time | 100 | MIT |
Database snapshot: 13.11.2026 · package version 790a3558ac5d (SHA-256 digest of the entire package)
Downloads in the last 30 days: 1 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100usage-audit
Audit a Claude Code setup for token waste and context bloat. Checks MCP servers, CLAUDE.md, skills, and settings against bloat filters. Triggers on: "audit my context", "usage audit", "token audit", "context bloat". NOT for codebase audits. - 100mcp-to-skill
Converts MCP servers into on-demand skills to cut context window usage, classifying each tool by replacement strategy and generating the skill package. Triggers on: "convert MCP", "MCP to skill", "reduce context size", "too many tools", "tool token bloat", "MCP migration". - 100check-context
Accurately check current context window and token usage. Use when the user asks about context usage, token consumption, or when monitoring context levels. - 100context-rent
Find out what is eating the context window and token budget of Claude Code and Codex CLI sessions, and fix it. Use when the user asks why they hit usage limits, why sessions get slow or expensive, where their tokens go, how to save tokens, whether their CLAUDE.md, AGENTS.md or… - 90context-optimization
Use when optimizing token usage, KV cache efficiency, or context window management for LLM agents. Keywords: context optimization, KV cache, prompt caching, token budget, semantic pruning, lost-in-the-middle. - 100compress
Use when the user says 'tokenstack', 'compression', 'token savings', 'proxy status', or asks about context window usage.