Cost-optimised agent router: sends every sub-task to the cheapest execution strategy that can succeed, escalates only on verified failure.
Scoped implementation from an approved plan. Capabilities - implement-from-plan, write-tests, fix-simple-bug. The prompt must contain the plan or spec section to implement, including file paths and acceptance checks. Not for open-ended design or ambiguous requirements.
Cheap structured extraction. Capabilities - extract, classify, summarise-single-source, structured-output. Use for pulling fields out of a document or log, classifying items against given categories, summarising one file or diff, converting formats. Input and rules must be fully provided; no judgement calls.
Mechanical code changes from a complete spec. Capabilities - mechanical-edit, rename, boilerplate, pattern-application, config-change, test-scaffold-from-example. The prompt must fully specify what to change and how; this agent makes zero design decisions. Not for debugging, architecture, or ambiguous requirements.
Top-tier reasoning, escalation ceiling. Capabilities - deep-reasoning, architecture, debugging, security-analysis, deep-review, final-synthesis. Use ONLY when a task exceeds the main loop's tier, or a Fable-level task needs an isolated fresh context (parallel deep reviews, synthesis over merged summaries). Never a routing default. If the main loop already runs Fable, use sage solely for context isolation.
Cheap read-only locator. Capabilities - locate, find-usages, map-structure, grep-logs. Use for "where is X", "what uses Y", listing or mapping files and directories, grepping logs or configs. Returns file:line references and short factual summaries. No judgement calls, no reviews, no edits.
Show 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".
Report frugal routing metrics - cost per agent tier, escalation rate, and estimated savings versus running everything on the top-tier model.
Cost-optimised task routing. Use at the start of any coding, search, extraction, review, or multi-step task to pick the cheapest execution strategy (deterministic tool, haiku worker, sonnet worker, main model, fable worker) and to handle escalation when a worker fails. Also triggers on mentions of cost, budget, routing, or delegation.
Wire 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.
Executes bash commands
Hook triggers when Bash tool is used
Uses power tools
Uses Bash, Write, or Edit tools
npx claudepluginhub thomaslangbroek/frugal --plugin frugalBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
A cost-optimised agent router for Claude Code. Frugal teaches the main loop to send every sub-task to the cheapest execution strategy that can succeed, and to escalate only on verified failure:
deterministic tool → haiku worker → sonnet worker → main model → fable (escalation ceiling)
The expensive reasoning model plans and judges; commodity work (locating files, extracting data, mechanical edits) runs on cheap tiers. No framework, no runtime, no API keys: frugal is a plugin made of a routing skill, five agent definitions, and two small hooks. The harness does the rest.
/plugin marketplace add ThomasLangbroek/frugal
/plugin install frugal@frugal-marketplace
The main model already reads every request, so it acts as the router at zero marginal cost. The routing skill gives it one decision table:
| Task | Agent | Model |
|---|---|---|
| locate, grep, map structure, find usages | scout | Haiku |
| extract, classify, summarise one source | extractor | Haiku |
| mechanical edits from a complete spec | mechanic | Sonnet |
| implement one scoped task from an approved plan | builder | Sonnet |
| design, debugging, ambiguity, risk | main loop | whatever you run |
| beyond the main loop's tier, or isolated deep reviews | sage | Fable |
Plus a tool-first rule: if grep, jq, git, terraform or any deterministic command solves the task, no model is called at all.
Workers do not self-grade their way up the ladder. Every worker ends with a fixed footer:
RESULT: <one line>
CHECKS-RUN: <commands run and outcomes, or "none">
UNCERTAINTIES: <or "none">
ESCALATE: yes|no - <reason>
The router then applies four rules:
terraform validate), run it. Pass = done. Fail = escalate one tier, maximum one retry, then the main loop takes over.ESCALATE: yes is advisory input, never the sole trigger. Self-reported confidence from a cheap model is poorly calibrated; observable failure is not.sage (Fable) is reached only via high-risk table rows or after escalation exhausts, one attempt, final.A SubagentStop hook logs one jsonl line per worker run (agent, model, token usage, escalation flag) to ~/.claude/frugal/metrics.jsonl. Run:
/frugal:router-stats
to get cost per tier, escalation rate, and estimated savings versus running the same work on your session's actual main-loop model (recorded per run; older records without it are compared against the top tier). Prices live in scripts/stats.py (PRICES); update them when Anthropic pricing changes. Learning is deliberately offline: read the report, edit the decision table.
Routing policy in a skill is advisory: the model follows it well, but a prompt cannot forcibly prevent anything. Frugal therefore enforces on three levels, the first two active out of the box:
SessionStart hook puts the routing policy in context at every session start; a UserPromptSubmit hook re-pins a one-line reminder on every prompt. No drift, nothing to invoke manually.PreToolUse guard counts search-type tool calls (Read, Grep, Glob, search-y Bash) in the main loop. Past the budget (default 5 per prompt) further ones are denied with a pointer to the cheap workers. The budget resets on any delegation or new prompt; worker agents are never throttled. Non-search commands (git, test runners, builds) are never blocked.hooks/guard_expensive.sh blocks sage spawns entirely. Wire it as a PreToolUse hook with matcher Agent in your settings.json if you want a hard ceiling.Judgement lives in prompts; enforcement lives in hooks.
| Knob | Default | Effect |
|---|---|---|
FRUGAL_INLINE_BUDGET | 5 | Inline search ops allowed per prompt before the guard denies |
FRUGAL_ALLOW_INLINE=1 | unset | Disables the inline-exploration guard for the session |
FRUGAL_ALLOW_EXPENSIVE=1 | unset | Allows sage spawns past the opt-in expensive-tier guard |
FRUGAL_METRICS_PATH | ~/.claude/frugal/metrics.jsonl | Where worker-run metrics are written |
/frugal:models | agent defaults | Per-project model overrides, e.g. /frugal:models scout=sonnet |
.claude/routing-overrides.md | none | Per-project routing rules; read first, always win |
Turn your strongest Claude model into a team-lead orchestrator: it plans and reviews, delegates execution to the cheapest capable workers (Claude subagents or auto-detected Codex CLI workers), and blind-verifies meaningful changes before accepting them.
Smart LLM routing with Claude subscription monitoring, complexity-first model selection, and 20+ AI providers
Calibrated per-subagent reasoning effort: classify each subtask, dispatch it to the cheapest tier that still passes.
Delegate the grind, keep the glory. Offload grunt work to a cheaper or different engine (OpenRouter, Codex, keyless Gemini) while Claude orchestrates, or pull a stronger model in as an advisor. Per-model prompting, image gen, consensus second opinions, cost Tab.
Cost-conscious mode for Claude Code. Saves 30-60% on costs through concise responses, model routing, and efficient workflow patterns.
Turns Fable 5 into a token-frugal orchestrator: Fable keeps judgment, tiered Opus/Sonnet/Haiku agents do the labor.