ccc-context-budget

ccc-context-budget is a command for Claude Code from KevinZai/commander. It costs 39 tokens per session (564 once invoked), scanned A, original, MIT.

A report that estimates how much of an AI session's context window is being used and identifies the main sources of that usage. The context window is the amount of conversation and project information the model can consider at once.

In plain words
What is it for?
Use it to inspect context usage, see a visual status zone, find bloated areas, and get recommendations for saving or compacting the session.
Why use it?
It warns when a session is becoming too full, helping you save important state before shortening or restarting it.

Command for Claude Code

Written for Claude Code: $ARGUMENTS substitution. Also seen: mentions CLAUDE.md; names the AskUserQuestion tool; mentions Codex.

Good fit Use it to inspect context usage, see a visual status zone, find bloated areas, and get recommendations for saving or compacting the session.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/kevinzai/commander/ccc-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.

Clone the repo
git clone --depth 1 https://github.com/KevinZai/commander

Made for: Claude Code.

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 ccc-context-budget

README.md
[![agentmods](https://agentmods.dev/badge/commands/kevinzai/commander/ccc-context-budget/github.svg)](https://agentmods.dev/commands/kevinzai/commander/ccc-context-budget)
Your own site
<a href="https://agentmods.dev/commands/kevinzai/commander/ccc-context-budget"><img src="https://agentmods.dev/badge/commands/kevinzai/commander/ccc-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 ccc-context-budget

Your own site · 80×15
<a href="https://agentmods.dev/commands/kevinzai/commander/ccc-context-budget"><img src="https://agentmods.dev/badge/commands/kevinzai/commander/ccc-context-budget.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 39 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 564 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.00039 $0.00564
Opus 5.5 $0.00016 $0.00226
Sonnet 5.5 $0.00008 $0.00113
Haiku 4.5 $0.00004 $0.00056

Measured 5d ago against content hash 96e990c90b70, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

ccc-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 5d 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.

commands/ccc-context-budget.md · 49 lines

How it starts

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

/ccc-context-budget — gauge context, cut bloat

CC Commander · /ccc-context-budget · a usage gauge, the biggest consumers and the next action.

Usage

/ccc-context-budget              # gauge plus top recommendations
/ccc-context-budget --verbose    # full per-component breakdown

Arguments: $ARGUMENTS

What happens

  1. Load the context-budget skill (repo source: skills/context-budget/SKILL.md) and follow its five phases in order: Inventory, Classify, Visual Report, Recommendations, Quick Actions. If the skill is not installed, do the same phases inline: estimate tokens for the system prompt, loaded instructions (CLAUDE.md, rules), invoked skills, tool definitions, file reads and conversation turns.
  2. Pass --verbose through when it appears in $ARGUMENTS.
  3. Use the window size of the session's model. Current Claude models have a 1M-token window; use a smaller size only when the user names one or the session reports one.
  4. Show the gauge and the zone from the table below. Label every figure as an estimate.
  5. End with the skill's Quick Actions block.

Zones

Usage Zone Action
0–50% 🟢 Green Continue normally
50–70% 🟡 Yellow Monitor; plan a compact soon
70–80% Orange Run /ccc-save-session, then /compact or start fresh
80–90% 🔴 Red Run /ccc-save-session now
90%+ ⚠️ Danger Stop new work; save the session and start a new one

In Orange or above, ask with AskUserQuestion (Codex: a plain-text question):

  • 🟢 Save the session now — runs /ccc-save-session so nothing is lost
  • Compact in place — runs /compact; older detail is summarized
  • Keep going — accept the risk of automatic compaction

Done when

The report shows the gauge, the zone, the top consumers and the Quick Actions block. If the user chose to save, the saved handoff file path is reported.

See also

/ccc-save-session (save state for resumption) · /ccc-resume-session (load it in a fresh context) · /compact (built-in history compression)

Read the full file on GitHub · 49 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. 5d ago Changed · +6 lines · +16 tokens per session 96e990c90b70
  2. 1mo ago First seen · 43 lines · 23 tokens per session scan A 297b6173216b

Subscribe to this mod's changes

ccc-context-budget is a command published in the GitHub repository KevinZai/commander (6 stars, last pushed today), licensed MIT. It adds 39 tokens to every session and 564 once invoked, about $0.0002 per session on Opus 5.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-09-03.