The right model for each job, and the bill before you pay it.
Below is every part of the screen it adds. The numbers on each picture match the notes beside it; hover or tap either side to highlight the pair. All values are examples.
Source, issues and the full README: github.com/TFoxik/claude-model-router.
Needs Claude Code 2.1.287 or later. A fresh install starts on the Inherit preset, which changes no model and only tracks costs. Pick a preset in /route to start routing. New to prompt caching or model costs? Turn on Learn mode in the same pane; it stays off until you do.
Three lines that sit above where you type. The top line is about routing, the second about the health and cost of the session; both update after every request. The third, right-aligned, holds every button, so the band keeps its height and the text lines share one left edge.
The route the last request went through and the model and effort it got. Orange is normal work, green is plan mode, blue is a subagent. It says router off when routing is off, and (held) when auto effort kept the current level so it wouldn't rebuild the cache.
A short summary of what plan mode, normal work and subagents are set to.
Appears while you have unapplied changes in the Routes pane.
96% is how much of the last request was read from the prompt cache (green above 80%, yellow above 50%, red below). 42m is how long the cache stays warm; it turns yellow in the last 5 minutes. Once it runs out it shows cold $1.60: what your next send would cost to rebuild the cache.
How full the context window is. Green until 60% of the way to auto-compaction, yellow to 85%, red after. Context on the last line opens the Context pane.
last is what your whole last prompt cost, including every subagent it started. It grows live while the prompt runs. session is the estimated spend in this session so far, across all routes. Cost on the last line opens the Cost pane on its Last prompt tab.
How much of your 5-hour and 7-day plan limits is used. Yellow from 70%, red from 90%.
Only while other sessions' handoffs are open in this repo; resume each, or mark it Done or Not relevant, in the Handoffs pane. Never shown while handoffs are off (/route handoffs off).
Only when carrying on is not the best move. next /clear after a git commit or a pull request over 50k tokens or more, until your next prompt; once a plan is written to disk (implement it in a fresh context); after two corrections in a row; once the cache has gone cold over a big context; or after an auto-handoff was saved. next /handoff (or next handoff without the skill) instead of clearing after a commit or compacting, when two or more todos or tasks are still open. next /compact within 15% of auto-compact, or when the conversation is most of a context that is 60% of the way there. A highlighted button on the last line; click it for the reason, priced, at the top of the Context pane's tips. It shows with learn mode on or off; /route next off hides it and the Context pane's advice tip.
Open the Context pane, the Cost pane and the Routes pane. To hide the band, use the Band row in Routes or /route band off; it is kept off the band so a stray click can't hide it.
Where you choose the model and effort for each kind of work, and the settings for everything else, in a box at the bottom. What the session has cost per route is in Cost › Session.
● on means the router picks the model and effort for every request. Turn off stops that, and everything uses the session's own model. Cost tracking, the band and the cold-send guard keep working either way. Same as /route on / /route off.
plan toggle keeps cache.A ready-made set of routes. It shows Custom once you change any row yourself. The presets are listed at the end.
The model that talks to you directly. Plan mode is used while plan mode is on, Normal work the rest of the time. Each row has a model (Opus, Sonnet, Haiku, Fable, inherit) and an effort (low to max, inherit, or auto).
auto exists only here: it sends the start of each prompt to Haiku, which rates it trivial, standard or hard, and the effort follows. Changing a main-loop row rebuilds the prompt cache once, because a cache belongs to one model and effort. ▸ marks the live row.
Helpers Claude starts. They begin with an empty context, so sending them to a cheaper model costs nothing up front.
Other agent types use Default. Give one its own route with /route set sub:<agent-type> haiku low.
inherit means “use the row above”. Model and effort are looked up separately, walking up until a real value is found, then falling back to the session.
Forks, background copies of the current conversation, always use the parent's model.
Changing a drop-down above doesn't take effect yet. Once you change something, this line becomes the Draft box shown below. The settings under it don't use the draft: each one applies at once.
Settings › Coaching. Off by default. Turn on starts the lessons described in Learn mode; the line under it disappears and the button becomes Turn off. Same as /route learn on / off.
Settings › Coaching. On by default. Shows next /clear, next /compact or next /handoff in the band when carrying on is not the best move, with the reason at the top of the Context pane's tips. Turn off hides both, and learn mode stops teaching from that advice. Same as /route next on / off.
Settings › Handoffs. On by default. Turn off switches the whole feature off: no Handoffs ●N in the band and no auto-handoff, while handoffs you save with /handoff stay listed. Open shows the Handoffs pane. Same as /route handoffs on / off.
Indented under Handoffs, and shown only while Handoffs is on. Off by default. When on, and the cache is in its last minutes with two or more steps open or a plan not yet started, model-router asks Claude for a handoff while the cache is still warm and saves the reply under ~/.claude/handoffs/<repo>/. The handoff ends with its open steps under ## Open steps, each tagged (you) or (claude) for who does it. It waits while you type or anything runs, goes once per prompt, and never clears the session. Same as /route handoffs auto on / off.
Settings › Cache and display. What a send onto a cold cache does: refuse holds it once with its price (the default), warn sends it with the price shown, off doesn't check. See Cold-send guard. Same as /route guard refuse|warn|off.
60 min (the default) or 5 min: the prompt-cache lifetime that the band's warm/cold timer counts down and that cache writes are priced at. Same as /route ttl 5|60.
On by default: the first 120 characters of each prompt are kept for Cost › History. Turn off keeps only labels and costs, and also removes text already kept. Same as /route stats text on / off.
Shown by default. Hide takes the band away from above the prompt; routing, the guard and cost tracking keep working. Same as /route band off / on.
Before anything changes, the pane shows what the change would cost and save.
The row you changed, old setting → new setting, and the rough difference per turn (main loop) or per run (subagent). Green is cheaper, red is more expensive. Changed rows are also marked with a yellow ● in the table above.
Shown when the change hits the route you are on. The current context has to be written into a new cache once, at this price.
Apply switches to the new routes. Discard throws the draft away.
Where the money went: your last prompt, this session by route, and a history kept across sessions, so you learn which commands and prompts are expensive over time. One pane with three tabs.
Three buttons under the title; the selected one is highlighted. Each pane below shows one tab. Last prompt is where the band's Cost opens. History is where the footer's ▤ today opens. /route cost [last|session|history] opens a tab by name; /route last and /route stats still open Last prompt and History.
Where the money for your last prompt went, request by request: the total, and how it splits between the main loop and subagents. It resets when you send the next one.
Shown when part of the cost came from rebuilding the cache, with the reason (cold cache or route switch) and the extra cost.
The main loop first, then each subagent with its type and task, most expensive first. Each row shows its share of the prompt, then the model and effort it ran on and its token counts (explained in the Session tab's notes below).
Up to three changes for this prompt, biggest saving first: how to avoid the cache rewrite it paid for, a cheaper route when Opus or Fable did most of the work, or which subagent route to move when subagents did most of the spending.
Estimated spend in this session so far, across all routes. The band shows the same number next to last.
Most expensive first, with each route's share.
All costs are estimates from prices built into the mod. Cache writes are priced for the cache lifetime set in Routes › Cache lifetime, or with /route ttl 5|60.
The title reads Cost on the other tabs and Cost · <repo> here, with a switch that appears only on this tab. Show prompts from This repo only, or from All repos. With All, each prompt also shows which repo it came from.
Spend today, over the last 7 days and in all kept history, plus how many prompts that covers.
↻ cache rewrites counts requests that had to rebuild the whole cache, because it went cold or because a route switched model or effort. The amount is what that cost above a normal warm read.
Each slash command (and prompt for plain messages), ranked by what one run costs on average. The bar compares it to the most expensive command. Below it: number of runs, total, the single most expensive run, and which models the money went to.
Model colours: ● Opus · ● Sonnet · ● Haiku · ● Fable.
The 8 priciest prompts: date, the start of the prompt, cost. Below: requests and subagents, the models used, and any cache rewrite it paid for in yellow.
Up to three patterns in the history worth changing, biggest first: cache rewrites that add up to $1 and a tenth of spend, a command run 3+ times that averages 3× a plain prompt or more, or Opus and Fable doing 80% of $5+ of spend.
History lives in the mod's local store and never leaves your machine: per prompt, the first 120 characters of text, the repo name, cost and models. The last 2,000 prompts are kept. Routes › Keep prompt text (or /route stats text off) stops keeping the text and removes what is already kept; /route stats clear deletes everything.
What is filling your context window, the same breakdown /context gives, in a pane you can keep open.
Tokens in use out of the window, coloured green, yellow or red by how close you are to auto-compaction.
The window as one bar, coloured by category. In the terminal it is drawn with block characters.
Where Claude Code will compact the conversation, and how many tokens are left until then.
In use is what is sent with every request: messages, tools, memory files, and so on. Not sent covers deferred tools (loaded only when needed), free space and the buffer kept for compaction.
The top five of each by size: the first places to look when context fills up quickly.
Up to three things worth doing, biggest first. Advice to compact or clear always comes first, with its reason, the same advice the band's next shows. MCP servers, plugins and skills this repo has left unused have a section of their own below the tips; see Unused servers, plugins and skills, and /route unused for the full list.
The rest are things worth trimming, each with what to do: a memory file of 3k or more, an MCP server whose loaded tool schemas reach 5k (deferred ones cost nothing), a skills listing of 3k or more, or custom agent descriptions of 2k or more. Worked out from the breakdown alone, with no model call; nothing shows when there is nothing to trim.
The ways to leave the session for a while, priced for its context, model and cache, the same numbers /route away gives; see Stepping away for what each one does. It shows once the context is as big as the cold-send guard cares about (50k tokens) and cached. The header says how much cache time is left; once it has run out, it says so and points to /clear.
Each option has now, the cost of doing it today, and on return, what your first send after the break costs. Prices are estimates.
The prompt cache expires after a pause (1 hour by default). Your next message then has to re-send the whole conversation at the cache-write price, which on a big context can be dollars instead of cents.
When the cache is cold and the context is over 50k tokens, the mod drops your message once and tells you what it would cost. Send it again to go ahead, or start fresh with /clear.
Slash commands that reach the model (like /simplify) are held the same way. Notifications, triggers and messages from other sessions always pass.
With learn mode on, the message adds a Why: paragraph explaining the cache. The guard uses the band's clock and doesn't keep the cache warm itself; see Stepping away for ways to avoid the cold send.
Off until you turn it on. While it's on, the mod turns what it measures into short lessons, shown as a card above the band at the moment they apply: when a turn that cost you ends, or just before the cache goes cold. The card stays until you send your next prompt, because a lesson about a turn you've moved on from is noise. Every lesson quotes the real numbers from your session; nothing is a generic tip.
Appears above the band when a turn ends with something worth knowing, or while you're idle just before the cache goes cold. It shows the one lesson most worth it: the costliest that turn. +1 more says other lessons fired too; they're kept, not shown. It goes away when you send your next prompt or /clear, and still shows when the band is hidden. Only the terminal and the desktop app draw above the prompt; a session shown only elsewhere, such as VS Code, gets the lesson as a toast instead.
To stay out of the way: each topic shows at most once an hour, and stops showing after three times.
This turn's numbers. Prices come from the same table as the rest of the mod, so they match the band and Cost.
What the concept is, why it costs, and what to do about it. Only the first time a topic shows; after that the card is the title and the fact.
Got it takes the card down. Mute topic stops that kind of lesson, such as the expensive-model one when you route Opus on purpose, and a toast names the command that brings it back. /route learn lists the muted topics. Mutes and learn mode itself are shared by all your sessions.
| Topic | When | Example |
|---|---|---|
| Cache about to go cold before | While you're idle, 5 minutes before the cache expires (2 on the 5-minute cache), over 50k tokens of context. | The prompt cache goes cold in 5m. A send before then reads the 200k tokens for $0.04; after, it re-writes them on Opus 5.5 for $1.60. |
| Cold-send guard: Why before | When the guard holds a message. | Why: Each request re-sends the whole conversation… |
| Plan mode switches rewrite the cache before the way back | On entering plan mode when it's routed differently from normal work. The engine only reports plan mode with the send, so entering is already paid; leaving is not. | Plan mode runs on Opus 5.5 high and normal work on Opus 5.5 medium, so each switch re-writes the cache: at 200k tokens, entering cost about $1.60 and leaving will cost about $1.60. |
| Context is getting big heads-up | When context passes 60% and 85% of the way to auto-compact. | Context reached 300k tokens, past 60% of the way to auto-compact. From here every turn re-reads all of it: about $0.06 a turn on Opus 5.5 while the cache is warm, $2.40 if it goes cold. |
| Cache went cold after | A send rebuilt an expired cache, costing at least $0.05 more than a warm read. | The cache had expired after 1h01m idle, so this send re-wrote 100k tokens on Opus 5.5 for $0.80; read warm they would have cost $0.02. |
| Switching model rewrote the cache after | A change of model or effort rebuilt the cache. | Switching from Opus 5.5 medium to Sonnet 5.5 high re-wrote 100k tokens for $0.40 ($0.38 more than a warm read). |
| An expensive model did most of the work after | Opus or Fable made up 70% or more of a prompt costing $0.25 or more, and Sonnet would have been at least 25% cheaper for the same tokens. | Opus 5.5 did 100% of this prompt's $0.60. The same tokens on Sonnet 5.5 would cost about $0.30 (price only, not quality). |
| Subagents did most of the spending after | Two or more subagents made up half or more of a prompt costing $0.25 or more. | 2 subagents made up 80% of this prompt ($0.80), most of it sub:Explore on Opus 5.5… |
| Clear after committing heads-up | When a commit or a pull request over 50k tokens or more turns the band's advice to clear. A growing context and a cold cache are taught by the topics above. | Work was committed. Each further request re-reads the 200k tokens of finished work ($0.04 warm): /clear and start the next task fresh, or /compact to carry a summary. |
| Conversation compacted after | After a compaction. | The conversation was compacted from about 180k tokens down to a summary. |
| Hand off instead of compacting mid-plan heads-up | When two or more todos or tasks are open and the band's advice turns to a handoff: after a commit, near auto-compact, or when the conversation fills the context. | Work was committed with 4 steps still open. Each request re-reads 120k tokens ($0.02 warm): write a handoff with /handoff, /clear, then resume from it. A /compact summary keeps less of the plan. |
| Start fresh once the plan is written heads-up | When a plan saved by plan mode, a specs/ or plans/ Markdown file, SPEC.md or PLAN.md turns the advice to clear. | The plan is in ~/.claude/plans/calm-fox.md, and the 85k tokens of exploration behind it get re-read on every request: /clear and ask Claude to implement the plan file in a fresh context. |
| Start over after two failed corrections heads-up | After two correcting prompts in a row ("no, …", "still failing", "that's wrong") over 20k tokens. | 2 corrections in a row over 60k tokens: the failed attempts stay in context and steer the next try. |
| Exploration filled the main context after | The first time in a session that reads and searches put 30k tokens or more, and 30% of the context, into the main conversation. | File reads and searches put 42k tokens (35%) into the main context this session. |
| Handoff saved before the cache went cold after | After an auto-handoff was saved. | Saved a handoff to ~/.claude/handoffs/r/2026-10-11-1432-ab12cd34.md for $0.04 before the cache went cold. Resending 140k tokens cold would have cost $0.52. |
Habits. Three habits no hook can spot are worth keeping anyway: /clear between unrelated tasks, since a new topic on top of an old one pays to re-read it; /btw for side questions, whose answer never enters the conversation; and Esc Esc to rewind to before a bad turn instead of correcting on top of it.
Going to lunch or into a meeting with work in progress? /route away compares the ways to leave a session, priced for its context, routed model and cache right now. The Context pane shows the same options in its Before a break box. The options follow Anthropic's cost guide and session tips. The cache lasts an hour on a subscription and five minutes on an API key, and any send resets it.
Context size, the model the next send is routed to, and how long the cache stays warm. Once it's cold, the report says so and points to /clear, which costs nothing.
The cheapest way back. One warm turn to have Claude write down the plan, decisions and next steps, then /rename so you can find the session and /clear. You come back to a small, fresh session that reads the note.
Compaction reads the whole conversation; warm, that read is cheap. Tell it what to keep. On return only the short summary is written to a new cache. Compacting after the break is the expensive way: it reads everything at full price.
Nothing now. On Pro and Max, resuming a big session after a long break offers to continue from a summary instead of the full history.
A tiny send before each expiry keeps the cache alive for one warm read per hour (twelve on the 5-minute cache). Worth it for a few hours away; overnight it adds up, and on a subscription it counts against your limits.
Free now, and the first send after the break re-writes everything. The cold-send guard will hold that send once with its price.
Handoffs saved by auto-handoff or your own /handoff live in ~/.claude/handoffs/<repo>/. The Handoffs pane keeps track of which ones are still open, so you can pick one up in a fresh session, and gets the rest out of the way. The files themselves are never edited or deleted.
This repo lists the folder for the session's repo; All lists every repo's, each title starting with its repo.
Its date, its title (the file's first # heading) and, dimmed, what it is about: the first paragraph under ## Goal, or after the title, cut to a few lines. Then up to six of its open steps, the list under ## Open steps, each owner tag such as (you) dimmed, and how many more there are. Each handoff sits in its own box. Resume puts resume from <path> in the prompt box without sending it. Done and Not relevant close it.
A handoff closes when a newer one is saved in the same session (superseded), or when you send a prompt naming its path (resumed). It shows as done once another tool leaves a .md.closed marker beside it, unless you reopened it after that. One left open for 14 days folds away as stale but keeps its buttons. Each closed one says why, and Reopen brings it back. The band shows Handoffs ●N for open handoffs other sessions left in this repo, for as long as they are open.
Every connected MCP server sends its tool names and instructions with each request, and every plugin, personal skill and claude.ai skill adds a line to the list Claude reads. The mod notes, per repo, which ones are loaded and which get used, and names the ones a repo leaves alone. It can't switch anything off itself; it gives you the setting that does.
A server is used when Claude calls one of its tools. A plugin is used when one of its skills, agents, slash commands or MCP tools runs, and a skill or command when Claude or you run it. Recording starts with 0.7.0, and with 1.5.0 for skills. Something is listed once it has been loaded here for two weeks and ten sessions with no use in the last 30 days. Each session counts once, even across a /login or a reload.
Named as /mcp names them. /mcp keeps a server off for the repo you turn it off in. A server no repo has used says so, and suggests removing it from its config. A connector you never signed in to only offers sign-in tools; it isn't counted as connected, so it's never listed. Neither is claude.ai's own Visualize.
Connectors come with your claude.ai account and load in every repo. The terminal names one claude.ai Figma and the desktop app by an id; it counts once either way, so using it from one app keeps it off the list. When none of the connected ones is used here, one setting turns them all off for this repo.
A block to paste into the repo's .claude/settings.local.json, with each plugin's full name@marketplace. A plugin no repo uses points to /plugin instead. Turning a plugin off takes its own MCP server with it, so that server isn't listed again. The mod can't see a plugin's hooks run, so check before turning off one you keep for its hooks; plugins with nothing but hooks are never listed.
Everything in ~/.claude/skills and ~/.claude/commands, downloaded ones included. These can't be turned off for one repo, so only ones no repo uses are listed, with a command that moves them to an archive folder; moving them back restores them. One that only this repo uses gets Move here instead, which makes it a project skill so other repos stop loading it.
Skills synced from your claude.ai account. They are switched on and off on claude.ai for every repo at once, so ones no repo uses share one line pointing there. When most of them are unused, it also names "syncClaudeAiSkills": false, which stops syncing all of them, the ones you use too.
The Context pane lists the six biggest in its own section, each with a button that puts the fix in your prompt; nothing runs until you press Enter. To try it without two weeks of history, start a session with MODEL_ROUTER_IDLE_DEV=1: after its first prompt, anything loaded but not used in the last 30 days is listed.
Commands that change settings only run when you type them, never from another session, a channel or a trigger. Opening a pane works from anywhere.
| Command | What it does |
|---|---|
/route | Open the Routes pane |
/route cost [last|session|history] | Open the Cost pane, on a tab if you name one |
/route last · stats | Open Cost on Last prompt, or on History |
/route context | Open the Context pane |
/route learn | Show whether learn mode is on and which topics are muted |
/route learn on|off | Turn learn mode on or off (default off); also in the Routes pane |
/route learn mute|unmute <topic> | Silence or bring back one topic, such as pricey-model; muting also from the card |
/route handoffs | Open the Handoffs pane |
/route handoffs on|off | Turn the whole Handoffs feature on or off (default on); also in the Routes pane |
/route handoffs auto on|off | Turn auto-handoff on or off (default off); also in the Routes pane |
/route away | Before a break: the ways to step away, priced for this session |
/route unused | MCP servers, plugins and skills this repo has long left unused, grouped, with what turns each off |
/route stats clear | Delete the saved prompt history |
/route stats text on|off | Keep the first 120 characters of each prompt (default on); off also removes text already kept; also in the Routes pane |
/route preset <name> | Apply a preset: inherit, mine, balanced, frugal, max |
/route set <route> <model> [effort] | Set one route now, e.g. /route set sub:Explore haiku low |
/route on · off | Turn routing on or off |
/route band on|off | Show or hide the band |
/route guard refuse|warn|off | What a send onto a cold cache does; also in the Routes pane |
/route ttl 5|60 | Cache lifetime in minutes used for the warm/cold timer and prices (default 60); also in the Routes pane |
Routes: main, plan, sub:*, sub:Explore, sub:Plan, sub:general-purpose, sub:<any-agent-type>, workflow, teammate. Models: opus, sonnet, haiku, fable, inherit. Efforts: low to max, auto (main and plan only), inherit.
| Preset | Normal work | Plan mode | Subagents | Explore | Plan agent |
|---|---|---|---|---|---|
| Inherit | Changes nothing; only tracks costs. The default after install. | ||||
| Mine | Opus medium | Opus high | Sonnet high | ↑ | ↑ |
| Balanced | Opus auto | Opus high | Sonnet medium | Haiku medium | Opus high |
| Frugal | Sonnet auto | Opus medium | Haiku medium | Haiku low | Sonnet high |
| Max quality | Opus xhigh | Fable high | Opus high | Sonnet medium | Opus xhigh |
↑ = uses the Subagents default.
auto effort makes one extra small Haiku request per prompt to rate it.inherit.~/.claude/handoffs/: it lists and reads them and, with auto-handoff on, writes new ones. It also reads the .md.closed markers other tools may leave beside a handoff. It never writes, edits or deletes a file it didn't write.