agentleFS
Vix0007Vix0007/vixero-skills/skills/token-budget-check/SKILL.md

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.

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
  1. Very specific:

    If input is a SKILL.md (has YAML frontmatter), redirect to token-audit — do not duplicate work.

    line 26
  2. Distinctive:

    Never strip concrete constraints (numbers, names, file paths, formats).

    line 68
  3. Distinctive:

    If input < 100 tokens, skip analysis and say "already lean" — the audit itself would cost more than any savings.

    line 69
  4. Distinctive:

    If the rewrite would change meaning, keep the original phrase and flag it instead.

    line 71

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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

skillscope
token-budget-checkprompts, messages, single instructions
token-auditSKILL.md files (has frontmatter)
skill-compressSKILL.md rewrites
lean-responsewhole-session response behavior

If input is a SKILL.md (has YAML frontmatter), redirect to token-audit — do not duplicate work.

Process

  1. Estimate tokens. English prose ≈ 4 chars/token, code ≈ 3 chars/token.
  2. Classify input: one-shot instruction / multi-step request / reference-heavy prompt / chat continuation.
  3. Find waste in three categories:
categoryflags
restatementrepeats context, re-explains what was just said
padding"in order to", "at this point in time", "due to the fact that"
over-specificationlists edge cases the model handles by default
  1. Rank cuts by absolute savings.
  2. 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.