chimera-budget-the-context

chimera-budget-the-context is a skill for Claude Code, Codex from brcampidelli/chimera-agent. It costs 36 tokens per session (1,390 once invoked), scanned A, original, Apache-2.0.

A skill for managing context in agents that repeatedly append messages and tool definitions to a conversation. Context is the information sent to the model; a budget limits how much of the available window is used.

In plain words
What is it for?
Use it when building or debugging ReAct agents, tool-calling loops, or other workflows whose message history continually grows.
Why use it?
It helps prevent long-running loops from exceeding the model's context limit or losing track of the task. It also accounts for tool definitions that are resent at every step.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when building or debugging ReAct agents, tool-calling loops, or other workflows whose message history continually grows.

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

Made for: Claude Code, Codex.

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 chimera-budget-the-context

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/brcampidelli/chimera-agent/chimera-budget-the-context"><img src="https://agentmods.dev/badge/skills/brcampidelli/chimera-agent/chimera-budget-the-context.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 36 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,390 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.00036 $0.01390
Opus 5 $0.00018 $0.00695
Sonnet 5 $0.00007 $0.00278
Haiku 4.5 $0.00004 $0.00139

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

Security

Grade A, and why

chimera-budget-the-context 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.

skills/chimera-budget-the-context/SKILL.md · 113 lines

How it starts

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

Trigger

You are running a loop that appends to a message list every step — a ReAct agent, a coding turn, a tool-calling assistant — and the list only ever grows. Symptoms: the provider raises on context length, or the run survives but starts working on the wrong file after a long stretch.

It does not apply to a single-shot call whose prompt you assembled yourself and can measure once. There is no eviction policy to design when nothing accumulates.

Do

  1. Write down two numbers before touching the loop: the model's advertised window, and the fraction of it you will spend on the prompt. Chimera spends 0.6 (DEFAULT_BUDGET_FRACTION in chimera/core/context_budget.py). The rest pays for the completion and for the gap between your token estimate and the provider's real count.
  2. Fire compaction on a share of the budget, not of the window — Chimera triggers at 0.8 of the budget. Compaction needs room to compact into; a trigger set at the window fires when there is none left.
  3. Measure the fixed floor separately from the growing part. The system message plus the tools= payload are re-sent on every step and no amount of message compaction touches them. Run chimera schema-bench (or count the JSON yourself) before you assume the history is what is expensive. A verbose MCP or OpenAPI import can put tens of thousands of tokens under every single step of the run.
  4. If the floor is a problem, shrink the floor: strip annotation-only schema keys (examples, title, default, $comment) and trim parameter prose to the first sentence, keeping type, properties, required and enum intact so tool selection and argument validity are unchanged. That is what chimera/tools/schema_compact.py does. Advertise fewer tools if it is still too big.
  5. Fix the eviction order explicitly: system message never, recent turns verbatim (Chimera keeps 6), the older span replaced by a summary or a factual note. Never rewrite the system message — it is the stable prefix the prompt cache is keyed on, and editing it invalidates every cached turn behind it.
  6. After compacting, re-inject what the run needs to still be itself: the task verbatim, the plan, the task list with status, and the file currently being edited. Re-read the file from disk rather than restoring a remembered copy.
  7. When you estimate token size yourself, count the tool_calls payload as well as content. Tool arguments ride on the assistant message and are not in content; a size estimate that reads only content under-reports exactly the messages that grew.

Read the full file on GitHub · 113 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. 11d ago First seen · 113 lines · 36 tokens per session scan A 63f202117c1f

Subscribe to this mod's changes

chimera-budget-the-context is a skill published in the GitHub repository brcampidelli/chimera-agent (23 stars, last pushed today), licensed Apache-2.0. It adds 36 tokens to every session and 1,390 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.