context-budget

Estimate per-turn token costs from .claude/ configuration and CLAUDE.md.

1|Updated May 27, 2026
One-click install
npx skills add https://github.com/findexu/finpack-claude --skill context-budget-findexu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: context-budget
Source: https://github.com/findexu/finpack-claude/tree/main/plugins/setup-finpack/template/skills/context-budget
Command: npx skills add https://github.com/findexu/finpack-claude --skill context-budget-findexu

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Context-budget helps you estimate the per-turn token usage caused by your project’s .claude/ configuration and CLAUDE.md, so you can avoid silent prompt bloat and understand what will load every turn versus only when invoked.

Core Features & Use Cases

  • Always-loaded vs scoped vs invoked-only breakdown: Identifies which rules, skills, and agents contribute to every-turn context versus those that only load when paths match or when commands are triggered.
  • Token estimation with two methods: Uses a chars/4 heuristic by default, or supports exact token counting via Anthropic’s count_tokens endpoint when --api is provided and an API key is available.
  • Budget verdict and trimming guidance: Aggregates totals, ranks the top always-loaded contributors, flags overruns, and recommends the highest-leverage trim target.

Quick Start

Run the context-budget skill to generate a token-cost report for your current project’s .claude configuration and CLAUDE.md.

Frequently Asked Questions about context-budget

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I estimate per-turn token cost from Claude Code configuration files?

Estimate per-turn token cost from Claude Code configuration by classifying always-loaded, path-scoped, and invoked-only components in your .claude/ directory and CLAUDE.md, then aggregating their token counts to reveal prompt bloat.

What is the difference between always-loaded and invoked-only context in CLAUDE.md?

Always-loaded context in CLAUDE.md contributes tokens every turn, while invoked-only context loads solely when commands are triggered. Classifying these components isolates silent prompt bloat from rules loading unnecessarily.

How do I get exact token counts instead of heuristic estimates for prompt budgeting?

Get exact token counts for prompt budgeting by running the skill with the --api flag and providing an ANTHROPIC_API_KEY, which utilizes Anthropic's count_tokens endpoint instead of the default chars/4 heuristic estimation.

Why does my Claude Code context window fill up so quickly during workflows?

Your Claude Code context window fills quickly when always-loaded rules and skills contribute more tokens than intended. Auditing your .claude/ configuration identifies top contributors and recommends high-leverage trim targets.

Can I audit which rules and skills are consuming the most token budget?

You can audit which rules and skills consume the most token budget by generating a report that ranks top always-loaded contributors, flags context window overruns, and provides trimming guidance for your configuration.

Does context budgeting work without an Anthropic API key?

Context budgeting works without an Anthropic API key by default, applying a heuristic chars/4 estimation method to calculate token usage for your .claude configuration and CLAUDE.md files.