budget

A tool that estimates which project instructions, memory files, skills, and tool definitions use the most space in an agent’s context window.

In plain words
What is it for?
Use it to rank the largest context contributors, view machine-readable usage data, or estimate related costs.
Why use it?
It makes hidden context usage visible, helping identify why an agent has less room for the current task or spends more tokens.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/jansenanalytics/claudex/budget
Any agent
npx skills add JansenAnalytics/claudex --skill budget
Clone the repo
git clone --depth 1 https://github.com/JansenAnalytics/claudex

Made for: Claude Code, Codex.

Per session 75 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 763 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00075 $0.00763
Opus 5 $0.00037 $0.00381
Sonnet 5 $0.00015 $0.00153
Haiku 4.5 $0.00007 $0.00076

Measured 3d ago against content hash e0df69438e3d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

budget scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/budget.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/budget/SKILL.md · 62 lines

How it starts

The opening of the file, as written. The whole thing — 62 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Budget

With ~162 skill descriptions auto-loaded every session, description sprawl is a plausible silent tax on the context window — and until now we had zero visibility into it. This skill estimates and ranks the static, auto-loaded pieces of context so bloat is visible and prunable.

Run it

python3 "$CLAUDE_SKILLS_DIR/budget/scripts/budget.py"            # ranked breakdown
python3 "$CLAUDE_SKILLS_DIR/budget/scripts/budget.py" --top 15   # show 15 heaviest skills
python3 "$CLAUDE_SKILLS_DIR/budget/scripts/budget.py" --json     # machine-readable
python3 "$CLAUDE_SKILLS_DIR/budget/scripts/budget.py" --cost     # + real spend (model-usage/codexbar)

If $CLAUDE_SKILLS_DIR is unset, it lives at ~/.claude-agent/.claude/skills/budget/.

What it measures

Component Source Exactness
CLAUDE.md + .claude/rules/*.md file contents exact size, est. tokens
MEMORY.md auto-memory index exact size, est. tokens
USER.md curated profile exact size, est. tokens
Skill descriptions (×162) skill-index.json EXACT ranking
system prompt rough constant approximate — harness-hidden
tool + MCP schemas rough constant approximate — harness-hidden

Reading the output

  • The skill-description ranking is the genuinely useful, exact part — we own skill-index.json, so the heaviest-N list is real and directly actionable.
  • The grand total is an estimate. The harness does not expose live context counts to the model, so the system-prompt and tool-schema rows are conservative constants. Treat the total as order-of-magnitude, not authoritative.
  • Tokenizer caveat: uses tiktoken o200k_base (a GPT tokenizer) when available — close to Claude's tokenizer but not identical (±10-20% on absolute counts). Ranking is unaffected. Falls back to a chars/4 heuristic if tiktoken isn't installed.

What to do with it

  • A heavy skill description → trim it, or feed it to the skill-curator (Tier 2 item 3) as a prune/consolidate candidate. Description weight is a property of the skill itself, so it's the right bloat lever (unlike time-unused, which only ever produces a report).
  • --cost shells out to model-usage / codexbar for real per-model spend if installed.

Read the full file on GitHub · 62 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 62 lines · 75 tokens per session scan A e0df69438e3d

Subscribe to this mod's changes

budget is a skill published in the GitHub repository JansenAnalytics/claudex (5 stars, last pushed 2mo ago), licensed MIT. It adds 75 tokens to every session and 763 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.