Skip to content

model-router

Choosing the right model for every subagent, child session, or workflow agent does not have to be guesswork. model-router applies a single written grid, routes launches on the fly when no model is specified, and measures on your machine how well each choice pays off.

When Claude Code delegates part of the work to a subagent, it starts a helper with a clean context that handles a single task and reports back. Left to itself, though, the main agent launches every helper with its own model and its own effort level (how long the model thinks before answering).

That wastes resources in both directions:

  • spending a large, expensive model on a basic file search that a fast model would finish in seconds;
  • handing a delicate review to a model that is too light, getting a sloppy answer back, and having to redo the work.
model-router works like a dispatch desk: for every task handed to a helper, the grid picks a model and an effort, a quick judge decides only when no model was given, the helper works, and the outcome is measured. Models go from cheaper and quicker to dearer and deeper; effort goes from low to xhigh. 1 A task the agent hands work to a helper 2 The grid picks the model and the effort 3 A quick judge only when no model was given 4 Helper at work a subagent, on that model 5 Measured was it right the first time? what did it cost? for each start it writes one line, like this: 🔀 haiku ▰▱▱▱ low -> mechanical rename, easy to check Model: who does the work haiku sonnet opus fable cheaper and quicker dearer and deeper Effort: how hard it thinks low medium high xhigh max is never used
model-router as a dispatch desk: the grid picks model and effort for each task handed to a helper, a fast judge steps in only when no model was specified, the helper runs, and the outcome is measured.

model-router addresses this with three mechanisms:

  • The grid: a short written ruleset that lets the agent pick a model and effort deliberately before launching a helper and state why.
  • The judge: a fast classifier that catches helpers launched without an explicit model and assigns one on the fly.
  • Measurement: a local tracker that records, for every task class and model-plus-effort pair, how often work succeeds on the first try (first-pass yield) and what a successful result costs.

Illustration: tasks arriving at a dispatch point and being routed to models of different sizes

model-router splits selection rules and automatic routing into two independent layers, and the first works on its own.

  • The skill (model-router:choose-model): loads whenever the agent is about to launch a subagent, a child session, or a workflow, and exposes the grid. The agent decides before launching, passes model and effort explicitly, tags the description with the task class, and prints a one-line explanation for the choice. It works even when mods are disabled.
  • The mod (model-router): steps in when a subagent starts without a model specified, queries the judge, and applies both model and effort. It also shows the assigned values beneath every Agent call, logs decisions and outcomes locally, and enables the /model-router command. It requires mods to be enabled and Claude Code 2.1.329 or later.
When a subagent starts, the router keeps the request as it is if it already carries a model or is a fork or a resume, if its agent fixes its own model, or if routing is off; otherwise one call to the judge lowers, raises or escalates the model, and any error leaves the request unchanged. The model is set when the subagent starts, the effort on each of its requests. A subagent starts (Agent tool) Does it already carry a model? or is it a fork, or a resume? Does its agent fix its own model? or is it a plugin’s agent, or unreadable? Is routing turned off? or is a session-wide subagent model set? Keep the request goes on unchanged yesyesyes no Ask the judge one call to the fast tier, 8 s at most Lower the model confidence 0.6 or more Raise the model confidence 0.3 or more Risky work risk above 0.7, or a ! tag: deep tier, effort ≥ high It fails open: any error leaves the request unchanged. That covers a timeout and an unreadable answer too; a ! tag still goes to the deep tier. Model: set when it starts at agent.spawn Effort: set on each of its requests at each turn.step, never on the start call
What happens when a subagent launches: an explicit model, a fork, a resume, or a fixed agent model is kept; a model-less launch goes to the judge, and thresholds decide whether to lower, raise, or keep the model.

The router never overrides an explicit choice: it steps in only when no model is set, and it always honors the model and effort declared in an agent’s definition.

Launch Router behavior
Already specifies a model, or is a fork or resume Keeps it
Targets an agent whose definition pins a model, a plugin agent, or an agent with an unreadable definition Keeps it
Names an agent whose definition pins the effort (effort: in the frontmatter) Keeps that effort, even on risky work; if the definition does not pin a model, picks only the model
Runs with routing disabled or with a session-wide subagent model pinned (CLAUDE_CODE_SUBAGENT_MODEL) Keeps it
Specifies no model Queries the judge, then sets model and effort

The launch call itself is never altered. Instead, the model is applied when the subagent starts, and effort is applied to each of its model requests. Because of this design, routing works in every permission mode, including auto mode. Among built-in subagent types, only general-purpose and Explore are routed.

To keep documentation, setup, and runtime behavior from drifting apart, the grid has a single machine-readable source of truth: grid.json. The skill presents it in prose, the setup skill lists its valid values, and an automated test fails if the three ever diverge.

On every launch, the first rule in priority order that produces a value wins:

  1. Your explicit choice in the conversation.
  2. The project’s ## Model routing section, if it names that kind of work or task class.
  3. The grid.

The exception is an agent definition that pins its own model or effort: whatever the project section or the grid says, those values hold unless you specify others yourself. Only what the definition leaves unpinned gets passed in. The agent reads the frontmatter of project or user agents and, if it cannot read that frontmatter (as with a plugin agent), passes neither model nor effort.

The grid asks its questions in order and stops at the first yes: haiku for simple, repetitive work that is easy to check, sonnet when done fits in one sentence, fable for large open-ended work where judgment and accuracy both matter, opus for everything else and whenever in doubt; effort is low for a simple task, xhigh for long, hard, critical and unattended work, high when a missed mistake would be costly, medium otherwise, and never max. Every start also names one of six task classes. Model: the first fit wins Effort: the first yes wins Simple, repetitive work? easy to check, no judgment calls haiku Does done fit in one sentence? a clear, well-specified change sonnet Large and open-ended? both judgment and accuracy matter fable Everything else and whenever you are in doubt opus nonono Simple, or a quick exchange? low Long, hard and critical? and unattended: all of them xhigh Costly if a mistake slips by? money, a client, a wrong decision high None of the above max is never used medium nonono Price: cheapest first haiku < sonnet < opus < fable when in doubt, go up Task classes tag [mr:<class>], or [mr:<class>!] when risky read-search read-analyze edit-mechanical edit-specified review-debug design-open
The grid: model tiers checked in order, four effort questions asked in order, and six task classes, each with its usual choice.

Scan down the table from top to bottom and stop at the first row that fits the task:

Tier Fits when Examples
haiku Simple, repetitive work that is easy to verify and requires no judgment calls Listing or summarizing files; running a single command; renaming a symbol
sonnet The expected outcome can be stated clearly in one sentence A well-specified change across a few files; tests for existing code
fable Broad and open-ended work where judgment and precision matter (both must hold) A complex design; an architectural decision with long-term consequences
opus Everything else, and whenever you are torn between two tiers A review; debugging when the cause is unknown; most coordination work

Tier names are aliases; the concrete model behind each one depends on your setup. From cheapest to most expensive: haiku < sonnet < opus < fable.

Answer these four questions in order and stop at the first yes:

  1. Is it a simple task or a quick back-and-forth? → low
  2. Is it long, hard, and critical, and running unsupervised? (All three must hold) → xhigh
  3. Would a missed mistake cost money, a customer, or a bad decision? → high
  4. None of the above → medium

The max level is never chosen.

Every task falls into one of six fixed task classes, each paired with a usual choice:

Class Covers Usual choice
read-search Finding files, symbols, or information haiku · low
read-analyze Reading and drawing conclusions: explaining, comparing, summarizing sonnet · medium
edit-mechanical Repetitive edits that are easy to verify haiku · low
edit-specified An edit whose end state fits in one sentence sonnet · medium
review-debug Reviewing, or debugging when the cause is unknown opus · medium
design-open Open-ended design where judgment matters fable · high

Put the task class at the start of the subagent description, such as [mr:read-search], or [mr:edit-specified!] when the launch is risky. That tag lets statistics classify each task.

Six practical rules round out the tables:

  • When in doubt, go up a tier. Handing work to a model that is too small costs more in rework than it saves.
  • Risk lives in the action, not the topic. Touching production, moving money, or altering unrecoverable data is risky; writing or testing code about those topics is not. A risky launch gets at least high effort and the ! marker.
  • Sessions: pick up front. Never change a session’s model once it has started.
  • Escalate one step at a time. Retry first with sharper instructions; then bump effort up one notch; finally launch at the next tier up with a handoff.
  • The coordinator’s model. A session that delegates most of the work runs on opus at medium effort, unless its own design work is complex.
  • Do it directly or delegate; continue instead of restarting. Handle a small task on files already in context right in the current session; send a follow-up on the same topic back to the subagent you already started.

