Skip to content

Routing modes ​

Routing modes let you pick how hard the plugin holds subagents to cheaper models. The skill already advises Claude which tier to use; a mode turns that advice into a check that runs before every Agent or Task dispatch and refuses what the mode does not allow. The refusal names what was missing, Claude fixes the dispatch and sends it again. The plugin itself never dispatches anything.

The mode is one setting per machine: it lives in config.json in the plugin's data directory and applies to every session at its next dispatch. The default is quality, which checks nothing, so no dispatch is refused until you pick another mode.

The check runs in the plugin's mod, in the agent.spawn hook, so it needs Claude Code 2.1.287 or later (see Install). On a version without mods nothing is checked and nothing is refused. A resumed agent and the agents a workflow script starts are never checked, redirected or given the default.

What each mode means ​

quality ​

Nothing is checked. Any agent may run on opus without a reason. Options that are not part of the check still apply: a redirect you configured, and bareDispatch: "deny", see Configuration.

Use it when the result matters more than the bill, for a hard debugging day, or while you are trying the plugin out.

balanced ​

Opus stays available, but each use needs a stated reason:

  • general-purpose, Explore and implementer (matched by name, with or without a plugin prefix), on opus or fable need an [opus: ...] tag;
  • model-routing:reviewer with model sonnet or haiku is refused when the session runs on a higher model (on an opus session a sonnet reviewer is refused; on a sonnet session it is fine).

In every mode but quality, a general-purpose or Explore dispatch with no model on a session above sonnet (above haiku for Explore) is refused with the advice to pass sonnet or haiku, unless bareDispatch is "off" or the agent is in exempt; see Configuration.

Use it for everyday work on a strong session model.

economy ​

Everything in balanced, and the opus model-routing:reviewer is kept for the final branch review: a reviewer dispatch needs [final], and per-task reviews go to task-reviewer (sonnet).

Use it when many runs go in parallel, or the weekly limit is getting close.

strict ​

Everything in economy, and opus is allowed only for work where a mistake costs more than the tokens: [opus: security], [opus: money] or [opus: migration]. [opus: asked], [opus: retry] and [opus: concurrency] are refused, so a weak sonnet result is retried on sonnet with a better brief.

Use it when the weekly limit is nearly used up.

Summary ​

qualitybalancedeconomystrict
Opus on general-purpose, Explore or implementerfreewith any tagwith any tagsecurity, money, migration only
reviewer on sonnet or haiku, below the session modelallowedrefusedrefusedrefused
reviewer without [final]allowedallowedrefusedrefused
bare general-purpose or Explore with no model, above sonnetallowed (refused with bareDispatch: "deny")refusedrefusedrefused
redirectenforcedenforcedenforcedenforced

With the power switch off (isOn: false) no check runs in any mode. Other agents (task-reviewer, test-runner, scout, fork, pinned agents and agents from other plugins) are never refused by a mode, unless a redirect names them. implementer and reviewer are matched by name without the plugin prefix, so a user agent called implementer, for example one reached through a redirect, is checked like this plugin's.

Stating a reason: tags ​

Outside quality, an opus dispatch carries its reason as a tag in the dispatch description (the first 300 characters of the prompt count too, and tags are case-insensitive):

TagMeaningAccepted in
[opus: security], [opus: money], [opus: migration]High-risk work where a mistake costs more than the tokensbalanced, economy, strict
[opus: asked]You asked for opusbalanced, economy
[opus: concurrency]Locking, races, orderingbalanced, economy
[opus: retry]A sonnet attempt came back weakbalanced, economy
[final]The final branch review by reviewerneeded in economy and strict

A dispatch described as [opus: migration] backfill order totals with model: "opus" passes in every mode. fix the login form with model: "opus" is refused outside quality and goes out again on sonnet.

The refusal text ​

text
model-routing: <agent> with model=<model> in routing mode '<mode>' needs a stated reason: add [opus: asked], [opus: retry], [opus: security], [opus: money], [opus: migration] or [opus: concurrency] to the description. Otherwise drop model or pass model=sonnet. Change the routing mode or turn routing off with the buttons above the prompt.
text
model-routing: routing mode '<mode>': <agent> (opus) is for final branch reviews only - add [final] to the description, or use model-routing:task-reviewer for a per-task review. Change the routing mode or turn routing off with the buttons above the prompt.

The band ​

Two rows above the prompt show and switch the mode:

text
routing [on]  [economy] [balanced] [strict] [quality]  [auto]
model-routing: 3 opus, 3 sonnet - API $4.58 vs $2.42 at parent - 5h 12% - week 41%
  • on / off turns every check on this page off and back on, keeping the chosen mode.
  • A mode button switches the mode at once; the next dispatch in every open session on the machine follows it.
  • auto turns on the auto-switch.
  • Row 2 is the session's cost line, then the Claude 5-hour and weekly limits (hidden with showStats: false). Each limit appears once a reading for it has arrived, so the 5-hour one can be missing while the weekly one shows.

The buttons write config.json; you can also edit the file by hand, see Configuration.

Where the band shows ​

WhereBandMode checks
Claude Code in a terminal (CLI)yesyes
VS Code extensionyesyes
Claude desktop appyesyes
Claude mobile appyesyes
Headless runs (claude -p)no, there is no prompt to draw aboveyes, the mode from config.json applies

To change the mode for scripted runs, edit config.json or press a button in any interactive session on the same machine.

Auto-switch ​

With auto on, the mode follows the Claude weekly limit: from 80% it tightens to economy, from 90% to strict, and after the weekly reset it returns to the mode you picked. It only ever tightens, never loosens below your choice, never turns routing back on when you switched it off, and changes nothing until the session's first weekly reading has arrived.

Redirect ​

redirect sends dispatches of one agent type to another, for example to your own implementer instead of this plugin's:

json
{
  "mode": "economy",
  "redirect": { "model-routing:implementer": "implementer" }
}

A redirected dispatch is rewritten to the target before the checks run, so the target is judged by the active mode. Redirects apply in every mode while routing is on. A chain is followed to its end, and a chain that loops back redirects nothing. A key without a colon matches the agent's name after the last colon; a key with a colon matches that exact agent type.

Fallback agents ​

fallback lists the agents a refused opus dispatch may go to instead, in the order you prefer them. Any subagent type works, including agents from other plugins:

json
{
  "mode": "strict",
  "fallback": ["implementer", "codex:codex-rescue"]
}

When a mode refuses an opus general-purpose, Explore or implementer dispatch, the refusal names the list and Claude can pick one: Or hand it to: implementer, codex:codex-rescue.. The list leaves out the refused agent itself and any agent that is itself redirected. Other refusals do not mention it. With an empty list, refusals suggest sonnet only.

MIT License.