cco-budget

cco-budget is a skill for Claude Code from egorfedorov/claude-context-optimizer. It costs 43 tokens per session (973 once invoked), scanned A, original, MIT.

A skill for setting and checking a Claude Code session’s token budget. Tokens are the small pieces of text used to measure model input and output.

In plain words
What is it for?
It is for viewing budget status, setting token limits, configuring warning and auto-compaction thresholds, and choosing a model for cost estimates.
Why use it?
It helps prevent a session from using more context than intended and shows when automatic compaction should occur.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: reads .claude/ paths; positional $N argument; mentions Claude Code.

Part of the claude-context-optimizer plugin — 22 skills, 1 agent, 6 hooks shipped together

Good fit It is for viewing budget status, setting token limits, configuring warning and auto-compaction thresholds, and choosing a model for cost estimates.

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

Made for: Claude Code.

Or install claude-context-optimizer, the plugin that ships this one along with the rest of its 22 skills, 1 agent, 6 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 cco-budget

README.md
[![agentmods](https://agentmods.dev/badge/skills/egorfedorov/claude-context-optimizer/cco-budget/github.svg)](https://agentmods.dev/skills/egorfedorov/claude-context-optimizer/cco-budget)
Your own site
<a href="https://agentmods.dev/skills/egorfedorov/claude-context-optimizer/cco-budget"><img src="https://agentmods.dev/badge/skills/egorfedorov/claude-context-optimizer/cco-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 cco-budget

Your own site · 80×15
<a href="https://agentmods.dev/skills/egorfedorov/claude-context-optimizer/cco-budget"><img src="https://agentmods.dev/badge/skills/egorfedorov/claude-context-optimizer/cco-budget.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 43 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 973 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00043 $0.00973
Opus 5 $0.00022 $0.00487
Sonnet 5 $0.00009 $0.00195
Haiku 4.5 $0.00004 $0.00097

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

Security

Grade A, and why

cco-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.

skills/cco-budget/SKILL.md · 83 lines

How it starts

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

Context Budget Manager

Manage the token budget for Claude Code sessions. Model-aware — picks the right effective context window and prices per model. The session's REAL model is read from the transcript by the budget hook; config.model is only the fallback. Everything from Sonnet 4.6 up is 1M; Haiku 4.5 is 200K.

Parse $ARGUMENTS:

status (or no arguments)

Show current budget config + auto-compact settings:

cat ~/.claude-context-optimizer/config.json 2>/dev/null
echo "---"
cat ~/.claude-context-optimizer/budget-config.json 2>/dev/null

If no config exists, show defaults (200K working budget on a 1M window, opus-5 fallback model, warn at 50/70/85/95%).

set <tokens>

Update the budget limit. Parse the token count (200K, 1M, 500000 all OK). Update ~/.claude-context-optimizer/config.json:

{
  "budgetTokens": <parsed_number>,
  "warnAt": [50, 70, 85, 95],
  "autoCompactAt": 90,
  "model": "opus-5"
}

If budgetTokens exceeds the chosen model's context window, warn the user.

model <name>

Set the FALLBACK model for cost estimation (used only when a session's transcript has no model id yet). Supported keys:

  • haiku-4.5 (alias haiku) — $1/$5 per M, 200K
  • sonnet-4.6 (alias sonnet) — $3/$15 per M, 1M
  • sonnet-5 — $2/$10 per M, 1M
  • opus-4.7 / opus-4.8 — $5/$25 per M, 1M
  • opus-5 (alias opus, default) — $5/$25 per M, 1M
  • fable-5 — $10/$50 per M, 1M
  • fable-5.1 (alias fable) — $10/$50 per M, 1M, cache reads at 0.025× (vs 0.1× elsewhere)

opus-4.8-1m / opus-4.7-1m / opus-extended are back-compat aliases only — there is no 1M surcharge; the 1M window is standard at $5/$25.

Update the model field in config.json. When switching to a 1M-context model and the current budgetTokens is below 500K, ask if the user wants to bump it to 1M.

auto <on|off>

Toggle auto-compact at thresholds (80% / 90%). Update ~/.claude-context-optimizer/budget-config.json:

  • auto onautoCompactEnabled: true
  • auto offautoCompactEnabled: false

Read the full file on GitHub · 83 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 · +5 lines · +4 tokens per session 99956902d2bf
  2. 10d ago First seen · 78 lines · 39 tokens per session scan A 5b082e00de14

Subscribe to this mod's changes

cco-budget is a skill published in the GitHub repository egorfedorov/claude-context-optimizer (107 stars, last pushed 7d ago), licensed MIT. It adds 43 tokens to every session and 973 once invoked, about $0.0002 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-30.