agentleFS
LucasCooperBeyLucasCooperBey/claude-skills/skills/context-budget/SKILL.md

context-budget

Skill1 starsChanged 5 months agoMITView on GitHub

Audit token consumption across all loaded components — skills, agents, MCP tools, rules, hooks

We split this skill into the rules it gives an agent

4 rules. 0 are common, 4 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 46 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run these in parallel:

    line 19
  2. Distinctive:

    Keep MCP servers under 10 enabled / under 80 total tools

    line 65
  3. Distinctive:

    Consider disabling MCP servers you use < once/week

    line 67
  4. Distinctive:

    Check if any plugins overlap in functionality

    line 68

“Common” is measured: kept by at least 6 in 10 of the 46 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Context Budget Audit

Estimate how much of your context window is consumed by the agent harness infrastructure vs actual work.

When to Use

  • Context feels heavy or compacting frequently
  • Adding new skills/MCPs and want to know the cost
  • Optimizing which components stay loaded

Process

1. Inventory All Loaded Components

Run these in parallel:

MCP Tools:

# Count MCP tools (each tool ≈ 500 tokens for schema)
cat ~/.claude/settings.json | python3 -c "
import json, sys
d = json.load(sys.stdin)
# Count enabled plugins
plugins = {k:v for k,v in d.get('enabledPlugins',{}).items() if v}
print(f'Enabled plugins: {len(plugins)}')
for p in plugins: print(f'  - {p}')
"

Skills loaded in CLAUDE.md: Count skill references in CLAUDE.md capability routing table. Each skill listing in the system prompt ≈ 100-200 tokens.

Agent definitions: Each agent defined in ~/.claude/agents/ ≈ 300-800 tokens when loaded.

Hook definitions: Each hook in settings.json ≈ 50-100 tokens.

2. Estimate Token Budget

ComponentPer-Unit EstimateCountTotal
MCP tool schema~500 tokens??
Skill listing (system prompt)~150 tokens??
Agent definition~500 tokens??
Hook definition~75 tokens??
CLAUDE.mdmeasure directly1?
MEMORY.mdmeasure directly1?

Key insight from ECC: "Your 200k context window before compacting might only be 70k with too many tools enabled."

3. Classify Components

For each component, classify:

  • Always: Core workflow, used every session
  • Sometimes: Domain-specific, used in certain projects
  • Rarely: Niche, could be loaded on-demand

4. Recommendations

  • Keep MCP servers under 10 enabled / under 80 total tools
  • Move "Rarely" skills to on-demand invocation
  • Consider disabling MCP servers you use < once/week
  • Check if any plugins overlap in functionality

Output Format

CONTEXT BUDGET AUDIT — {date}
═══════════════════════════════
Estimated infrastructure overhead: ~{N}k tokens
Estimated available for work: ~{M}k tokens ({P}% of 200k)

TOP CONSUMERS:
1. {component} — ~{N} tokens
2. {component} — ~{N} tokens
...

RECOMMENDATIONS:
- {action}

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.