context-budget

context-budget is a skill for Claude Code from claude-hangar/claude-hangar. It costs 27 tokens per session (588 once invoked), scanned A, original, MIT.

A context-window audit that shows where a coding session's available text space, measured in tokens, is being used. It examines instructions, conversation history, tool definitions, and loaded project resources.

In plain words
What is it for?
Use it for a full or quick analysis of prompt size, conversation messages, tool overhead, project instructions, and possible reductions such as removing unused tools or shortening instructions.
Why use it?
It helps explain why a session feels slow or runs out of context, and points to sources of unnecessary text.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions subagents.

Part of the claude-hangar plugin — 35 skills, 22 agents shipped together

Good fit Use it for a full or quick analysis of prompt size, conversation messages, tool overhead, project instructions, and possible reductions such as removing unused tools or shortening instructions.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/claude-hangar/claude-hangar/context-budget
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.

Any agent
npx skills add claude-hangar/claude-hangar --skill context-budget
Clone the repo
git clone --depth 1 https://github.com/claude-hangar/claude-hangar

Made for: Claude Code.

Or install claude-hangar, the plugin that ships this one along with the rest of its 35 skills, 22 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for context-budget

README.md
[![agentmods](https://agentmods.dev/badge/skills/claude-hangar/claude-hangar/context-budget/github.svg)](https://agentmods.dev/skills/claude-hangar/claude-hangar/context-budget)
Your own site
<a href="https://agentmods.dev/skills/claude-hangar/claude-hangar/context-budget"><img src="https://agentmods.dev/badge/skills/claude-hangar/claude-hangar/context-budget/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for context-budget

Your own site · 80×15
<a href="https://agentmods.dev/skills/claude-hangar/claude-hangar/context-budget"><img src="https://agentmods.dev/badge/skills/claude-hangar/claude-hangar/context-budget.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 27 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 588 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00027 $0.00588
Opus 5 $0.00014 $0.00294
Sonnet 5 $0.00005 $0.00118
Haiku 4.5 $0.00003 $0.00059

Measured 11d ago against content hash dd5d4d0553d7, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

context-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 11d ago.

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.

core/skills/context-budget/SKILL.md · 78 lines

How it starts

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

/context-budget — Token Spending Analysis

Audits your current context window to show where tokens are being consumed and identifies opportunities to reduce waste.

Usage

/context-budget            # Full analysis
/context-budget quick      # Summary only

What It Analyzes

1. System Prompt Weight

Estimate token cost of loaded context:

  • CLAUDE.md content (project instructions)
  • Active skills loaded into context
  • MCP server tool schemas (each server adds 200-800 tokens)
  • Rules loaded from ~/.claude/rules/

2. Conversation History

  • Total messages in current conversation
  • Average tokens per message
  • Large tool results consuming disproportionate context

3. Tool Schema Overhead

  • Count of available tools and their schema weight
  • MCP servers contributing the most overhead
  • Unused tools that could be removed

4. Optimization Opportunities

Opportunity Typical Savings How
Compact after planning 30-50% /compact removes exploration clutter
Remove unused MCP servers 200-800 tokens each Uninstall servers you're not using
Trim CLAUDE.md 500-2000 tokens Remove outdated instructions
Use subagents for research 60-80% of results Agent tool isolates large outputs
Avoid re-reading large files 1000+ tokens each Read once, reference by line numbers

Output Format

## Context Budget Analysis

### Current Allocation (estimated)
| Component | Tokens | % |
|-----------|--------|---|
| System prompt | ~4,000 | 2% |
| CLAUDE.md | ~2,500 | 1.3% |
| MCP schemas (5 servers) | ~3,000 | 1.5% |
| Conversation history | ~45,000 | 22.5% |
| Available budget | ~145,500 | 72.7% |

### Top Optimizations
1. Consider /compact — conversation history is 22.5% of context
2. MCP server "sequential-thinking" adds ~800 tokens but hasn't been used this session
3. 3 large file reads (>500 lines each) in history could be replaced with targeted reads

When to Use

  • When you notice Claude Code getting slower or less accurate
  • Before starting a large implementation task
  • After a long research/exploration phase
  • When token-warning hook fires (70%+ usage)

Read the full file on GitHub · 78 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. 11d ago First seen · 78 lines · 27 tokens per session scan A dd5d4d0553d7

Subscribe to this mod's changes

context-budget is a skill published in the GitHub repository claude-hangar/claude-hangar (1 stars, last pushed 2mo ago), licensed MIT. It adds 27 tokens to every session and 588 once invoked, about $0.0001 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.