token-budget-check
Skill1 starsChanged 7 months agoMITView on GitHub
Pre-flight check a prompt, message, or instruction for token cost and waste before it is sent. Use when the user asks to check, estimate, pre-flight, size-up, or budget a prompt before sending. Returns an estimated token count, a waste breakdown, and a ranked list of cuts with a proposed lean rewrite.
In this repository11 other files it gives its agents.
- assumption-surfaceSkill
- description-craftSkill
- goal-criteriaSkill
- karpathy-codingSkill
- lean-responseSkill
- simplicity-auditSkill
- skill-compressSkill
- skill-graphSkill
- surgical-diffSkill
- token-auditSkill
- vixero-councilSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 26
If input is a SKILL.md (has YAML frontmatter), redirect to token-audit — do not duplicate work.
- Distinctive: line 68
Never strip concrete constraints (numbers, names, file paths, formats).
- Distinctive: line 69
If input < 100 tokens, skip analysis and say "already lean" — the audit itself would cost more than any savings.
- Distinctive: line 71
If the rewrite would change meaning, keep the original phrase and flag it instead.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
token-budget-check
Estimate cost. Flag waste. Propose the leanest version that keeps intent.
Trigger on
- "check this prompt before I send"
- "how many tokens will this use"
- "pre-flight this"
- "can you make this cheaper"
- User pastes a prompt explicitly asking for budget / size analysis
Scope boundary
| skill | scope |
| token-budget-check | prompts, messages, single instructions |
| token-audit | SKILL.md files (has frontmatter) |
| skill-compress | SKILL.md rewrites |
| lean-response | whole-session response behavior |
If input is a SKILL.md (has YAML frontmatter), redirect to token-audit — do not duplicate work.
Process
- Estimate tokens. English prose ≈ 4 chars/token, code ≈ 3 chars/token.
- Classify input: one-shot instruction / multi-step request / reference-heavy prompt / chat continuation.
- Find waste in three categories:
| category | flags |
| restatement | repeats context, re-explains what was just said |
| padding | "in order to", "at this point in time", "due to the fact that" |
| over-specification | lists edge cases the model handles by default |
- Rank cuts by absolute savings.
- Produce a lean rewrite.
Output
tokens: {n}
classification: {shape}
waste:
restatement: {n} tokens
padding: {n} tokens
over-spec: {n} tokens
total: {n} tokens ({pct}%)
top cuts:
1. "{phrase}" → "{short}" (−{n})
2. ...
lean rewrite:
"""
{rewritten prompt}
"""
before: {n} / after: {n} / saved: {n} ({pct}%)Hard rules
- Never strip concrete constraints (numbers, names, file paths, formats). Strip only waste.
- If input < 100 tokens, skip analysis and say "already lean" — the audit itself would cost more than any savings.
- Preserve tone markers the user chose deliberately (formal register, specific voice).
- If the rewrite would change meaning, keep the original phrase and flag it instead.
- Return the lean rewrite in a code block so the user can copy it cleanly.
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.