Before every launch, the agent states its choice on a single line containing the 🔀 symbol, model, four-bar effort meter, effort level, and a reason in under twelve words:

🔀 opus ▰▰▰▱ high -> review with unknown cause, going up
🔀 haiku ▰▱▱▱ low -> mechanical rename, easy to check

With the mod enabled, the same line appears in color beneath every Agent call, showing what the subagent received and why (explicit, fixed, judge: <class>; lowered from opus / raised from / kept, judge: risky work; raised from <tier>, or keep: <why>). In the Claude desktop app, it renders as a plain-text line in the app’s native colors: Routed to Haiku · low followed by the reason.

Three Agent calls, each with a colored 🔀 line underneath showing model, effort meter, effort, and reason

Model in bold, colored by tier; meter and effort colored by intensity, from green for low to red for xhigh; reason dimmed. Demo data

When a subagent launches without a model and does not match any of the keep-as-is cases above, it needs quick classification before starting work. That job belongs to the judge, an internal classifier inside the mod that you never call directly.

The judge reads the subagent type, its short description and the task as data, with a prompt generated from grid.json, and makes one call to the fast tier at low effort, within 300 tokens and 8 seconds. It answers one JSON object; the model changes only when the answer is confident enough, risky work goes to the deep tier with at least high effort, and effort is never max. The model is set at agent.spawn, the effort on every request, and the decision is logged. Any error leaves the start unchanged, and every threshold is an option. 1 Input the subagent type its short description the task itself, cut at 4,000 characters passed as data: the judge is told not to obey it 2 Prompt generated from grid.json: the three tiers, the four effort questions, the six task classes, and: risk is about the act fast · balanced · frontier · deep 3 One judge call to the fast tier, at low effort, within 300 tokens and 8 seconds 4 It answers with one JSON object { tier, confidence, effort, effort_confidence, risky, class } 5 Model rules Lower it only at confidence ≥ 0.6 Raise it at confidence ≥ 0.3 Risky above 0.7, or a ! tag: the deep tier, with effort at least high With no confidence, the model never changes Current model unknown: it counts as raising Effort rules Set when effort_confidence passes the bar low needs the lowering bar (0.6) medium, high or xhigh: the raising bar (0.3) An effort the call already carries is kept Never max 6 Model at agent.spawn against the parent’s model Effort on every request at turn.step; the Agent call itself is untouched 7 Decision logged in events.jsonl Error, timeout, unreadable answer the start is left unchanged: it fails open Every threshold is an option minDowngradeConfidence minUpgradeConfidence riskThreshold · timeoutMs
The judge: a prompt built from grid.json, the task wrapped as data, a call to the fast tier with time and token caps, a JSON response, and thresholds deciding what to change.

What it receives and how the prompt is built

Section titled “What it receives and how the prompt is built”

The judge receives the subagent type, its short description, and the first 4,000 characters of the task. To guard against prompt injection, the task text is wrapped as data, any internal closing tags are escaped, and the judge is instructed not to follow instructions found inside the text.

The system prompt is generated directly from grid.json: it includes the three tiers handled by the judge (fast, balanced, deep), the four effort questions numbered 0 through 3, the six task classes, and the rule that risk depends on the action. If you edit the grid, the judge’s prompt updates automatically.

The router makes a single call to the fast tier (the fastModel option, which defaults to haiku) at low effort, with a 300-token output cap and an 8-second timeout (timeoutMs). The call runs through your session’s client like a regular subagent and counts toward your session cost.

The judge returns a single JSON object:

{ "tier": "fast | balanced | frontier | deep", "confidence": 0.0, "effort": 0, "effort_confidence": 0.0, "risky": 0.0, "class": "<class>" }

Aiming too low ruins the output; aiming too high only costs a bit more. Because of that, the decision thresholds are asymmetric:

Rule Default Why
Lowering the model requires confidence ≥ 0.6 Getting it wrong starves the task
Raising the model requires confidence ≥ 0.3 Getting it wrong only costs money
risky above threshold, or ! tag 0.7 Forces the deep tier and at least high effort, bypassing both thresholds
Missing confidence — Never changes the model in either direction

