routing skill
A decision table plus the escalation protocol. The whole policy.
Claude Code plugin · MIT · no runtime
Frugal turns Claude Code's main model into a router. Every sub-task goes to the cheapest tier that can do it, and it escalates only when a real check fails.
Illustrative. Applies to the delegated portion of a session, not the whole bill. Every install measures its own numbers locally.
the routing ladder
One decision table the main model reads on every sub-task. A deterministic shell command beats any model; a model is called only when reasoning is actually required.
Verification first. A worker climbs a tier only when a real check fails, never on a cheap model's self-reported doubt.
what it actually is
The main model already reads every request, so it routes at zero marginal cost. Everything else is small.
A decision table plus the escalation protocol. The whole policy.
scout, extractor, mechanic, builder, sage. Each a tier, each a plain markdown file.
What turns advice into enforcement. A broken hook never breaks a session.
Depends on: stdlib Python and bash. No runtime, no API keys, no network calls, no telemetry.
enforcement, not vibes
Routing policy in a skill is advisory. Frugal backs it with two hooks so it does not quietly drift back to expensive habits.
Counts search-type calls in the main loop. Past the budget it denies the next one and points at the cheap workers. Resets when you delegate.
fail-open by designBlocks reasoning-tier agent spawns at the source, so locate and extract work is not handed to a top-tier model by reflex. One env var overrides it per session.
fail-open by designit measures itself
A hook logs one local line per worker run: agent, model, tokens, escalation flag. A report then shows cost per tier, escalation rate, and savings versus your session's own main-loop model.
Learning is deliberately offline. High escalations on one agent means its row routes too low. Near-zero savings means work is not being delegated. You edit the decision table, not a model.
In the author's own measurements the delegated portion of a session runs about 85% cheaper than the same work on the top tier. Reasoning stays on the expensive model by design.
# one jsonl line per worker run tier runs model net scout 41 haiku $0.02 extractor 23 haiku $0.03 mechanic 11 sonnet $0.19 main loop 7 fable $2.90 escalation rate ............ 6% saved vs top tier ..... $3.41
install
Rollout is per person and needs no workflow change. Routing is automatic. Uninstall keeps no state beyond the local metrics file.
# add the marketplace /plugin marketplace add ThomasLangbroek/frugal # install the plugin /plugin install frugal@frugal-marketplace
honest trade-offs
It leans on the harness: the Agent tool, hooks, parallel delegation. Multi-provider is a documented recipe, not a tested code path.
The skill steers routing well, but only the guard hook enforces it. Turn the hook on for a hard ceiling.
Limited to what hook events and transcripts expose. Escalations without the marker are not counted.