My coding agent had one setting for everything. Rename a variable: top-tier model. Fix a typo in a heading: same model. Write a three-line caption: same again.

Most of a normal working day is small stuff. Paying top-tier prices for all of it burns through tokens and quota on work a cheaper model could do just as well. So I built agent-model-router, an open-source skill that asks one question before every task: how hard is this, really?

Three tiers
The router sorts each task into one of three buckets:

Tier Claude model What lands here Light Haiku colour and spacing tweaks, renames, typos, formatting, short copy Regular Sonnet features across a few files, research, explaining code, debugging a clear error Heavy Opus architecture, maths, bugs that survived a first fix, security work, big refactors 

Two rules keep it honest. If the work touches more than one file, it's at least regular. And when the signals are mixed, it rounds up. A cheap answer that's wrong costs more than an expensive one that's right.

How it actually switches
Most agents won't let a conversation change its own model mid-session. So the main session stays on one model, and the router hands work to helpers instead.

The main agent sizes the task.
Same tier as the main model? It does the job itself.
Different tier? It hands the task to a helper agent locked to the right model.
The helper gets a short brief: the exact file, the line, and what "done" means. It shouldn't have to search for anything the main agent already knows.
If the helper fails or says it's unsure, the task moves up one tier. It never steps down.
There's also a "too small to bother" rule. If writing the brief would take longer than making the edit, the main agent just makes the edit.

Every reply ends with a tag, so you can always see which model did the work:

[router: light → haiku] 

The catch with heavy work
Helpers return one answer and stop. They can't ask you a question or go back and forth. That's fine for a well-specified refactor or a calculation, but it's wrong for a design discussion.

So for heavy work that needs a conversation, the router doesn't hand off. It suggests, in one line, that you switch your main model to Opus for that stretch.

Shared memory
Helpers start with a blank slate, which wastes tokens if they have to crawl your project to get oriented. The router keeps a tiny notes file at .model-router/context.md: the stack, the key files, the decisions already made. Every helper reads it first. It stays under about 40 lines and never stores secrets or personal data.

The test
I ran the same 15 requests (5 light, 5 regular, 5 heavy) on Claude Code in a small sample project, each as one session.

Setup Cost

  • No router, everything on Opus -> $2.70
  • Router on, main session on Sonnet -> $2.47 That's about 9% less. Every one of the 15 requests was routed the way the rules say. Three one-shot heavy tasks went to the Opus helper, and two design discussions got a "switch to Opus" suggestion instead of a handoff.

The surprise: Haiku never ran
You'd expect the light tasks to be where the savings come from. They weren't. Not one of them reached Haiku.

The reason is the "too small to bother" rule. Starting a helper means writing a brief and loading context, and for a one-line edit that overhead costs more than the edit itself. So the router kept those on Sonnet. The savings came from running regular work on Sonnet instead of Opus, not from pushing small work down to Haiku.

The lesson for routing: the cheapest model isn't always the cheapest option once you count the cost of getting work to it.

What this doesn't prove
One run, on one small project, with 15 requests. It's a hint, not a benchmark. On a bigger codebase with more regular work, the numbers could look different in either direction. If you try it, I'd like to see what you get.

Which agents it works with
It uses each agent's own subagent feature, so there are no API keys and no proxy, and it works on subscriptions like Claude Pro or Max.

  • Claude Code: verified. Installs, hands one-shot heavy work to Opus, and uninstall restores CLAUDE.md byte for byte.
  • Codex, Gemini CLI, GitHub Copilot: helper support is there, but they ship in manual mode until someone confirms the helper really runs on the expected model.
  • Cursor, OpenCode, Aider, Windsurf, Cline, Roo: manual mode only. In manual mode the agent stays on your model and suggests a switch when the tier changes, for example "Light task: switch to Haiku to save tokens."

Try it

npx agent-model-router install 

The installer asks before it touches your instruction files and never overwrites a file it didn't create. To remove everything it added:

npx agent-model-router uninstall

The code and the tier rules are on GitHub. The most useful thing you can do is test it on an agent you use and open an issue with what you saw. That's how Codex and Gemini CLI move from "not yet verified" to verified.