agentleFS
HighwayofLifeHighwayofLife/agent-kaizen/skills/tools-before-tokens/SKILL.md

tools-before-tokens

Skill1 starsChanged 33 days agoMITView on GitHub

Make every agent use deterministic CLI tools (rg, fd, ast-grep, jq, yq, scripts) before spending model tokens.

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 5 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

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

    Not in Claude Code?: Read docs/hosts.md in the plugin root first.

    line 11
  2. Distinctive:

    Check what is installed: rg, fd, ast-grep, jq, yq, shellcheck, a formatter for my languages, and media tools if this project has assets …

    line 23
  3. Distinctive:

    Add a compact "tools before tokens" rule to the core instructions (CLAUDE.md and AGENTS.md), about 6 lines:

    line 27
  4. Distinctive:

    Do bulk or mechanical edits with ast-grep, sed or a script, then review the diff.

    line 31
  5. Distinctive:

    When a manual step recurs, write a script for it.

    line 34
  6. Very specific:

    Use the usage audit (docs/kaizen/) and recent transcripts to find the 5 steps agents most often do by hand: reading test results, …

    line 35
  7. Distinctive:

    If agents fetch the same web pages again and again (research, docs), propose a cached fetch script: it stores each page once as plain text, …

    line 39

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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

Tools before tokens

Plugin root: ${CLAUDE_PLUGIN_ROOT}. If that is still a ${...} placeholder, use the folder that contains skills/ (this file is skills/<name>/SKILL.md), and substitute that path, in quotes, wherever this skill uses CLAUDE_PLUGIN_ROOT. Not in Claude Code? Read docs/hosts.md in the plugin root first. Skip steps that only work in Claude Code, and follow its propose-only rule before changing any host configuration.

Anything a deterministic tool can do (search, count, parse, transform, measure) is done by the tool, not by a model reading and reasoning.

Changes: installs CLI tools, adds instruction rules and small scripts, after you approve.

Autonomy: follow ${CLAUDE_PLUGIN_ROOT}/docs/autonomy.md. The mode comes from the skill argument (propose, safe, auto or yolo), else docs/kaizen/config.json, else agent-kaizen.json in your Claude config dir ($CLAUDE_CONFIG_DIR or ~/.claude), else propose. In safe and auto, read every "wait for my OK" below as: apply it yourself if the mode allows (backup, verify, roll back on failure, ledger row), otherwise list it as a proposal. Hard stops always ask. At most maxChangesPerRun changes (default 3). End with a summary of what was applied, skipped and rolled back.

Task

Make every agent (Claude and Codex) use deterministic tools before spending model tokens.

  1. Check what is installed: rg, fd, ast-grep, jq, yq, shellcheck, a formatter for my languages, and media tools if this project has assets (ffprobe/ffmpeg, ImageMagick, gltf-transform). Propose install commands for the missing ones. Don't install anything without my OK.
  2. Add a compact "tools before tokens" rule to the core instructions (CLAUDE.md and AGENTS.md), about 6 lines:
    • Find code with rg, fd, ast-grep or a code map, then read only the line ranges that matter.
    • Parse JSON and YAML with jq or yq. Count with wc, sort | uniq -c, or awk.
    • Do bulk or mechanical edits with ast-grep, sed or a script, then review the diff.
    • Send long logs and command output to a file; read them with tail or rg, never whole.
    • Measure media with tools; models judge only what tools can't.
    • When a manual step recurs, write a script for it.
  3. Use the usage audit (docs/kaizen/) and recent transcripts to find the 5 steps agents most often do by hand: reading test results, summarising logs, finding a setting's value, checking asset budgets, and so on. For each, propose a small script under tools/ with a one-line usage, and list it in the instructions.
  4. If agents fetch the same web pages again and again (research, docs), propose a cached fetch script: it stores each page once as plain text, and later searches grep the cached copy instead of refetching.

Show the plan, wait for my OK, then build the scripts with tests. Add ledger rows.

Done when

fewer large reads in the next audit, and tool output in place of long agent summaries.

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.