The comparison is always relative to the parent session’s model. Effort likewise changes only when effort_confidence clears the threshold (the downgrade threshold for low, the upgrade threshold for higher levels). If the call already carries an explicit effort, that value is kept, and max is never set. The frontier tier (fable) is allowed only for design-open with a confidence of at least 0.7 (minFrontierConfidence); otherwise the response counts as deep (opus). Risky work always goes to deep.

On error, the router fails open. A judge failure, timeout, or unreadable response leaves the launch untouched and logs an error. The only exception is a launch marked with !, which still gets bumped to deep. Every decision is logged with its action: downgrade, upgrade, keep, explicit, forced-risk, or error.

The defaults work well in most cases, and you can override them at two levels: per-project exceptions and global plugin options.

Project exceptions: the Model routing section

Section titled “Project exceptions: the Model routing section”

The grid stays the same everywhere; anything specific to a repository belongs in the ## Model routing section of the project’s AGENTS.md (or CLAUDE.md).

To create or update it, ask to “set up model routing for this project” or state the rule you want right away (for example, “always use opus for migrations”). model-router:setup locates your instructions file, asks about defaults and exceptions, suggests a few after scanning the repository, shows you the exact block, and writes it only after you confirm, without committing the change.

## Model routing
Defaults for `model-router:choose-model`. An explicit choice in the conversation still wins; anything not
listed here follows the grid.
- Default: the grid
- Coordinator: `opus` · `medium`
| Kind of work | Class | Model | Effort | Why |
|---|---|---|---|---|
| Database migrations | `edit-specified` | `opus` | `high` | data cannot be restored |
| Bulk renames across the codebase | `edit-mechanical` | `haiku` | `low` | checked by the compiler |

Every value must stay within the grid’s vocabulary: models haiku, sonnet, fable, opus; effort from low to xhigh; and the six task classes. If you specify an out-of-range value, setup flags it and suggests the closest valid match.

A project’s Model routing section in AGENTS.md alongside model-router options in the Claude Code configuration

A project’s ## Model routing section alongside the plugin options.

Set global options via /config or under pluginConfigs in a settings file, keyed by the installed plugin name:

{
"pluginConfigs": {
"model-router@mrbogomips": {
"options": { "reworkWindowMin": 45, "deepModel": "opus" }
}
}
}
Option Default Meaning
fastModel, balancedModel, frontierModel, deepModel haiku, sonnet, fable, opus Models mapped to the judge’s fast, balanced, frontier, and deep tiers; fastModel also runs the judge itself
minDowngradeConfidence 0.6 Confidence required to lower the model or set low effort
minUpgradeConfidence 0.3 Confidence required to raise the model or set medium, high, or xhigh effort
minFrontierConfidence 0.7 Confidence required to send a design-open task to the frontier tier; below this, or for any other class, the spawn gets deep
riskThreshold 0.7 Risk score above which a launch gets the deep tier and at least high effort
timeoutMs 8,000 Maximum wait time for the judge; once exceeded, the launch stays unchanged
routeSubagents true Turns subagent launch routing on or off altogether
measure true Records the event log and quality data
adapt false Picks based on quality data (not yet used)
halfLifeDays 30 Half-life for quality data decay, in days
projectPriorStrength 5 How many observations the user level counts for when estimating a project (not yet used)
exploreCap 0.1 Maximum share of decisions per class that can explore alternatives (not yet used)
reworkWindowMin 30 Minutes after a report within which redoing the work counts as rework
similarityThreshold 0.5 Word overlap above which two descriptions count as the same task

To turn routing off for the current session only, run /model-router off (and /model-router on to turn it back on); to disable it permanently, set routeSubagents to false.

Once routing is live, measuring whether those choices pay off without polling a second model takes objective signals drawn from everyday work. model-router collects those signals locally and scores each task only once it has enough evidence to judge how it turned out.

The mod appends events to events.jsonl in the Claude Code config folder; when a task's rework window closes its outcome is decided, compaction folds the outcomes into cells by class, tier and effort, for you and for each project, and the usage view and the report show first-pass yield, rework rate and cost per success. Nothing is written inside your repositories. 1 Events decision · spawn signal: write · tool-error prompt · stop · resume report · session-end recorded by the mod as they happen 2 events.jsonl an append-only log in the config folder 3 The rework window closes 30 minutes after the report, or when the session ends 4 Outcome success rework failure cancelled cancelled or risky tasks are not learned from 5 Compaction cells: class × tier × effort for you, and for each project a 30-day half-life ages them 6 What you see in /model-router and on the report page first-pass yield rework rate cost per success All of it lives under the Claude Code config folder (CLAUDE_CONFIG_DIR, else ~/.claude). Nothing is written inside your repositories, and nothing is sent anywhere.
From events to numbers: the mod appends events, compaction closes each task once the rework window expires, and outcomes roll up into task class × tier × effort cells for you and for each project.

The mod appends records to events.jsonl inside your Claude Code config directory, never calling external models for measurement. Each line logs one of these events:

  • decision: every routing decision;
  • spawn: every subagent launch, with type, name, and short description;
  • signal: files written by the session and subagents, failed tool calls, the next two prompts you type right after a subagent reports back, interrupts, and resumes;
  • report: each subagent’s report, complete with token counts and estimated cost;
  • session-end: when the session closes.

Every subagent launch maps to a task. Its outcome is locked in once the rework window closes (30 minutes after the subagent reports back, or at the end of the session if that comes first).

Outcome When it is assigned
success The subagent delivered its report and nothing inside the window redid its work
rework Within the window, the main session or another agent rewrote one of its files; or a similar launch of the same class followed on the same files; or the same subagent received a correction after reporting; or one of the next two prompts you typed named its files or its task
failure The subagent failed, or the parent session stopped it and redid the work
cancelled No report arrived (an unresponsive task times out after 24 hours), or the run was interrupted

Two descriptions count as “similar” when the distinct words they share make up at least half of all their distinct words (similarityThreshold), ignoring common words and the task class tag.

Outcomes roll up into task class × tier × effort cells (for example, edit-specified · sonnet · medium), maintained at two levels: user (across all your projects) and project (keyed by git remote, or by root directory if there is no remote).

  • Time decay: counts decay with a 30-day half-life (halfLifeDays), so work from a month ago carries half the weight of work from today.
  • Excluded from learning: cancelled tasks, risky tasks, tasks without a task class, tasks run on models outside the four families, and tasks with unknown effort are still logged, but left out of learning.
  • Compaction: raw events stay open until their rework window closes. Compaction finalizes expired tasks and updates aggregates at session start, whenever you open or refresh the usage view, and before generating the report. Running it repeatedly is idempotent, so no task is ever counted twice.

Each cell tracks four metrics: first-pass yield (FPY), rework rate, cost per task (engine estimate), and cost per success. First-pass yield anchors the entire system.

First-pass yield: the number behind every choice

Section titled “First-pass yield: the number behind every choice”

A cheap model that keeps getting things wrong does not save money; it makes you pay for the same job twice. First-pass yield (FPY) comes from manufacturing to measure that effect: on a production line, it tracks the share of units that come off the line good on the first run, with no rework and no scrap. At 95% FPY, one part in twenty has to be reworked or discarded, and a reworked part is never counted as a first-pass success.

model-router applies the same yardstick to subagents: every launch is a unit, and it succeeded on the first pass if nothing had to redo its work over the next half hour.

For each cell (task class × tier × effort), using time-weighted counts:

FPY = success ÷ (success + rework + failure)

  • success counts in favor; rework and failure count against.
  • cancelled tasks are left out of both sides: a task you stopped or one that never finished says nothing about how well the model fit the job.
  • Because of the 30-day half-life, FPY reflects how models perform on your work today, not months ago.

Token pricing tells you what it costs to run a task, not what it costs to get a successful one. Work that comes back broken gets paid for again in the retry, in the main session cleaning it up, and in your own time. FPY converts sticker price into the metric that matters, cost per success:

cost per successful task = cost per task ÷ FPY

Compare two cells on the same kind of work, with twenty closed tasks each:

Cell success / rework / failure FPY Cost per task Cost per success
haiku · low 5 / 12 / 3 25% $0.020 $0.080
sonnet · low 18 / 2 / 0 90% $0.050 $0.056

haiku costs less than half as much per launch, yet every good result ends up costing more because three out of four tasks come back for rework. Even that table is generous to haiku, since it leaves out the parent session’s time and your own. The reverse holds too: on a straightforward search, a small model gets it right nineteen times out of twenty, so paying for a larger one buys you nothing.

  • Color thresholds: in Overview, the FPY tile is 🟢 from 85% up, 🟡 from 70%, and 🔴 below that; the per-tier and per-effort bars use the same scale.
  • Rework rate: the complement of FPY (rework ÷ (success + rework + failure)). Together they add up to 100% minus the failure rate.
  • Weak signals (⚪): any cell with fewer than five tasks is marked weak, because 100% across two tasks is luck, not statistics.
  • Read-only classes: read-search and read-analyze are always marked weak as well. Readers do not write files, so the strongest rework signal (someone rewriting the same files right afterward) never fires, and a poor search tends to look like a success.
  • Baseline noise: if you edit a file a subagent wrote for reasons unrelated to its task, that edit still registers as rework. Across large numbers the noise evens out; on small samples it does not, which is one more reason to treat small cells as hints rather than verdicts.

Today (versions 0.2 and 0.3), FPY informs rather than drives. The adapt option is off and the router follows the grid alone. FPY powers the /model-router view, the report, and, for each task class, a recommended cell: the one with the lowest cost per success among cells with at least three tasks, never dropping below the grid on review-debug and design-open. If a recommendation consistently diverges from the grid, you can add an exception under ## Model routing.

In a planned future version, FPY will drive the choices. With adapt enabled, the router balances exploitation (using what works) and exploration (trying promising alternatives) via Thompson sampling:

  • For every cell, it maintains a range of plausible FPY values modeled as a Beta distribution: alpha grows with time-weighted successes, beta with weighted reworks and failures.
  • On each launch, it draws a plausible FPY from each candidate cell neighboring the grid, divides the cell’s cost by that draw, and picks the one with the lowest cost per success.
  • Cells backed by plenty of data draw values close to their measured FPY (a proven winner keeps winning); sparse cells produce wider draws and get tested every so often, capped at 10% of decisions per class (exploreCap).
  • With no history yet, the grid’s pick starts ahead (alpha = 2, beta = 1, an expected FPY of two thirds) compared to neighboring cells (1, 1): the grid wins until the numbers prove otherwise.
  • A fresh project inherits your user-level history weighted at five tasks (projectPriorStrength), then gradually shifts to its own data.
  • Exploration never drops below the grid for review-debug and design-open, never overrides values pinned in ## Model routing, and never touches risky launches.

Note

Why it measures first. Versions 0.2 and 0.3 stick to measurement so you can check in /model-router that the signals match how you work before handing over automatic selection.

No special configuration is needed, only five conditions in sequence:

Five steps to see your statistics: install model-router; use Claude Code 2.1.329 or later with mods turned on, because only the mod records; work as usual and let the agent start subagents; let the rework window close, 30 minutes after a subagent reports or when the session ends; then open /model-router or ask for the model-router report. A cell with fewer than five tasks is a weak signal. 1 Install model-router /plugin install model-router@mrbogomips 2 Use Claude Code 2.1.329 or later, with mods turned on Only the mod records: the skills work without it, but nothing is measured. To check: if /model-router is an unknown command, the mod is not loaded. 3 Work as usual Let the agent start subagents: each start counts as one task. 4 Let the rework window close It closes 30 minutes after a subagent reports, or when you end the session. 5 Open /model-router or ask for the model-router report ⚪ A cell with fewer than five tasks, or a read-only class, is a weak signal: read it as a hint.
Five steps to see your statistics: install, run Claude Code 2.1.329 or later with mods enabled, work normally, let the rework window close, then open /model-router or the report.
  1. Install model-router and run Claude Code 2.1.329 or later with mods enabled. Only the mod records data. If /model-router comes back as an unknown command, the mod is not loaded.
  2. Leave measure enabled (it is on by default).
  3. Work normally and let subagents run. Only subagent launches become tasks. If you write a launch by hand, include the class tag: an untagged launch that bypasses the judge ends up without a task class and is excluded from learning.
  4. Wait for the rework window to close (30 minutes after the subagent reports back, or at session end).
  5. Open /model-router or ask for the model-router report. Opening the view runs compaction for up to 3 seconds; press r to refresh.

Once your first tasks close, you can browse the numbers in the terminal, in the Claude desktop app, or in your browser. Checking metrics does not clutter the conversation or consume context: everything /model-router displays is visible only to you, and the model never reads it. Its layout adapts to where you work: in the terminal it opens an interactive view styled like Claude Code’s settings; in the Claude desktop app it inserts a card into the conversation, styled like the app’s built-in /stats and /context cards.

Command What it does
/model-router Opens the usage view (or the card in the desktop app) on Overview, last 7 days, all projects
/model-router [overview|models|classes|decisions|savings] [24h|7d|30d|all] [user|project] Opens directly on the specified view, time window, and level, in any order
/model-router on, off Turns routing on or off for the current session
/model-router report In the terminal, builds the HTML report page, opens it in your default browser, and prints its path; in the desktop app, opens the card on the Trend view
/model-router log In the terminal, opens the event log (events.jsonl) in your system’s default app and prints its path; in the desktop app, opens the card on the Log view
/model-router help Lists arguments and keyboard shortcuts

The view has four tabs, a time window (24h, 7d, 30d, all), and an observation level (user or project). The Overview tab leads with four summary tiles:

  • FPY: 🟢 from 85%, 🟡 from 70%, 🔴 below;
  • Cost per success: 🟢 cheaper or 🔴 pricier than the previous window;
  • Rework: 🟢 up to 10%, 🟡 up to 25%, 🔴 above;
  • Routed launches: ↓ downgrades, ↑ upgrades, = kept.

Any tile backed by fewer than five tasks displays ⚪ weak, meaning there is too little data to draw conclusions.

Keyboard shortcuts work as soon as the view opens: Tab and Shift+Tab switch tabs, ↓ and ↑ cycle through time windows, d w m a jump straight to one, p toggles between user and project level, o opens the report, l opens the event log, r refreshes, and Esc closes.

/model-router help: usage view arguments and keyboard shortcuts

/model-router help.

No panel opens next to the chat and no browser page opens uninvited: everything lives inside a single card that follows the app’s light and dark themes. The header shows first-pass yield and cost per success for the selected window; clicking the title collapses the card down to just the header and a bar splitting tasks by model. On the left, a menu switches views; on the right, two menus pick the range (all projects or this one) and the time window.

  • Overview: a 22-week daily task heatmap, headline figures, routing decisions by type, and a one-line comparison against the prior period.
  • Models: one row per model, shaded from dark blue for Opus to light blue for Haiku, showing its share of tasks; underneath, first-pass yield, cost per success, and task counts and outcomes broken down by effort level. Below that sits a daily task chart split by model.
  • Task classes and Projects: one row per task class or project, with the same metrics.
  • Decisions: router decisions grouped by type (moved to a cheaper model, moved to a stronger one, kept, or passed explicitly in the call); clicking a type shows its latest entries.
  • Savings: tells you whether routing pays off. It compares subagent costs against what the same tasks would have cost on the model of the session that started them: a one-sentence verdict, cost per success and savings, the share of tasks moved to a cheaper model along with their outcomes, weekly spend, and savings by model pair. The verdict requires at least 100 compared tasks. The same view appears as a terminal tab and as the first section of the report page.
  • Trend: weekly first-pass yield and cost per success rendered as bar charts. The bottom row links to the HTML report page.
  • Log: event log records broken down by type and over time, along with the latest entries for each type; the bottom row links to events.jsonl. Prompt text is never shown.

Only the newest card updates live as subagents deliver their reports; older cards retain their header and bar.

Overview, Models, Decisions, and the report, side by side in the terminal and the desktop app:

In the terminal, the Overview tab: status, KPI tiles, sparklines, FPY bars by tier and effort, and subagents and routing decisions from the current session

Overview: KPI tiles, sparklines, and FPY bars over the last 7 days, followed by this session’s subagents and decisions. Demo data

In the terminal, the Models tab: closed tasks, tokens, cost, FPY, and cost per success by tier and effort

Models: closed tasks, tokens, cost, FPY with bar, cost per success, and observed model IDs by tier and effort. Demo data

In the terminal, the Decisions tab: the last twelve routing decisions with action, model before and after, subagent type, and reason

Decisions: the last twelve routing decisions across all sessions (UTC); • marks ones from the current session. Demo data

The model-router report page: the Savings section with the verdict, cost per success, savings, weekly spend, and savings per model pair

Top half of the report page, opened in a browser. Demo data

The terminal’s Classes tab maps to the desktop app’s Task classes view. The event log, which opens as a file from the terminal, becomes the Log view in the desktop app:

