agentleFS
The-Artificer-of-Ciphers-LLCThe-Artificer-of-Ciphers-LLC/skills-from-the-artificer/cost-tier-routing/SKILL.md

cost-tier-routing

Skill6 starsChanged 34 days agoMITView on GitHub

Use BEFORE doing direct file search, bulk reads, data import/export, or routine coding edits in the main conversation. Routes work to the cheapest model that can do it correctly — haiku for search/IO, sonnet for coding, opus for orchestration/architecture. Triggers when about to call Read on >2 files, Grep/Glob across the repo, batch CSV/JSON transforms, or any "where is X / list all Y / count Z" question. Also triggers when the orchestrator (you, on opus) is about to write straightforward code that a sonnet subagent could handle.

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 6 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    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. Distinctive:

    Before any of these actions in the main (opus) context, dispatch to a subagent instead:

    line 14
  2. Distinctive:

    Keep on opus (the orchestrator):

    line 28
  3. Distinctive:

    When you (opus) recognize a routable task:

    line 38
  4. Distinctive:

    Read the report, don't redo the work: If the subagent missed something, dispatch again with a sharpened brief — don't bail out and do it …

    line 42
  5. Very specific:

    Parallel where independent: If you need three unrelated searches, fire three haiku-scout calls in one message.

    line 43
  6. Distinctive:

    When the user explicitly asked you to do it directly.

    line 50
  7. Distinctive:

    Before every tool call in the main context, ask: *Could a cheaper model do this exact action with the same correctness?* If yes, dispatch.

    line 67

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

Cost-Tier Routing

Opus tokens cost ~5x sonnet and ~25x haiku. Doing Read and Grep on opus is lighting money on fire. This skill is the discipline for routing every action to the cheapest model that can do it correctly.

This skill requires three companion agents — haiku-scout, haiku-importer, and sonnet-coder — installed in ~/.claude/agents/. See this package's README.md for the two-step install. The skill is inert without the agents because the model: pin lives in the agent files, not here.

The rule

Before any of these actions in the main (opus) context, dispatch to a subagent instead:

ActionRoute toWhy
Read more than 1–2 files in a rowhaiku-scoutBulk reads burn opus context
Grep / Glob across the repohaiku-scoutMechanical lookup
"Where is X defined?" / "What references Y?"haiku-scoutPure search
Count LOC, list files, read a confighaiku-scoutTrivial IO
Convert/parse/split/merge data fileshaiku-importerMechanical transform
Download + parse a fixture or seed filehaiku-importerMechanical IO
Write code at a known location with a known designsonnet-coderImplementation, not design
Refactor a function with clear constraintssonnet-coderBounded edit
Run tests / typecheck after an editsonnet-coder (bundle with the edit)Don't bounce back to opus mid-task

Keep on opus (the orchestrator):

  • Architectural decisions, tradeoff analysis
  • Reading subagent reports and deciding the next step
  • Synthesis across multiple subagent outputs
  • User-facing explanations and recommendations

Tool split (CodeGraph first, Memtrace for heavy hits). Use CodeGraph (codegraph_explore / codegraph CLI) for symbol lookup, file reads, callers/callees, and ordinary blast radius. Reserve Memtrace (and cortex) for git history/evolution, recall_decision, cross-repo/API topology, risky blast radius (get_impact), PR review evidence, and dead code/complexity, because Memtrace costs quota. If ~/.claude/state/memtrace-quota.json says blocked with a future until, never call Memtrace; use CodeGraph until that time.

The dispatch pattern

When you (opus) recognize a routable task:

  1. Phrase the brief like a closed ticket, not an open question. Include: exact files/dirs, exact output format, exact verification command.
  2. Call Agent with the right subagent_type — haiku-scout, haiku-importer, or sonnet-coder. The model is pinned in the agent file; do not override unless you have a specific reason.
  3. Read the report, don't redo the work. If the subagent missed something, dispatch again with a sharpened brief — don't bail out and do it yourself on opus.
  4. Parallel where independent. If you need three unrelated searches, fire three haiku-scout calls in one message.

When to NOT route

  • A single one-line Read of a file you're about to edit yourself — just read it.
  • A trivial Grep (one pattern, one directory) you're about to act on immediately — just grep.
  • Tasks already inside a subagent — subagents do their own work, they don't recursively dispatch the same tier.
  • When the user explicitly asked you to do it directly.

The threshold is roughly: if the action will take >3 tool calls or >1000 tokens of file content, route it.

Red flags (you're about to waste money)

  • "Let me read these 8 files to understand the structure" → STOP, dispatch haiku-scout with a structural-survey brief.
  • "Let me grep for all usages, then read each one" → STOP, dispatch haiku-scout to return paths+excerpts in one shot.
  • "I'll just write this small fix" while sitting on opus → consider sonnet-coder if it involves >1 file or any test run.
  • "Let me convert this CSV real quick" → STOP, dispatch haiku-importer.

Escalation back to opus

Subagents are instructed to escalate when they hit reasoning work. When you get a report ending in ESCALATE: ..., that's the signal that the next step is genuinely yours. Don't push it back down — handle it on opus and re-dispatch a sharpened mechanical task if needed.

Self-check

Before every tool call in the main context, ask: Could a cheaper model do this exact action with the same correctness? If yes, dispatch. If no, proceed.

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.