token-budget
Skill1 starsChanged 5 months agoMITView on GitHub
Reduce token usage from large coding-agent context while preserving completion-critical evidence and full recoverability. Use when tool output, logs, diffs, test failures, search results, transcripts, or accumulated session context are large or repetitive; when context limits approach; or when the user asks to reduce tokens, compact context, lower agent cost, or preserve progress across compaction.
4 other projects use a version of this.
Adopted by
Most recently taken up by
- debasish-tech/agent-skillstheir own version, first seen Oct 15, 2026
- qyndex/claude-inittheir own version, first seen Oct 13, 2026
- toonight/get-shit-done-for-antigravitytheir own version, first seen Oct 8, 2026
- Lucioway/way-stacktheir own version, first seen Aug 31, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- toonight/get-shit-done-for-antigravity★ 952same name
- qyndex/claude-init★ 2same name
- debasish-tech/agent-skills★ 0same name
- Lucioway/way-stack★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
Show its rules and text
We split this skill into the rules it gives an agent
17 rules. 0 are common, 15 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
15
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Never compact the user's current request, acceptance criteria, active constraints, unresolved errors, or uncommitted-change warnings.
- Distinctive: line 13
Keep exact commands, file paths, line references, failing test names, error messages, decisions, and latest task state.
- Very specific: line 15
Prefer targeted reads (rg, line ranges, structured queries) over reading entire files.
- Distinctive: line 16
Prefer summaries of successful output.
- Distinctive: line 18
Do not reduce verification, skip tests, shorten required code, or stop early to save tokens.
- Distinctive: line 22
Run the bundled CLI from the project root:
- Distinctive: line 33
If a command is known or expected to be noisy, compact its first run rather than consuming the raw output and compacting only later.
- Very specific: line 40
Use --max-chars 8000 for routine output and increase it when critical evidence does not fit.
- Distinctive: line 44
Search first, then open only relevant ranges.
- Distinctive: line 45
Run independent reads in parallel.
- Distinctive: line 46
Do not re-read unchanged files or repeat successful commands.
- Distinctive: line 47
Keep one short task ledger: objective, constraints, changed files, unresolved failures, next action.
- Distinctive: line 48
After each milestone, replace stale exploration details with verified findings.
- Distinctive: line 49
Keep user updates short; spend tokens on implementation and verification.
- Distinctive: line 53
Use the capsule's source hash:
- Distinctive: line 68
no requirement disappeared during compaction.
- Distinctive: line 70
Read references/policy.md only when changing preservation rules or evaluating quality.
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Token Budget
Minimize context, not evidence.
Rules
- Never compact the user's current request, acceptance criteria, active constraints, unresolved errors, or uncommitted-change warnings.
- Keep exact commands, file paths, line references, failing test names, error messages, decisions, and latest task state.
- Archive the full source before omitting content. Treat a capsule without a retrievable archive as lossy.
- Prefer targeted reads (
rg, line ranges, structured queries) over reading entire files. - Prefer summaries of successful output; preserve failure output verbatim.
- Retrieve archived lines before acting when a capsule says evidence was omitted and the missing detail could affect correctness.
- Do not reduce verification, skip tests, shorten required code, or stop early to save tokens.
Compact large material
Run the bundled CLI from the project root:
TOKENOP_SCRIPT="${CLAUDE_SKILL_DIR:-$HOME/.agents/skills/token-budget}/scripts/tokenop.py"
test -f "$TOKENOP_SCRIPT" || TOKENOP_SCRIPT="$HOME/.codex/skills/token-budget/scripts/tokenop.py"
python3 "$TOKENOP_SCRIPT" compact PATHClaude Code sets ${CLAUDE_SKILL_DIR}. Skills CLI installs the shared Codex
copy under ~/.agents/skills; the fallback supports direct legacy installs.
If a command is known or expected to be noisy, compact its first run rather than consuming the raw output and compacting only later. For stdin:
COMMAND 2>&1 | python3 "$TOKENOP_SCRIPT" compact -Use --max-chars 8000 for routine output and increase it when critical evidence does not fit. Read the emitted capsule instead of the original bulk output.
Work token-efficiently
- Search first, then open only relevant ranges.
- Run independent reads in parallel.
- Do not re-read unchanged files or repeat successful commands.
- Keep one short task ledger: objective, constraints, changed files, unresolved failures, next action.
- After each milestone, replace stale exploration details with verified findings.
- Keep user updates short; spend tokens on implementation and verification.
Recover omitted evidence
Use the capsule's source hash:
python3 PATH_TO_SKILL/scripts/tokenop.py retrieve SHA256 --lines START-ENDRetrieve the full source by omitting --lines.
Before finishing
Confirm:
- requested behavior is implemented;
- relevant tests actually ran;
- failures and limitations are stated;
- no requirement disappeared during compaction.
Read references/policy.md only when changing preservation rules or evaluating quality.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

