Context budget audit
Skill justinramos101/agent-skill-kit/skills/.experimental/context-budget-audit
Battle-tested Agent Skills for coding agents — source-grounded, failure-driven heuristics that audit and design real surfaces. Install with npx skills.
npx -y skills add justinramos101/agent-skill-kit --skill context-budget-auditAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Audit and prune per-session context waste — MCP servers, plugins, skills, slash commands, subagents. Triggers: 'what's eating my context', 'trim my agent setup', 'what am I not using'. Do NOT use to harden a repo's agent config or hooks, for runtime trace/eval observability, or to size prompt text.
The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
3.5 KB, as published. Nobody here has run it
Context Budget Audit
Core principle: everything loaded at session start spends context before the user types a word. MCP tool schemas, skill descriptions, slash-command and subagent listings, enabled plugins — measure that spend from local disk evidence and report what to prune, biggest wins first. Audit and recommendations run to completion; the one stop is editing the user's harness config.
Invariants
- The engine is read-only; it never edits or deletes anything.
- An MCP server with no observed
mcp__<server>__*tool calls is idle: cost unknown-but-likely-largest, never "~0 tokens". Surface idle servers first. - Footprint vs reclaim: "descriptions compressed" warnings come from aggregate load (count × description length), not individual non-use — the levers are fewer loaded items and shorter heavy descriptions, not only deleting unused ones.
- Token figures are estimates; counts are evidence matches; "no evidence" means none in the scan window, not never used. Generic names (
run,review) are weak evidence. - Never quote raw transcript, prompt, or credential content — display paths, counts, timestamps, and classification reasons only.
- System skills (
.system) and plugin/marketplace caches are inventory-only, never prune targets. Disabled plugins cost zero context — not reclaim candidates. - Never remove a skill store copy without a validated repo copy; if copies differ, remove nothing and flag the difference in the report.
Workflow
- Run the engine.
python3 scripts/audit_context_budget.py --repo-root <repo-root> --no-write— use the current repo when it has askills/directory, else the user's named repo. It scans active stores under~/.claude,~/.codex,~/.agents, and~/.pifor five kinds:mcp,skill,command,subagent,plugin. Never hand-roll the inventory or evidence scan. Add scope flags (--only mcp,--evidence-days 0,--max-evidence-files N,--json) only when the user asked or the default pass is too slow. - Interpret the output with
references/audit-framework.md: evidence strength, idle-MCP detection, duplicates, estimate caveats. - Recommend with
references/recommendation-rubric.md. Build the full prune plan: reclaimable headline, context footprint by kind, per-kind reclaim groups sorted by cost, weak-evidence and duplicate rows, kept items, caveats — with the exact removal command or file path on every recommendation. - Act, stopping at the config boundary. Deliver the complete decision view. If the user named items to remove: skills go through copy-validate-remove (preserve into
skills/<name>/, validate withnpx skills add . --listplus the repo's own gate, then remove the store copy and verify it is gone); slash commands and subagents are single.mdfiles — confirm the exact path, delete only that file. Edits to~/.claude.json,~/.codex/config.toml, orsettings.json(MCP servers, plugins) are the one genuine blocker: report the exact command (claude mcp remove <name>; disable viaenabledPlugins) and end — never apply them yourself. Paths and flags here are an illustrative snapshot; the engine (scripts/audit_context_budget.py) is authoritative on scanned locations.