Claude Code model router

Frugal

Cost-optimised agent router for Claude Code: sends every sub-task to the cheapest model that can do it, and escalates only on verified failure.

38 stars 5 forksModel routers & proxies Plugin marketplace Source

Install

Inside Claude Code
/plugin marketplace add ThomasLangbroek/frugal

Found in the project README. Check it for setup steps after installing.

From source
git clone https://github.com/ThomasLangbroek/frugal.git

From the README

frugal

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:

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.

Install

How it works

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:

Plus a tool-first rule: if grep, jq, git, terraform or any deterministic command solves the task, no model is called at all.

Escalation (verification first)

Workers do not self-grade their way up the ladder. Every worker ends with a fixed footer:

The router then applies four rules:

1. If a deterministic check exists (tests, compiler, schema validation, terraform validate), run it. Pass = done. Fail = escalate one tier, maximum one retry, then the main loop takes over.
2. No check available: the main model spot-reads the result. It receives it anyway, so judging it costs almost nothing.
3. The worker's ESCALATE: yes is advisory input, never the sole trigger. Self-reported confidence from a cheap model is poorly calibrated; observable failure is not.
4. Never start at an expensive tier unless the decision table requires it. sage (Fable) is reached only via high-risk table rows or after escalation exhausts, one attempt, final.

Metrics and the cost report

A SubagentStop hook logs one jsonl line per worker run (agent, model, token usage, escalation flag) to ~/.claude/frugal/metrics.jsonl. Run:

to get cost per tier,…
Read the full README on GitHub

Details

Language
Python
License
MIT
Last updated
1 November 2026
Topics
ai-agentsanthropicautomationclaudeclaude-codecost-optimizationdeveloper-toolsllmplugin

FAQ

What is Frugal?

Cost-optimised agent router for Claude Code: sends every sub-task to the cheapest model that can do it, and escalates only on verified failure. It is a model router for Claude Code, from ThomasLangbroek/frugal on GitHub.

How do I install Frugal?

Run /plugin marketplace add ThomasLangbroek/frugal inside Claude Code, then follow the setup in the README.

Is Frugal popular?

ThomasLangbroek/frugal has 38 GitHub stars and 5 forks. It was last updated on 1 November 2026.

More model routers & proxies

Browse the most popular Claude Code mods, all model routers & proxies, or the skills and MCP server directories.