/frugal:routingfrom Frugal
Routes sub-tasks to the cheapest capable execution strategy (tool, haiku, sonnet, main model) based on task signals. Handles cost optimization, worker escalation, and sensitivity gating.
Ships in Frugal. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Route every sub-task to the cheapest strategy that can succeed. Priorities, in order: correctness, cost, latency, extensibility, simplicity.
If .claude/routing-overrides.md exists in the project, read it first. Its rules win over everything below.
Before any delegation: if a deterministic command solves the task (grep, rg, jq, yq, sed, awk, git, terraform, kubectl, helm, docker, a compiler, a test runner), run it. No LLM call. Reasoning models are for reasoning.
Step 1 covers one-shot commands only: you know the exact command and its output answers the question directly. The moment discovery turns iterative — a second search informed by the first, listing directories to decide what to read next, reading files to summarise them — it is no longer a tool call, it is a locate/extract task. Bright line: the third search/list/read operation on the same question means you are exploring inline; stop and hand the whole question to scout or extractor, including what you already learned. Every raw tool result you ingest is paid at main-loop rates; a haiku worker reads the same bytes at a fraction of the cost and returns a summary.
Sensitivity is not a task-type signal, so it cannot live in the decision table below. Some data must never leave the main loop for a worker, however cheap the task looks. Decide this before tier selection, not by letting a worker fail into it.
If .claude/frugal-sensitivity.json exists in the project, it declares rules (content regexes and path globs) and, per rule, which workers may still receive matching data. The guard_sensitive.py hook enforces it at spawn: a matching Agent delegation to a non-allowed worker is blocked, and you handle that sub-task inline. The gate fails closed (a broken config blocks delegation), unlike the cost hooks which fail open. With no such file the gate is off. See examples/frugal-sensitivity.example.json.
This is an enforced default, not a substitute for judgement: for regulated data the human owns the final call on where it may go.
Decompose the request into sub-tasks. For each, match signals to the cheapest capable agent. Installed as a plugin, the agents are namespaced: spawn frugal:scout, not scout:
| Task signals | Required capabilities | Route |
|---|---|---|
| "where is X", "what uses Y", map directory, grep logs | locate | scout (haiku) |
| pull fields from docs/logs, classify against given categories, summarise one file or diff, format conversion | extract | extractor (haiku) |
| rename, boilerplate, apply known pattern, config value change, test scaffold from example, with a complete spec | mechanical-edit | mechanic (sonnet) |
| implement one scoped task from an approved plan, write tests from given cases, fix a simple reproduced bug | implement-from-plan | builder (sonnet) |
| design, debugging, ambiguous requirements, reviews, trade-offs, anything regulated or risky | reasoning | main loop (you) |
| task exceeds the main loop's own tier, or Fable-level work needs an isolated fresh context (parallel deep reviews, synthesis over merged summaries) | deep-reasoning | sage (fable) |
sage is never a routing default. Check what the main loop actually runs before reaching for it: on Opus 5 (or any tier below Fable) sage is a real capability escalation and the decision table's first clause applies; if the main loop already runs Fable, use sage only for context isolation, not capability.
Generic agents are never routing targets. Explore, general-purpose, claude, Plan, and fork are reasoning-tier and bill at main-loop rates — never spawn them for locate, extract, or summarise work, no matter how broad the fan-out. Map them down: locate/map -> scout; extract/summarise/classify -> extractor; mechanical edits -> mechanic/builder; reasoning stays in the main loop. A bare Agent call with no subagent_type defaults to general-purpose (expensive) — always name a cheap agent explicitly. The exception is a generic agent pinned to a cheap tier with the Agent tool's model parameter (haiku or sonnet): that bills at the pinned tier and is allowed, but prefer the frugal worker when one fits, because its prompt caps the reply. fork ignores model and always runs on the main-loop model. The guard_expensive.sh hook blocks these at spawn time; FRUGAL_ALLOW_EXPENSIVE=1 is the deliberate, per-session override for when a task genuinely needs main-loop breadth.
Workers pin their own reasoning effort in frontmatter: low for scout, extractor and mechanic, medium for builder, high for sage. Model tier is one axis of cost and thinking is another, so a session running at high effort no longer makes a haiku scout deliberate over a grep.
Security-sensitive changes, destructive operations, ambiguous requirements, anything needing user judgement. These stay in the main loop, always.
scripts/stats.py prints the measured floor per agent ("delegating pays off above ~N tokens of reading") from your own runs; under it, read it yourself.path:line ranges, commit SHAs, URLs), never pasted file content. Pasting is billed as main-loop output tokens (fable scout/extractor workers, merge their summaries, do one final reasoning pass yourself.RESULT: / CHECKS-RUN: / UNCERTAINTIES: / ESCALATE:). A worker reporting ambiguity: resolve it yourself; never re-prompt the worker to guess.terraform validate): run it. Pass = done. Fail = re-dispatch one tier up (haiku worker -> equivalent sonnet worker; sonnet worker -> take over yourself), maximum one retry. Include the failed attempt's footer in the retry prompt.ESCALATE: yes is advisory input to rules 1 and 2, never the sole trigger.sage with the full failure history. One attempt, final.FRUGAL_BUDGET_USD sets a per-session ceiling, counting main-loop spend as well as delegated spend. Under 80% of it nothing is said. From 80% a warning arrives with each prompt: delegate harder, keep worker replies terse, leave sage alone. At 100% stop and confirm with the user before starting new work, and reasoning-tier spawns are denied even with FRUGAL_ALLOW_EXPENSIVE=1, because they cost more than the main loop does. Cheap workers stay allowed at every level: they are how you get back under.
Unset means no ceiling and no warnings.
What SKILL.md sets; muted values are Claude Code's defaults
4 skills in this plugin
/modelsShow or change which model each frugal agent runs on, per project. Use when the user wants to see the current tier-to-model mapping, move an agent to a different model (e.g. scout to sonnet), or reset overrides. Triggers on "frugal models", "change router models", "which model does scout use"./router-statsReport frugal routing metrics - cost per agent tier and estimated savings versus running everything on the top-tier model./setup-statuslineWire the frugal savings segment into the user's Claude Code statusline - creates a minimal statusline if none exists, or merges the segment into an existing one.npx claudepluginhub thomaslangbroek/frugal --plugin frugalOther plugins' skills for the same job