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.
npx skills add bonigarcia/context-engineering --skill token-budget-auditorgit clone --depth 1 https://github.com/bonigarcia/context-engineeringWrote 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.
[](https://agentmods.dev/skills/bonigarcia/context-engineering/token-budget-auditor)<a href="https://agentmods.dev/skills/bonigarcia/context-engineering/token-budget-auditor"><img src="https://agentmods.dev/badge/skills/bonigarcia/context-engineering/token-budget-auditor/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.
<a href="https://agentmods.dev/skills/bonigarcia/context-engineering/token-budget-auditor"><img src="https://agentmods.dev/badge/skills/bonigarcia/context-engineering/token-budget-auditor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00105 | $0.00799 |
| Opus 5.5 | $0.00042 | $0.00320 |
| Sonnet 5.5 | $0.00021 | $0.00160 |
| Haiku 4.5 | $0.00011 | $0.00080 |
Grade A, and why
token-budget-auditor 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.
How it starts
The opening of the file, as written. The whole thing — 59 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Token budget auditor
Measure what fills this agent's context, compare it with the token budget, and tell the user what to remove, compress, or move out of the main context.
Procedure
- Map each input file or block to a context source:
instructions(system prompt, instruction artifacts, loaded skills),tools(tool definitions),knowledge(retrieved or stuffed documents),memory(conversation history, stored memories, state), orinput(the current user message). - Find the token budget: use the number the user gives. Otherwise ask for it, or use 25% of the model's context window and state that assumption.
- From the user's project root, run
python3 <this skill's directory>/scripts/count_tokens.py --budget <N> <source>=<path> ..., with one argument per file or folder and paths relative to the project root. Copy its JSON output into thetokensfield. If Python is not available, estimate characters divided by four per source and say so in the summary. - Read
references/checklist.mdand look for the patterns it lists, starting with the largest source. - Write the report described below, with a
## Token budgetsection after the summary: a table with one row per source and the columns Source, Files, Tokens, and Share of total, followed by the total and the budget.
Report format
Write the report in Markdown, in this order:
## Summary: two to four sentences on the overall state and the most important change.## Findings: one bullet per finding, most severe first, in the form- [severity] location: problem. Fix: suggested fix. (book section). Severity ishighwhen the problem causes wrong or unsafe behavior,mediumwhen it makes results unreliable or costly, andlowfor clarity or maintenance issues. If there are no problems, writeNo findings.- Any skill-specific section named in the procedure.
- A final fenced
jsonblock with the same content, as in this example.
{
"skill": "token-budget-auditor",
"summary": "...",
"tokens": {
"method": "estimate:chars/4",
"budget": 8000,
"sources": [],
"total": 0,
"over_budget": false
},
"findings": [
{
"severity": "high",
"location": "retrieved.md",
"problem": "...",
"fix": "...",
"book_section": "Chapter 7, Context selection"
}
]
}
What ships with it
9 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- examples/budget.txt 5 B
- examples/context/history.md 7.9 KB
- examples/context/retrieved.md 1.8 KB
- examples/context/system-prompt.md 11 KB
- examples/context/tools.json 8.6 KB
- examples/expected-findings.md 900 B
- references/checklist.md 2.2 KB
- scripts/count_tokens.py 2.6 KB runs code
- scripts/test_count_tokens.py 2.9 KB runs code
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.
- 11d ago First seen · 59 lines · 105 tokens per session scan A d7ce720a2cd7
token-budget-auditor is a skill published in the GitHub repository bonigarcia/context-engineering (196 stars, last pushed 2d ago), licensed Apache-2.0. It adds 105 tokens to every session and 799 once invoked, about $0.0004 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-11-19.
token-budget-auditor compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| token-budget-auditorbonigarcia/context-engineering | Skill | 196 | 2d ago | Apache-2.0 | A | 105 | Claude Code |
| memmachine-memoryMemMachine/MemMachine | Skill | 3.1k | 3d ago | Apache-2.0 | A | 96 | Codex |
| persistxg-gh-25/SwarmAI | Skill | 66 | yesterday | MIT | A | 63 | Claude Code, Codex |
| ddd-persistxg-gh-25/SwarmAI | Skill | 66 | yesterday | MIT | A | 59 | Claude Code, Codex |
| libraryxg-gh-25/SwarmAI | Skill | 66 | yesterday | MIT | A | 68 | Claude Code, Codex |
| memory-distillxg-gh-25/SwarmAI | Skill | 66 | yesterday | MIT | A | 54 | Claude Code, Codex |
| context-hygienexg-gh-25/SwarmAI | Skill | 66 | yesterday | MIT | A | 64 | Claude Code, Codex |