context-budget

context-budget is a skill for Claude Code from felvieira/claude-skills-fv. It costs 174 tokens per session (1,863 once invoked), scanned B, original, Apache-2.0.

A context-budget auditing skill that estimates how much of an agent session is occupied by instructions, project files, tool descriptions, enabled skills, and conversation history.

In plain words
What is it for?
Use it to inspect context usage, identify expensive components, and decide what can be delayed or removed before enabling more tools or agents.
Why use it?
An overloaded context can increase latency and leave less room for the task itself.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions subagents.

Part of the dev-team-kit-fv plugin — 72 skills, 45 commands, 16 agents, 5 hooks shipped together

Good fit Use it to inspect context usage, identify expensive components, and decide what can be delayed or removed before enabling more tools or agents.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/felvieira/claude-skills-fv/49-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 felvieira/claude-skills-fv --skill 49-context-budget
Clone the repo
git clone --depth 1 https://github.com/felvieira/claude-skills-fv

Made for: Claude Code.

Or install dev-team-kit-fv, the plugin that ships this one along with the rest of its 72 skills, 45 commands, 16 agents, 5 hooks.

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/felvieira/claude-skills-fv/49-context-budget/github.svg)](https://agentmods.dev/skills/felvieira/claude-skills-fv/49-context-budget)
Your own site
<a href="https://agentmods.dev/skills/felvieira/claude-skills-fv/49-context-budget"><img src="https://agentmods.dev/badge/skills/felvieira/claude-skills-fv/49-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/felvieira/claude-skills-fv/49-context-budget"><img src="https://agentmods.dev/badge/skills/felvieira/claude-skills-fv/49-context-budget.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 174 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,863 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. 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.00174 $0.01863
Opus 5 $0.00087 $0.00932
Sonnet 5 $0.00035 $0.00373
Haiku 4.5 $0.00017 $0.00186

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

Security

Grade B, and why

context-budget scanned grade B with 1 finding 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 2d 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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

find .claude/rules/ -name "*.md" | xargs wc -c 2>/dev/null
skills/49-context-budget/SKILL.md · 173 lines

How it starts

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

Skill 49 — Context Budget

Objetivo

Auditar o peso de contexto carregado em uma sessão Claude Code: quais skills/agents/MCP/rules/CLAUDE.md estão contribuindo para o overhead de tokens, quanto custa cada componente, e o que pode ser cortado ou adiado sem perder funcionalidade.

Distinção crítica:

  • Skill 30 (cost-tracker) → rastreia tokens/$ gastos em runtime (completions, tool calls)
  • Skill 49 (context-budget) → audita tokens carregados no contexto antes de qualquer completion (system prompt, CLAUDE.md, rules, skills, MCP descriptions)

Quando usar

  • Sessão com latência alta ou model degradation (possível context overflow)
  • Repo novo com .bot/ — auditoria do que foi instalado
  • Antes de habilitar novo MCP server ou subagent
  • Após instalar rules system path-scoped — verificar overhead real
  • Quando /savings mostrar contexto inchado

Protocolo

Fase 0 — Identificar componentes carregados

Listar o que está no contexto da sessão:

1. CLAUDE.md (global + projeto)
2. .claude/rules/**/*.md (path-scoped — quais foram ativados?)
3. skills/ carregadas via Skill() nesta sessão
4. agents/ descrições (sempre presentes no system prompt)
5. MCP server descriptions (presentes para cada server ativo)
6. Arquivos abertos/lidos na sessão
7. Histórico de conversa acumulado

Fase 1 — Estimar peso por componente

Para cada componente, estimar tokens:

regra geral: ~4 chars por token (aproximação BPE)

- ler tamanho do arquivo em bytes
- tokens ≈ bytes / 4
- overhead real pode ser 10-20% maior (BPE não é linear)

Comando de varredura rápida:

# Peso dos arquivos de contexto fixo
find . -name "CLAUDE.md" -o -name "GLOBAL.md" | xargs wc -c 2>/dev/null

# Peso das rules ativas
find .claude/rules/ -name "*.md" | xargs wc -c 2>/dev/null

# Peso dos agents (sempre no system prompt)
find agents/ -name "*.md" | xargs wc -c 2>/dev/null

# Peso das skills (sob demanda — verificar quais foram invocadas)
find skills/ -name "SKILL.md" | xargs wc -c 2>/dev/null | tail -1

Read the full file on GitHub · 173 lines

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. 2d ago Changed · +3 lines e26e325fcf05
  2. 9d ago First seen · 170 lines · 174 tokens per session scan B 28955161fbe4

Subscribe to this mod's changes

context-budget is a skill published in the GitHub repository felvieira/claude-skills-fv (23 stars, last pushed yesterday), licensed Apache-2.0. It adds 174 tokens to every session and 1,863 once invoked, about $0.0009 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories