model-router

Choosing the right model for every subagent, child session, or workflow agent shouldn't be guesswork. model-router applies a single written grid, routes launches that don't specify a model on the fly, and measures on your machine how well each choice actually paid off.

In plain terms

When Claude Code delegates part of the work to a subagent, it spins up 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:

  • burning 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's 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 tackles this with three complementary mechanisms:

  • The grid: a short written ruleset that lets the agent make a principled choice 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 good result actually costs.
Illustration: tasks arriving at a dispatch point and being routed to models of different sizes

Let's look at how the plugin's two layers put this flow into practice.

How it works

model-router splits selection rules and automatic routing into two independent layers β€” the first works well 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. 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. Requires mods 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 only steps in when no model is set, and it always honors the model and effort declared in an agent's definition.

LaunchRouter behavior
Already specifies a model, or is a fork or resumeKeeps it
Targets an agent whose definition pins a model, a plugin agent, or an agent with an unreadable definitionKeeps 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 modelQueries the judge, then sets model and effort

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

Next, let's look at the criteria behind the grid.

The grid: how choices are made

To keep documentation, setup, and runtime behavior from drifting apart over time, 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 stick 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 check itβ€”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.

Model tiers

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

TierFits whenExamples
haikuSimple, repetitive work that is easy to verify and requires no judgment callsListing or summarizing files; running a single command; renaming a symbol
sonnetThe expected outcome can be stated clearly in one sentenceA well-specified change across a few files; tests for existing code
fableBroad and open-ended work where judgment and precision truly matter (both must hold)A complex design; an architectural decision with long-term consequences
opusEverything else, and whenever you're torn between two tiersA 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.

Effort

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.

Task classes

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

ClassCoversUsual choice
read-searchFinding files, symbols, or informationhaiku Β· low
read-analyzeReading and drawing conclusions: explaining, comparing, summarizingsonnet Β· medium
edit-mechanicalRepetitive edits that are easy to verifyhaiku Β· low
edit-specifiedAn edit whose end state fits in one sentencesonnet Β· medium
review-debugReviewing, or debugging when the cause is unknownopus Β· medium
design-openOpen-ended design where judgment mattersfable Β· 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 is what lets statistics classify each task.

Rules around the grid

Six practical rules round out the tables:

  • When in doubt, go up a tier. Handing work to a model that's 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, don't restart. 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 β€” 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 actually got 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 clean 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
In the Claude desktop app, Agent calls each followed by a muted line: Routed to, model and effort, reason
In the desktop app, the line spells out model, effort, and reason in plain text, without custom symbols or colors.

So far we've covered choices made up front. What happens when a subagent launches with no model specified at all? That's where the judge comes in.

How the judge works

When a model-less launch arrives and doesn't match any of the keep-as-is cases, it needs quick classification before the subagent starts working. 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

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 explicitly 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 call and the response

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>" }

How the router decides

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

RuleDefaultWhy
Lowering the model requires confidence β‰₯0.6Getting it wrong starves the task
Raising the model requires confidence β‰₯0.3Getting it wrong only costs money
risky above threshold, or ! tag0.7Forces the deep tier and at least high effort, bypassing both thresholds
Missing confidenceβ€”Never changes the model in either direction

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. Finally, the frontier tier (fable) is only allowed 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.

When it fails

On error, the router fails open. A judge failure, timeout, or unreadable response leaves the launch untouched and logs an error β€” except when a launch is 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, though every repository has its own exceptions β€” here is how to configure them.

Configuration

You can customize model-router at two distinct levels: per-project exceptions and global plugin options.

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 explicitly confirm β€” without committing.

## 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.

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" }
    }
  }
}
OptionDefaultMeaning
fastModel, balancedModel, frontierModel, deepModelhaiku, sonnet, fable, opusModels mapped to the judge's fast, balanced, frontier, and deep tiers; fastModel also runs the judge itself
minDowngradeConfidence0.6Confidence required to lower the model or set low effort
minUpgradeConfidence0.3Confidence required to raise the model or set medium, high, or xhigh effort
minFrontierConfidence0.7Confidence required to send a design-open task to the frontier tier; below this, or for any other class, the spawn gets deep
riskThreshold0.7Risk score above which a launch gets the deep tier and at least high effort
timeoutMs8,000Maximum wait time for the judge; once exceeded, the launch stays unchanged
routeSubagentstrueTurns subagent launch routing on or off altogether
measuretrueRecords the event log and quality data
adaptfalsePicks based on quality data (not used yet)
halfLifeDays30Half-life for quality data decay, in days
projectPriorStrength5How many observations the user level counts for when estimating a project (not yet used)
exploreCap0.1Maximum share of decisions per class that can explore alternatives (not yet used)
reworkWindowMin30Minutes after a report within which redoing the work counts as rework
similarityThreshold0.5Word overlap above which two descriptions count as the same task

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

Once routing is live, the real question is whether those choices are paying off on your actual work. Here is how model-router turns session events into statistics.

How statistics are collected

Measuring subagent quality 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.

1. Events

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.

2. Tasks and outcomes

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.

OutcomeWhen it is assigned
successThe subagent delivered its report and nothing inside the window redid its work
reworkWithin 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 was sent a correction after reporting; or one of the next two prompts you typed named its files or its task
failureThe subagent failed, or the parent session stopped it and redid the work
cancelledNo 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.

3. Cells, decay, and compaction

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 isn't one).

  • 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, just excluded from 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 β€” 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 successful task. One of those four anchors the entire system β€” let's see why.

First-pass yield: the number behind every choice

A cheap model that keeps getting things wrong doesn't save money β€” it makes you pay for the same job twice. First-pass yield (FPY) comes out of manufacturing to measure exactly that: 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 thrown out β€” and nobody counts a reworked part 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.

How it is calculated

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.

Why FPY instead of sticker price

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 number that actually matters, cost per successful task:

cost per successful task = cost per task Γ· FPY

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

Cellsuccess / rework / failureFPYCost per taskCost per successful task
haiku Β· low5 / 12 / 325%$0.020$0.080
sonnet Β· low18 / 2 / 090%$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, since it leaves out the parent session's time and your own. The flip side holds too: on a straightforward search, a small model nails it nineteen times out of twenty, so paying for a bigger one buys you nothing.

How to read it

  • 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 flip side 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 β€” 100% across two tasks is luck, not statistics.
  • Read-only classes: read-search and read-analyze are always marked weak as well. Readers don't 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 doesn't, which is one more reason to treat small cells as hints rather than verdicts.

How the router uses it

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 successful task 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 decide to 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.

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

Now that you know how to read the numbers, here are the five steps to get them showing up on your machine.

Getting statistics to show up

No special configuration is needed, just 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 isn't loaded.
  2. Leave measure enabled (it's 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.

The usage view and the report

Checking metrics doesn't clutter the conversation or burn context: everything /model-router displays is visible only to you, and the model never reads it. Its shape 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 drops a card into the conversation, styled just like the app's built-in /stats and /context cards.

CommandWhat it does
/model-routerOpens 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, offTurns routing on or off for the current session
/model-router reportIn 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 logIn 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 helpLists arguments and keyboard shortcuts

In the terminal

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 β€” 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.

In the desktop app

No panel opens next to the chat and no browser page pops up 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 turn in their reports; older cards retain their header and bar.

The same views across both environments

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 desktop app, the Model routing card on Overview: daily task heatmap, headline numbers, and routing decisions
The card on Overview, featuring the daily task heatmap.
In the terminal, the Models tab: closed tasks, tokens, cost, FPY, and cost per successful task by tier and effort
Models: closed tasks, tokens, cost, FPY with bar, cost per successful task, and observed model IDs by tier and effort. Demo data
In the desktop app, the Models view: one row per model with task share, effort breakdown, and daily tasks split by model
Models: one row per model plus daily tasks broken down by model.
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
In the desktop app, the Decisions view: a bar split by decision type, legend, and recent decisions for the open type
Decisions: breakdown by type, with recent entries for the open type.
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
In the desktop app, the Trend view: weekly first-pass yield and cost per success as bars, with a link to the report page
The Trend view, linking to the report page on the bottom row.

The terminal's Classes tab maps to the desktop app's Task classes view. And 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.

To see how these views fill in over real work, let's trace what happens from day one through the first month.

A real session

Getting started

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 right out of the box. Check that /model-router responds: on a fresh machine with no history yet, Overview will report that no subagents have run.

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

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 doesn't 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.

After one day

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.

After seven days Demo data

Tiles light up with 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.

After a month Demo data

Numbers settle down as cells accumulate more tasks, and the 30-day half-life starts doing its job β€” 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.

A single project or everything you do

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

Two practical topics remain before you dive in: where your data lives, and what the current version's limitations are.

Privacy

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 β€” the judge request on each routed launch β€” 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/.

Limitations

Four limitations of the current version 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 only picks fable 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, data is only measured, not used to make decisions. Adaptive selection based on quality data is planned for a future release.