In the desktop app, the Log view: records by type in a bar with legend, records per day, and recent records for the open type

The Log view over the last 7 days: records by type and by day, plus recent outcomes.

In the terminal, the Classes tab: grid pick, best measured cell, warnings, and cells per task class

Terminal, Classes tab: for each task class, the grid’s pick alongside the best measured cell, weak-signal markers, and individual cells (* marks the recommended one). Demo data

If you want a wider canvas, the report page shows the exact same numbers from the same aggregation, paired with weekly trends and a dedicated card per task class. It is saved to <config dir>/model-router/report.html: the terminal opens it straight in your default browser, while the desktop app links to it from the Trend view.

Install the plugin, make sure mods are enabled on Claude Code 2.1.329 or later, and start a session. Routing and measurement are on by default. Check that /model-router responds: on a fresh machine with no history yet, Overview reports that no subagents have run.

From there on, work as usual: every subagent launch prints its 🔀 line, tagged launches turn into tasks, and numbers populate as rework windows close.

Note

Why some screenshots show demo data. Real measurements on the author’s machine started on November 21, 2026, so a full week or month of live history does not exist yet. The day-one screenshots below are real; the 7-day and 30-day views are built from a demo event log and carry the Demo data badge.

Expect a handful of scored tasks. Tiles show ⚪ weak because each covers fewer than five tasks, and there is no prior window to compare against yet. The Decisions tab already lists every routing decision along with its reason.

The Overview tab after day one of real usage: a few scored tasks, weak tiles, routed launches, and session subagents

Overview after day one, real data. Any tile backed by fewer than five scored tasks shows ⚪ weak.

The Decisions tab after day one of real usage: recent routing decisions with action, model before and after, and reason

Decisions after day one, real data: what the router did on every launch and why.

Tiles show solid numbers once they cross five tasks, and starting in week two you also get deltas against the previous week. The Classes tab fills out as the first cells clear the three-task mark needed to surface a recommendation.

The Overview tab over seven days: KPI tiles with week-over-week deltas, daily sparklines, and FPY bars by tier and effort

Overview over the last 7 days. Demo data: live measurements on the author’s machine began on November 21, 2026.

Numbers settle down as cells accumulate more tasks, and the 30-day half-life starts taking effect, so work from a month ago now carries half weight. This is the right point to review recommendations that diverge from the grid and decide whether to add project exceptions under ## Model routing.

The Overview tab over thirty days: KPI tiles, three-day bucket sparklines, and FPY bars

Overview over the last 30 days; sparklines bucket data into three-day intervals. Demo data.

The Classes tab over thirty days: grid pick, best measured cell, and recommendations diverging from the grid per task class

Classes over the last 30 days, highlighting recommendations that differ from the grid. Demo data.

Press p inside the view to toggle between the two observation levels:

  • User level: aggregates your data across every project, gives you the broadest picture, and fills up fastest.
  • Project level: isolates work on the current repository (identified by git remote or root directory). Samples are smaller, though they tell you whether the grid fits this specific codebase.

If project level looks empty, your history was logged under a different directory or remote.

The Classes tab at project level for the product repository over thirty days

Project level: Classes for the product repository over 30 days. Demo data

The Classes tab at user level over thirty days

User level: Classes over 30 days across all projects. Demo data

The plugin never sends anything it measures off your machine. Every file stays local under model-router/ inside your active config directory (CLAUDE_CONFIG_DIR, or ~/.claude otherwise):

  • the event log (events.jsonl), which stores the first 2,000 characters of the two prompts you type after a subagent’s report within the rework window, and no other prompts;
  • the options used during compaction;
  • user and project aggregates;
  • the HTML report page.

Nothing is ever written inside your repositories. The only outbound call is the judge request on each routed launch, which goes to your model provider just like any other request in your session. To stop logging, set measure: false; to wipe your history, delete <config dir>/model-router/.

The current version has four limitations worth keeping in mind:

  • Only launches made through the Agent tool are routed; plugin-internal agents and workflow agents are measured, not routed.
  • The router picks fable only for design-open and, through version 0.3, does not enforce the grid’s floor on review-debug and design-open.
  • Costs are engine estimates; edits made outside the session’s tools are not detected.
  • For now, metrics are measured but not used to make decisions. Adaptive selection based on quality data is planned for a future release.