@alexeiled/claude-router 1.22.0 → 1.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 602 496" role="img" aria-labelledby="title desc">
2
2
  <title id="title">Router pane, Now tab</title>
3
- <desc id="desc">NEXT TURN: the tier meter, model and activity, the reason with the classifier support it weighed and the switch cost, and one pin per tier, low to high, with its support. PLAN: the 5-hour and 7-day windows with their resets. SESSION: the total of the main thread and one running subagent as API value, the difference against unrouted, the main thread and the subagents as bars on one scale, and a strip of every reply colored by tier with the replies per tier. CONTEXT: the window fill and the cache reuse.</desc>
3
+ <desc id="desc">NEXT TURN: the tier meter, model and activity, the reason with the classifier support it weighed and the switch cost, and one pin per tier, low to high, with its support. PLAN: the 5-hour and 7-day windows with their resets. SESSION: the total of the main thread and one running subagent as a configured-rate API estimate, the difference against unrouted, the main thread and the subagents as bars on one scale, and a strip of every reply colored by tier with the replies per tier. CONTEXT: the window fill and the cache reuse.</desc>
4
4
  <style>
5
5
  text { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13px; }
6
6
  .cap { font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 12px; fill: #9a988f; }
@@ -59,9 +59,9 @@
59
59
  <text x="78.6" y="281" fill="#7c7c7c" xml:space="preserve"> since 14:18 · 86 replies · 6 agents · 9 switches</text>
60
60
  <text x="468.6" y="281" fill="#d7af5f" xml:space="preserve"> ● 1 running</text>
61
61
  <text x="39.6" y="300" fill="#d0d0d0" font-weight="700" xml:space="preserve">≈$8.97</text>
62
- <text x="86.4" y="300" fill="#7c7c7c" xml:space="preserve"> API value · plan quota, not billed </text>
63
- <rect x="382.8" y="286" width="70.2" height="18" rx="4" fill="#2e3340"/>
64
- <text x="382.8" y="300" fill="#d0d0d0" xml:space="preserve">[ Usage ]</text>
62
+ <text x="86.4" y="300" fill="#7c7c7c" xml:space="preserve"> API estimate · plan quota, not a charge </text>
63
+ <rect x="421.8" y="286" width="70.2" height="18" rx="4" fill="#2e3340"/>
64
+ <text x="421.8" y="300" fill="#d0d0d0" xml:space="preserve">[ Usage ]</text>
65
65
  <text x="39.6" y="319" fill="#6fcf97" font-weight="700" xml:space="preserve">−$4.09 (−31%)</text>
66
66
  <text x="141.0" y="319" fill="#d0d0d0" xml:space="preserve"> vs unrouted</text>
67
67
  <text x="234.6" y="319" fill="#7c7c7c" xml:space="preserve"> ≈$13.06</text>
@@ -1,12 +1,12 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 649 1085" role="img" aria-labelledby="title desc">
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 649 1104" role="img" aria-labelledby="title desc">
2
2
  <title id="title">Router pane, Usage tab, What if</title>
3
3
  <desc id="desc">This session by tier, with What if: the same tokens on Haiku 5.5, Sonnet 5.5 and Opus 5.5 alone against what routing spent.</desc>
4
4
  <style>
5
5
  text { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13px; }
6
6
  .cap { font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 12px; fill: #9a988f; }
7
7
  </style>
8
- <rect width="649" height="1085" rx="8" fill="#1c1c1c"/>
9
- <rect x="10" y="10" width="629" height="1065" rx="6" fill="none" stroke="#3f5f8f"/>
8
+ <rect width="649" height="1104" rx="8" fill="#1c1c1c"/>
9
+ <rect x="10" y="10" width="629" height="1084" rx="6" fill="none" stroke="#3f5f8f"/>
10
10
  <text x="24.0" y="34" fill="#5fafd7" font-weight="700" xml:space="preserve">ROUTER</text>
11
11
  <rect x="86.4" y="20" width="62.4" height="18" rx="4" fill="#87afff"/>
12
12
  <text x="86.4" y="34" fill="#0d1016" font-weight="700" xml:space="preserve">[ ◉ on ]</text>
@@ -59,7 +59,7 @@
59
59
  <text x="289.2" y="262" fill="#f0b429" xml:space="preserve"> +$0.08</text>
60
60
  <text x="406.2" y="262" fill="#7c7c7c" xml:space="preserve"> ≈$2.44</text>
61
61
  <text x="24.0" y="281" fill="#7c7c7c" xml:space="preserve">─────────────────────────────────────────────────────────────</text>
62
- <text x="24.0" y="300" fill="#d0d0d0" font-weight="700" xml:space="preserve">session · ≈ API value</text>
62
+ <text x="24.0" y="300" fill="#d0d0d0" font-weight="700" xml:space="preserve">session · API estimate</text>
63
63
  <text x="226.8" y="300" fill="#d0d0d0" font-weight="700" xml:space="preserve"> ≈$8.97</text>
64
64
  <text x="289.2" y="300" fill="#6fcf97" font-weight="700" xml:space="preserve"> −$4.09</text>
65
65
  <text x="406.2" y="300" fill="#7c7c7c" xml:space="preserve"> ≈$13.06</text>
@@ -163,9 +163,10 @@
163
163
  <text x="320.4" y="908" fill="#d0d0d0" xml:space="preserve"> ≈$0.33</text>
164
164
  <text x="390.6" y="908" fill="#7c7c7c" xml:space="preserve"> your model</text>
165
165
  <text x="24.0" y="946" fill="#7c7c7c" xml:space="preserve"> ■ moved by the router · □ Claude Code’s pick · color: the model</text>
166
- <text x="24.0" y="965" fill="#7c7c7c" xml:space="preserve"> vs CC: the same tokens on Claude Code’s pick, at list prices</text>
167
- <text x="24.0" y="1003" fill="#7c7c7c" xml:space="preserve"> $ = tokens × list prices · ≈ = API value of plan quota</text>
168
- <text x="24.0" y="1022" fill="#7c7c7c" xml:space="preserve"> answer quality not measured</text>
169
- <rect x="24.0" y="1046" width="140.4" height="18" rx="4" fill="#2e3340"/>
170
- <text x="24.0" y="1060" fill="#7c7c7c" xml:space="preserve">[ Delete history ]</text>
166
+ <text x="24.0" y="965" fill="#7c7c7c" xml:space="preserve"> vs CC: the same tokens on Claude Code’s pick, at configured API rates</text>
167
+ <text x="24.0" y="1003" fill="#7c7c7c" xml:space="preserve"> ≈$ = tokens × configured API rates (list/custom)</text>
168
+ <text x="24.0" y="1022" fill="#7c7c7c" xml:space="preserve"> not invoices or measured quota savings</text>
169
+ <text x="24.0" y="1041" fill="#7c7c7c" xml:space="preserve"> answer quality not measured</text>
170
+ <rect x="24.0" y="1065" width="140.4" height="18" rx="4" fill="#2e3340"/>
171
+ <text x="24.0" y="1079" fill="#7c7c7c" xml:space="preserve">[ Delete history ]</text>
171
172
  </svg>
@@ -1,12 +1,12 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 758 1123" role="img" aria-labelledby="title desc">
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 758 1142" role="img" aria-labelledby="title desc">
2
2
  <title id="title">Router pane, Usage tab</title>
3
3
  <desc id="desc">The last 7 days across sessions: the period row, the difference against unrouted first, then a cost table whose rows add up (the main thread with its cheaper-model saving and cache rebuilds, the subagents, the total) with each row against unrouted, the replies and tokens, the cost by activity with code opened to its routes and cost parts, the cost by day, what is worth a look with a link to Routes, subagents, and Delete history.</desc>
4
4
  <style>
5
5
  text { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13px; }
6
6
  .cap { font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 12px; fill: #9a988f; }
7
7
  </style>
8
- <rect width="758" height="1123" rx="8" fill="#1c1c1c"/>
9
- <rect x="10" y="10" width="738" height="1103" rx="6" fill="none" stroke="#3f5f8f"/>
8
+ <rect width="758" height="1142" rx="8" fill="#1c1c1c"/>
9
+ <rect x="10" y="10" width="738" height="1122" rx="6" fill="none" stroke="#3f5f8f"/>
10
10
  <text x="24.0" y="34" fill="#5fafd7" font-weight="700" xml:space="preserve">ROUTER</text>
11
11
  <rect x="86.4" y="20" width="62.4" height="18" rx="4" fill="#87afff"/>
12
12
  <text x="86.4" y="34" fill="#0d1016" font-weight="700" xml:space="preserve">[ ◉ on ]</text>
@@ -58,7 +58,7 @@
58
58
  <text x="289.2" y="262" fill="#6fcf97" xml:space="preserve"> −$0.51</text>
59
59
  <text x="406.2" y="262" fill="#7c7c7c" xml:space="preserve"> ≈$6.11</text>
60
60
  <text x="24.0" y="281" fill="#7c7c7c" xml:space="preserve">─────────────────────────────────────────────────────────────</text>
61
- <text x="24.0" y="300" fill="#d0d0d0" font-weight="700" xml:space="preserve">7 days · ≈ API value</text>
61
+ <text x="24.0" y="300" fill="#d0d0d0" font-weight="700" xml:space="preserve">7 days · API estimate</text>
62
62
  <text x="226.8" y="300" fill="#d0d0d0" font-weight="700" xml:space="preserve"> ≈$20.93</text>
63
63
  <text x="289.2" y="300" fill="#6fcf97" font-weight="700" xml:space="preserve"> −$12.29</text>
64
64
  <text x="406.2" y="300" fill="#7c7c7c" xml:space="preserve"> ≈$33.22</text>
@@ -180,9 +180,10 @@
180
180
  <text x="320.4" y="946" fill="#d0d0d0" xml:space="preserve"> ≈$0.12</text>
181
181
  <text x="390.6" y="946" fill="#7c7c7c" xml:space="preserve"> its agent file sets it</text>
182
182
  <text x="24.0" y="984" fill="#7c7c7c" xml:space="preserve"> ■ moved by the router · □ Claude Code’s pick · color: the model</text>
183
- <text x="24.0" y="1003" fill="#7c7c7c" xml:space="preserve"> vs CC: the same tokens on Claude Code’s pick, at list prices</text>
184
- <text x="24.0" y="1041" fill="#7c7c7c" xml:space="preserve"> $ = tokens × list prices · ≈ = API value of plan quota</text>
185
- <text x="24.0" y="1060" fill="#7c7c7c" xml:space="preserve"> answer quality not measured</text>
186
- <rect x="24.0" y="1084" width="140.4" height="18" rx="4" fill="#2e3340"/>
187
- <text x="24.0" y="1098" fill="#7c7c7c" xml:space="preserve">[ Delete history ]</text>
183
+ <text x="24.0" y="1003" fill="#7c7c7c" xml:space="preserve"> vs CC: the same tokens on Claude Code’s pick, at configured API rates</text>
184
+ <text x="24.0" y="1041" fill="#7c7c7c" xml:space="preserve"> ≈$ = tokens × configured API rates (list/custom)</text>
185
+ <text x="24.0" y="1060" fill="#7c7c7c" xml:space="preserve"> not invoices or measured quota savings</text>
186
+ <text x="24.0" y="1079" fill="#7c7c7c" xml:space="preserve"> answer quality not measured</text>
187
+ <rect x="24.0" y="1103" width="140.4" height="18" rx="4" fill="#2e3340"/>
188
+ <text x="24.0" y="1117" fill="#7c7c7c" xml:space="preserve">[ Delete history ]</text>
188
189
  </svg>
@@ -3,11 +3,11 @@
3
3
  One setting trades cost against answer quality: `cost`, `balanced` (the default) or `quality`. The classifier and
4
4
  your routes stay as they are. The mode moves the route each tier runs by one fixed step.
5
5
 
6
- | Mode | What changes |
7
- | --- | --- |
8
- | `cost` | A cheaper route where the turn allows it: the tier below when that tier runs a model with a lower input price (at `low`, the `low` route without its activity override), else one effort level less on the same model. `high` keeps its model and drops one effort level. Never below `low`. |
9
- | `balanced` | Nothing: every tier runs its route as configured. |
10
- | `quality` | One effort level more on the same model, else the route of the tier above. |
6
+ | Mode | What changes |
7
+ | ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
8
+ | `cost` | A cheaper route where the turn allows it: the tier below when that tier runs a model with a lower input price (at `low`, the `low` route without its activity override), else one effort level less on the same model. `high` keeps its model and drops one effort level. Never below `low`. |
9
+ | `balanced` | Nothing: every tier runs its route as configured. |
10
+ | `quality` | One effort level more on the same model, else the route of the tier above. Haiku 5.5 automatically prefers High, except medium bounded ops may use Xhigh. Explicit higher efforts stay supported. |
11
11
 
12
12
  In every mode:
13
13
 
@@ -73,7 +73,9 @@ keys are allowed, and the result must pass the same checks as `policy`.
73
73
  ## Every decision
74
74
 
75
75
  The route each mode gives a session's first turn, for each classifier answer, through the router's real decision
76
- path. Generated from the test data by `npm run docs:modes`; `test/mode-matrix.test.mjs` fails when it is stale.
76
+ path. Here `ops` means an accepted bounded `execute` phase; `ops + reason` instead uses the same-tier `debug` row,
77
+ and `ops + produce` uses `code`. Unclear/report phases do not introduce a new ops discount (see [Activity routing](activity-routing.md)).
78
+ Generated from the test data by `npm run docs:modes`; `test/mode-matrix.test.mjs` fails when it is stale.
77
79
 
78
80
  <!-- mode-matrix:start -->
79
81
  **Built-in routes**
@@ -82,13 +84,13 @@ path. Generated from the test data by `npm run docs:modes`; `test/mode-matrix.te
82
84
  | --- | --- | --- | --- | --- |
83
85
  | micro | code, debug, explore, plan, review, ops, docs, uncertain | Haiku · medium | Haiku · medium | Haiku · medium |
84
86
  | low | code, debug, plan, review | Haiku · high | Sonnet · high | Sonnet · xhigh |
85
- | low | explore, ops, docs, uncertain | Haiku · medium | Haiku · high | Haiku · xhigh |
87
+ | low | explore, ops, docs, uncertain | Haiku · medium | Haiku · high | Haiku · high |
86
88
  | medium | code, debug, plan, review | Sonnet · high | Opus · medium | Opus · high |
87
89
  | medium | explore, docs, uncertain | Haiku · high | Opus · medium | Opus · high |
88
90
  | medium | ops | Haiku · medium | Haiku · high | Haiku · xhigh |
89
91
  | high | code, debug, explore, plan, review, ops, docs, uncertain | Opus · high | Opus · xhigh | Opus · max |
90
92
  | uncertain | code, debug, plan, review | Haiku · high | Sonnet · high | Sonnet · xhigh |
91
- | uncertain | explore, ops, docs, uncertain | Haiku · medium | Haiku · high | Haiku · xhigh |
93
+ | uncertain | explore, ops, docs, uncertain | Haiku · medium | Haiku · high | Haiku · high |
92
94
 
93
95
  **`routes.high` = Opus · high**
94
96
 
@@ -96,18 +98,18 @@ path. Generated from the test data by `npm run docs:modes`; `test/mode-matrix.te
96
98
  | --- | --- | --- | --- | --- |
97
99
  | micro | code, debug, explore, plan, review, ops, docs, uncertain | Haiku · medium | Haiku · medium | Haiku · medium |
98
100
  | low | code, debug, plan, review | Haiku · high | Sonnet · high | Sonnet · xhigh |
99
- | low | explore, ops, docs, uncertain | Haiku · medium | Haiku · high | Haiku · xhigh |
101
+ | low | explore, ops, docs, uncertain | Haiku · medium | Haiku · high | Haiku · high |
100
102
  | medium | code, debug, plan, review | Sonnet · high | Opus · medium | Opus · high |
101
103
  | medium | explore, docs, uncertain | Haiku · high | Opus · medium | Opus · high |
102
104
  | medium | ops | Haiku · medium | Haiku · high | Haiku · xhigh |
103
105
  | high | code, debug, explore, plan, review, ops, docs, uncertain | Opus · medium | Opus · high | Opus · xhigh |
104
106
  | uncertain | code, debug, plan, review | Haiku · high | Sonnet · high | Sonnet · xhigh |
105
- | uncertain | explore, ops, docs, uncertain | Haiku · medium | Haiku · high | Haiku · xhigh |
107
+ | uncertain | explore, ops, docs, uncertain | Haiku · medium | Haiku · high | Haiku · high |
106
108
  <!-- mode-matrix:end -->
107
109
 
108
110
  ## Known trade-offs
109
111
 
110
- The steps are fixed rules, with no per-activity exceptions. Before 1.21.1, `cost` ran `high` ops on Haiku 5.5 and `low`
112
+ The steps are fixed rules, with the Haiku 5.5 quality preference and its one medium bounded-ops exception. Before 1.21.1, `cost` ran `high` ops on Haiku 5.5 and `low`
111
113
  code on Sonnet 5.5 at medium, which scored below Haiku 5.5 at high on FrontierCode and costs more per token. One cell
112
114
  still goes against this router's own model notes (`lib/config.mjs`):
113
115
 
@@ -71,10 +71,10 @@ While routing is on, hover over the band for a second row: a pin per tier, low t
71
71
  **2 rows** adds the session under the route, in the same numbers as the pane's SESSION block. On a Claude plan it leads with the plan windows Claude Code reports:
72
72
 
73
73
  ```text
74
- plan 5h ▰▰▰▰▱▱▱▱ 48% ↻18:00 7d 43% session ≈$6.40 API value −$1.84 (−22%) vs Opus 5.5 64 replies
74
+ plan 5h ▰▰▰▰▱▱▱▱ 48% ↻18:00 7d 43% session ≈$6.40 API estimate −$1.84 (−22%) vs Opus 5.5 64 replies
75
75
  ```
76
76
 
77
- On an API key, or a provider billed in credits, the same row reads `session $6.40 billed −$1.84 (−22%) vs Opus 5.5 64 replies`. Read it as: this session's replies cost $6.40 at list prices, $1.84 less than the same tokens on Opus 5.5, the model `/model` selected. The band names that model while every main reply was priced against it and no subagent ran. Otherwise it reads `vs unrouted`: your model on every main-thread reply and Claude Code's own pick for every subagent, priced on the same tokens. Minus is cheaper, plus is dearer; past double it reads as a ratio, `+$2.48 (×5.0)`. `≈` marks [API value](#how-dollars-are-paid): plan quota, not a charge. A profile that mixes plan and credits models adds the billed part, `billed $4.10`. Before the tenth routed reply the count reads `3 replies so far`, because one model switch and its cache write can still decide a short run. Some situations change the middle part:
77
+ On a plan, an API key, or a provider billed in credits, the row labels dollars `≈$6.40 API estimate`: observed tokens at configured API rates (list/custom), not an invoice or measured quota use. The difference, `−$1.84 (−22%) vs Opus 5.5`, compares the same tokens with the model `/model` selected. The band names that model while every main reply was priced against it and no subagent ran. Otherwise it reads `vs unrouted`: your model on every main-thread reply and Claude Code's own pick for every subagent. Minus is cheaper, plus is dearer; past double it reads as a ratio, `+$2.48 (×5.0)`. A mixed profile adds the estimated credits subtotal, `credits ≈$4.10`. See [How dollars are paid](#how-dollars-are-paid). Before the tenth routed reply the count reads `3 replies so far`, because one model switch and its cache write can still decide a short run. Some situations change the middle part:
78
78
 
79
79
  - `effort low 4 · high 2`: the profile runs one model and routing moves only the effort, so no saving is estimated; see [Providers](providers.md).
80
80
  - `3 of 20 not compared`: some replies have no comparison, such as on a provider whose cache hit rate cannot be known; no saving is shown.
@@ -87,7 +87,7 @@ The band steps aside while a survey needs the space.
87
87
 
88
88
  Inside a turn the router checks the route again as the work changes; see [Changes during a task](#changes-during-a-task). A subagent gets at most one model, when it starts, and keeps it for every step: For the Anthropic profile, these are Haiku for exploration, Opus for clearly hard tasks, and Sonnet for the rest. Other profiles have [their own defaults](providers.md#activity-overrides). An agent that pins a model in its definition keeps it, unless it sets `modelRouting: auto`. The Usage tab's **SUBAGENTS** section shows what each agent type ran on and cost, and the Now tab adds this session's agents to its total. See [Subagent routing](configuration.md#subagent-routing).
89
89
 
90
- In a subagent's transcript the band names the model the agent runs on and who picked it. `agent ■ Haiku 5.5 ↓ from Opus 5.5 (Claude Code’s pick)` means the router chose a cheaper model than Claude Code would have; `↑` means a stronger one. A hollow `□` means the agent ran on Claude Code's pick, because the router agreed or did not route it, and says why: `agent □ Opus 5.5 = Claude Code’s pick: the workflow sets it`. A narrow band drops the comparison first. The band falls back to `agent · model chosen at spawn` when the router has no record of the agent, such as after a plugin reload, and to `agent · keeps its own model (subagent routing off)`.
90
+ In a subagent's transcript the band names the model the agent runs on and who picked it. `agent ■ Haiku 5.5 ↓ from Opus 5.5 (Claude Code’s pick)` means the router chose a cheaper model than Claude Code would have; `↑` means a higher declared strength rank. When ranks are unknown, a model change has no strength direction. A hollow `□` means the agent ran on Claude Code's pick, because the router agreed or did not route it, and says why: `agent □ Opus 5.5 = Claude Code’s pick: the workflow sets it`. A narrow band drops the comparison first. The band falls back to `agent · model chosen at spawn` when the router has no record of the agent, such as after a plugin reload, and to `agent · keeps its own model (subagent routing off)`.
91
91
 
92
92
  ## Open the router pane
93
93
 
@@ -103,7 +103,7 @@ Run `/router` or select **Router** above the prompt. Without a UI surface, as in
103
103
 
104
104
  The top line of every tab, `ROUTER [ ◉ on ] [ ○ off ] Jev ready · 347 ms`, shows the routing mode, switches it, and says whether the classifier is ready. Press `o` or `f` while the pane has focus. The tabs under it carry their digits, `[ 1 Now ] [ 2 Routes ] …`, and **?** shows what the numbers mean above the tab. When routing is unavailable, the top line reads `ROUTER unavailable Claude’s model is kept` with the reason under it, and offers no on or off: see [Troubleshooting](#troubleshooting).
105
105
 
106
- ![The Now tab in four blocks. NEXT TURN: the tier meter, model and activity, the reason with the classifier support and the switch cost, one pin per tier. PLAN: the 5-hour and 7-day windows with their resets. SESSION: the total with one running subagent as API value, the difference against unrouted, the main thread and the subagents as bars, and a strip of every reply colored by tier. CONTEXT: the window fill and the cache reuse](router-pane-now.svg)
106
+ ![The Now tab in four blocks. NEXT TURN: the tier meter, model and activity, the reason with the classifier support and the switch cost, one pin per tier. PLAN: the 5-hour and 7-day windows with their resets. SESSION: the total with one running subagent as an API estimate, the difference against unrouted, the main thread and the subagents as bars, and a strip of every reply colored by tier. CONTEXT: the window fill and the cache reuse](router-pane-now.svg)
107
107
 
108
108
  The **Now** tab has four blocks, each with its name in capitals.
109
109
 
@@ -115,7 +115,7 @@ The **Now** tab has four blocks, each with its name in capitals.
115
115
 
116
116
  ```text
117
117
  SESSION since 14:18 · 86 replies · 6 agents · 9 switches ● 1 running
118
- ≈$8.97 API value · plan quota, not billed [ Usage ]
118
+ ≈$8.97 API estimate · plan quota, not a charge [ Usage ]
119
119
  −$4.09 (−31%) vs unrouted ≈$13.06
120
120
  main ≈$6.45 ████████████████ −$4.17 vs Opus 5.5 · xhigh
121
121
  agents ≈$2.52 ██████░░░░░░░░░░ +$0.08 vs their picks
@@ -123,7 +123,7 @@ SESSION since 14:18 · 86 replies · 6 agents · 9 switches ● 1 running
123
123
  ▂▄ 41 ▂▄▆ 12 ▂▄▆█ 33
124
124
  ```
125
125
 
126
- - The first line is the total and how it is paid: `API value · plan quota, not billed` on a plan, `billed at list prices` on an API key or credits, and `API value · $4.10 of it billed as credits` when a profile mixes the two. See [How dollars are paid](#how-dollars-are-paid). **Usage** opens the Usage tab on this session.
126
+ - The first line is the configured-rate estimate and its billing product: `API estimate · plan quota, not a charge` on a plan, `API estimate · configured rates, not an invoice` on an API key or credits, and `API estimate · credits ≈$4.10` for a mixed profile. See [How dollars are paid](#how-dollars-are-paid). **Usage** opens the Usage tab on this session.
127
127
  - The second line is the difference and what the same tokens would have cost: `vs Opus 5.5 ≈$13.06` when every main reply was priced against your model and no subagent ran, else `vs unrouted ≈$13.06`. The parts add up: main and agents make the total, and their differences make the session's difference (−$4.17 + $0.08 = −$4.09). Before the tenth main reply a line follows: `3 replies so far: one model switch can still move this a lot`. A narrow pane drops the amount first.
128
128
  - **main** compares the main thread with your model, **agents** compares the subagents with Claude Code's picks. The bars share one scale.
129
129
  - An effort-only profile shows `effort routing on one model: no saving is estimated` and its effort mix instead. When some replies have no comparison, the block says how many and shows no saving.
@@ -161,31 +161,31 @@ main · 221 replies ≈$15.33 −$11.78 ≈$27.11
161
161
  cache rebuilds +$0.51 4% of the saving
162
162
  agents · 15 ≈$5.60 −$0.51 ≈$6.11
163
163
  ─────────────────────────────────────────────────────────────
164
- 7 days · ≈ API value ≈$20.93 −$12.29 ≈$33.22
164
+ 7 days · API estimate ≈$20.93 −$12.29 ≈$33.22
165
165
  ```
166
166
 
167
167
  | Row | What it is |
168
- | ---------------- | ------------------------------------------------------------------------------------------------------------ |
168
+ | --------------- | --------------------------------------------------------------------------------------------------------------- |
169
169
  | main | The main thread's routed replies, against the same tokens on your model with one cache that never switched. |
170
170
  | cheaper models | What routing saved on replies that ran on models cheaper than yours. |
171
171
  | stronger models | What replies on models stronger than yours cost on top. Shown only when not zero. |
172
172
  | cache rebuilds | What rewriting the prompt cache after a model switch cost, and its share of the saving. |
173
173
  | agents | The subagents, against the same tokens on Claude Code's pick for each. |
174
- | total | The period's cost, its difference, and what unrouted would have cost: `billed` or `≈ API value`. |
174
+ | total | The period's cost, its difference, and what unrouted would have cost: `API estimate` for every billing product. |
175
175
 
176
- Each row reads across: cost − unrouted = the difference. Down the table, main and agents make the total, and cheaper models, stronger models and cache rebuilds make main's difference. A profile that mixes plan and credits models adds `billed as credits` under the total. Below 10 routed replies the difference adds `3 replies so far: one model switch can still move this a lot`, because one switch and its cache write can decide a short run.
176
+ Each row reads across: cost − unrouted = the difference. Down the table, main and agents make the total, and cheaper models, stronger models and cache rebuilds make main's difference. A profile that mixes plan and credits models adds `credits estimate` under the total. Below 10 routed replies the difference adds `3 replies so far: one model switch can still move this a lot`, because one switch and its cache write can decide a short run.
177
177
 
178
- When some replies have no comparison, the tab says `3 of 20 replies have no comparison: no saving is shown.`, and the table shows the cost alone. Counts, tokens, breakdowns and trends still include those replies; a row with incomplete coverage shows `—` against no routing, and **What if** stays unavailable rather than inventing a baseline. This is common with automatic provider caches, whose future hit rates are unknown. An effort-only profile says `Effort routing on one model: no saving is estimated; the cost is what was billed.`
178
+ When some replies have no comparison, the tab says `3 of 20 replies have no comparison: no saving is shown.`, and the table shows the cost alone. Counts, tokens, breakdowns and trends still include those replies; a row with incomplete coverage shows `—` against no routing, and **What if** stays unavailable rather than inventing a baseline. This is common with automatic provider caches, whose future hit rates are unknown. An effort-only profile says `Effort routing on one model: no saving is estimated; cost uses configured API rates.`
179
179
 
180
180
  #### How dollars are paid
181
181
 
182
- Every dollar in the band, `/router`, the Now tab and Usage is the same measure: the reply's tokens at the list prices in `router.json`. How it is paid decides its label:
182
+ Every dollar in the band, `/router`, the Now tab and Usage estimates the reply's tokens at the configured API rates in `router.json` (vendor list rates or custom rates). Amounts use `≈` for every billing product. They are not invoices or measured plan-quota savings:
183
183
 
184
- - **On a Claude plan** it is quota, not a charge: an API value, shown with `≈`, such as `≈$8.97 API value`. The plan's windows are on the band and the Now tab.
185
- - **On an API key, or a provider billed in credits**, it is what is billed: `$8.97 billed`.
186
- - **A profile that mixes the two**, such as the [model-proxy profile](providers.md#mix-anthropic-and-deepseek-with-model-proxy) with Opus on the plan and DeepSeek in credits, gets one sum and one comparison, and says which part is billed: `≈$24.10 API value · billed $4.10`.
184
+ - **On a Claude plan**, `≈$8.97 API estimate` is a configured-rate equivalent, not a charge or measured quota use. Claude Code's reported plan windows appear separately.
185
+ - **On an API key, or a provider billed in credits**, the same `≈$8.97 API estimate` applies. Gateway billing, discounts and invoice rates may differ.
186
+ - **A mixed profile**, such as [model-proxy](providers.md#mix-anthropic-and-deepseek-with-model-proxy), gets one sum and an estimated credits subtotal: `≈$24.10 API estimate · credits ≈$4.10`.
187
187
 
188
- The router reads the plan from Claude Code's plan windows, from the first reply on; until then a plan session reads as billed, with nothing spent yet. `billing` in `router.json` sets only the credits cap on cold cache writes. The router's dollars leave out what it does not see: titles, compaction, server-side tools and classifier charges. For the whole session cost, run Claude Code's `/cost`.
188
+ The router identifies plan billing from Claude Code's reported plan windows, from the first reply on. Without those windows it treats the product as API/credits, but its dollars remain configured-rate estimates. `billing` in `router.json` controls the cold-cache credits cap, not the estimate's price basis. The router's dollars leave out what it does not see: titles, compaction, server-side tools and classifier charges. For the whole session cost, run Claude Code's `/cost`.
189
189
 
190
190
  A line of counts follows the table: replies, turns, input tokens, the share of the input read from the cache, and output tokens. With routing off or unavailable and no routed reply this session, the tab says the replies use your model and are not counted.
191
191
 
@@ -223,13 +223,13 @@ These are estimates, not a bill. They hold the tokens and the output length the
223
223
 
224
224
  On the Usage tab, **SUBAGENTS** covers the same period as the rest of the tab: this session, or every session in every project that uses this router install (`all projects`), since the last **Delete history**. Each agent is one square, colored by the model it ran on: filled (`■`) when the router moved it off the model Claude Code would have picked, hollow (`□`) when it ran on Claude Code's pick, because the router agreed or did not route it. The models and their agents follow the squares, then how many the router moved, and what routing saved or cost on the routed agents against Claude Code's picks, in the session's words: `routing −$0.10 (−13%) vs Claude Code’s picks on 3 routed agents`. 7d, 30d, Month and All add the agents per day. **ROUTED** lists each agent type the router picked a model for: its squares, agents, cost, and **vs CC**, the same tokens on Claude Code's pick. A row opens to its models, each with how many agents the router kept, moved up or moved down, and to its requests per agent, respawns and classifier failures. **NOT ROUTED** lists the agents Claude Code picked a model for, by reason, with why: `the workflow sets it`, `your model` for a fork, `its agent file sets it`. A row without any priced request says `no price`. Records from before 1.14.0 have no date or model: Session and All add them as one line, and an empty Today or 7d says so. See [Subagent routing](configuration.md#subagent-routing). On the Now tab, **details** adds the context and cache counters, the output of the last reply, the input per reply, and the estimates above.
225
225
 
226
- The router keeps no bill. Its dollars are estimates at configured list prices and leave out classifier charges and the side calls it does not see; run `/cost` for Claude Code's own session cost.
226
+ The router keeps no bill. Its dollars are estimates at configured API rates (list/custom) and leave out classifier charges and the side calls it does not see; run `/cost` for Claude Code's own session cost.
227
227
 
228
228
  ## Route by activity
229
229
 
230
- A tier says how hard the work is. The activity says what kind of work it is. The classifier names it for each new turn, by what the turn produces:
230
+ A tier says how hard the work is. The goal says what the active task must deliver, while phase describes this step. The existing activity names describe goals:
231
231
 
232
- | Activity | The turn produces |
232
+ | Goal | The task produces |
233
233
  | --------- | --------------------------------------------------------------- |
234
234
  | `code` | Changed code or config, including tests |
235
235
  | `debug` | A found cause: failing tests, stack traces, "why does X..." |
@@ -239,7 +239,10 @@ A tier says how hard the work is. The activity says what kind of work it is. The
239
239
  | `ops` | Executed commands: git, builds, test runs, CI, deploys |
240
240
  | `docs` | Prose for people: README, docs, comments, commit messages |
241
241
 
242
- A mixed turn such as "fix it and commit" takes the hardest part, here `code`. The router then picks the route by tier and activity. With the default overrides, a `low` coding turn runs on Sonnet 5.5 at `high`, a `low` git turn stays on Haiku 5.5 at `high`, and a `medium` git turn moves from Opus 5.5 to Haiku 5.5 at `high`. [Activity routing](activity-routing.md) explains the default matrix, why each cell is there, and how to change it.
242
+ A mixed turn such as "fix it and commit" keeps goal `code`. Verification and delivery steps can retain that goal while changing phase. A positively supported verification-only or execution-only phase can use the `ops` cell; mixed checks and fixes cannot. For goal `ops`, accepted `reason` uses the same-tier `debug` preference and `produce` uses `code`, without changing
243
+ the durable goal. Report or unclear phase keeps an eligible continuation or uses the fresh generic baseline; it
244
+ does not introduce a new ops discount. All preferences still pass the usual switching gates.
245
+ The router then picks the route by tier and activity. With the default overrides, a `low` coding turn runs on Sonnet 5.5 at `high`, a `low` git turn stays on Haiku 5.5 at `high`, and a `medium` git turn moves from Opus 5.5 to Haiku 5.5 at `high`. [Activity routing](activity-routing.md) explains the default matrix, why each cell is there, and how to change it.
243
246
 
244
247
  The mode decides what happens with the label:
245
248
 
@@ -255,13 +258,28 @@ When an override runs, **NEXT TURN** on the Now tab adds a line with the tier's
255
258
  How the router moves inside a tier:
256
259
 
257
260
  - It compares routes, not labels. If the new activity resolves to the route already running, nothing switches.
258
- - A move to a stronger route needs the classifier's support, as an upgrade between tiers does. A move to a cheaper one must pay back its cache write within the payback horizon. One vote is enough for either, because the activity is a fact about this turn.
259
- - An activity applies only when the classifier gives it at least 60% probability (`policy.activityMass`). Below that, or on `uncertain`, a new task goes back to its base route if the move passes the same checks. On the running task the activity can move either way while the turn runs; see [Changes during a task](#changes-during-a-task).
261
+ - A move to a stronger route needs the classifier's support, as an upgrade between tiers does. A move to a cheaper one must pay back its cache write within the payback horizon. One vote is enough for either, because this proposes a cell for the current step, not a new task goal.
262
+ - A goal applies only when the classifier gives it at least 60% probability (`policy.activityMass`). Phase must independently meet that same bar before a verification/execution step can propose `ops`; its support is capped at the lower of goal and phase support, not a multiplied probability. Below that, or on `uncertain`, a new task goes back to its base route if the move passes the same checks. On the running task the activity can move either way while the turn runs; see [Changes during a task](#changes-during-a-task).
260
263
  - A pinned turn uses the pin's base route and shows no activity.
261
264
  - When the classifier gives no answer at all (a timeout, a failure, a pause, or a missing key), the running route stays. When it answers the tier but gives no usable activity, only the running activity stays: the tier answer still applies, so the turn can change tier and keeps its activity there. In `off` the base route always runs.
262
265
  - A fresh session starts with routing on when the session model is a tier's route. With activity routing `on`, a model that only an activity override uses also counts: Sonnet 5.5 on the defaults. In `off` it does not.
263
266
 
264
- The band's activity label appears only when the activity applies, so a weak or `uncertain` answer shows none. The two-row band and the **Replies** strip show the activities of recent replies.
267
+ The band names the accepted goal and phase when available, and distinguishes the effective route activity: `code / verify → ops`. These are classifier estimates, not observed proof of the work done. The two-row band and the **Replies** strip show the activities of recent replies.
268
+
269
+ ### Selection and request evidence
270
+
271
+ With no UI surface, `/router` distinguishes the selected model/effort, the **last recorded completed engine request**,
272
+ and the **response-reported model**. The completed-request snapshot changes only after an accepted reply, so it can
273
+ still name the previous request while the next one is pending or aborted. Delegation is not proof of API transmission or backend identity: Claude Code
274
+ can change or ignore settings, and a proxy can echo a requested model. API-transmitted and served effort remain
275
+ unknown; neither the band nor decision/usage records attest them. A record's effort is selected/delegated metadata,
276
+ not a response-reported setting.
277
+
278
+ Dollars use configured API-rate estimates (vendor list rates or custom profile rates), including tracked child
279
+ estimates where available. They are not invoices, measured subscription-quota savings, or cost per accepted task.
280
+ Missing pricing/comparison coverage stays visible in the existing Usage and classifier metrics. Decision `start`,
281
+ `review`, `observed`, and `end` rows describe routing events and coverage: `end` records requests, priced requests
282
+ and unpriced causes, not semantic success or task acceptance. A caller must evaluate task acceptance separately.
265
283
 
266
284
  ### Changes during a task
267
285
 
@@ -269,7 +287,7 @@ The classifier labels a turn from its prompt, and the work can change after that
269
287
 
270
288
  - **On every later step of a turn** it reads the turn's tool calls. A turn labelled `ops` or `explore` that edits a code file moves at once to the tier's `code` route (`docs` when it edits only Markdown or `docs/` files). The tools are the evidence, so this needs no classifier support, and the cache cost does not hold it back; only the cash cap on a credits-billed model can. This move only goes up. The toast and the band show it as `↗ coding`.
271
289
  - **Every 4 requests inside a turn** (`policy.reviewEveryRequests`) it asks the classifier again, in the background, with the turn's prompt and the recent dialogue. A step never waits for the answer: it applies at the first step after it arrives. Each review sends the classifier the same kind of text a new turn does. `0` turns reviews off.
272
- - **A new prompt that continues the task** is decided the same way as a review. Claude Code stamps each prompt with where it came from. A task notification, an observer's report or a programmatic follow-up is always progress on the running task: the classifier is asked about your last request, with the notification as the newest dialogue line, so it judges the work still to do rather than the notification's wording. A message from you or another agent, or "go on", counts as the running task when the classifier scores it as a continuation. After a resume the router does not know your last request yet, so a notification is judged as it reads.
290
+ - **A new prompt that continues the task** is decided the same way as a review. Claude Code stamps each prompt with where it came from. A task notification, observer report or automatic continuation is treated as progress, not as a new goal. It is asked about the known goal with the report as dialogue. Such a report may belong to an older task, so it cannot justify a downgrade. A message from you or another agent, or "go on", counts as the running task when the classifier scores it as a continuation. After a resume the router does not know your last request yet, so a notification is judged as it reads.
273
291
 
274
292
  On the running task:
275
293
 
@@ -282,7 +300,7 @@ On the running task:
282
300
 
283
301
  A failed check blocks every one of these, and so does a check whose result is not the check's own (chained, redirected, piped, after `;` or `||`, or in the background). While no checkpoint is met, the route stays: for a tier the band shows `… down after a checkpoint`; a held activity keeps the running one and shows `= fits`. A cheaper activity also needs 90% probability (`policy.downgradeMass`; 65% in `cost`).
284
302
  - A cheaper tier lands where the answer as a whole points: when the classifier says `micro` 63% and `low` 30%, the turn moves to `low`, which 93% of the answer supports, instead of staying until `micro` alone reaches 90%.
285
- - A pinned turn does not move. A new task, a prompt the classifier does not score as a continuation, is routed as a fresh turn. Ollama does not answer the continuation question, so every prompt is a new task to it; reviews inside a turn still apply.
303
+ - A pinned turn does not move. A prompt not scored as a continuation is routed as a fresh turn. The bounded in-memory goal anchor is created or replaced only on positive new-task evidence, retained only on positive continuation, and dropped on ambiguity, history replacement or session end. A continuation without an anchor cannot seed a short reply as a new goal. Ollama provides neither phase nor continuity, so it does not retain this anchor; recent dialogue can still help its goal answer.
286
304
 
287
305
  These thresholds are starting values. They are not tuned on data yet.
288
306
 
@@ -293,11 +311,11 @@ On Claude Code 2.1.322 an effort that the router changed inside a turn was not s
293
311
  - **Now**: the first line of **NEXT TURN** names the classifier's activity with its share and the next answer, such as `code 84% debug 8%`. An `uncertain` answer is shown dim: it applies no activity. In `on`, a line under it names the cell when the route is an override, such as `code at low runs on Sonnet 5.5 · high · tier route Haiku 5.5 · high`, and **why** reads `↑ code` or `↓ ops` when the activity moved the route; a refused move, a hold, or a tier change keeps its reason.
294
312
  - **Routes**: see [Edit routes and policy](#edit-routes-and-policy). Each activity is a row of the grid, and a cell shows the model the activity runs at that tier.
295
313
  - **Usage**: **BY** with **Activity** lists the period's replies, cost and difference against no routing per activity, and `mostly on`, the route most of its replies used, such as `Sonnet 5.5 · high`; opening a row lists its routes. Replies whose turn had no applied activity count as `no activity`. The **cache rebuilds** row counts the route switches by tier and by activity together. See [Compare routing with no routing](#compare-routing-with-no-routing).
296
- - **Classifier**: **THIS SESSION** gives **Agreement**, how often the tools a turn used fit the classifier's activity (see [Evaluation](evaluation.md#tool-agreement)).
314
+ - **Classifier**: **THIS SESSION** gives **Tool compatibility (not accuracy)**, how often the tools fit the classifier's goal (see [Evaluation](evaluation.md#tool-agreement)).
297
315
 
298
- On the **Classifier** tab, **ACROSS SESSIONS · since the last reset** shows the counts kept across sessions, once there are any: the turns labelled from their tools, **Agreement** over them, **Code/ops/explore**, the same agreement over the turns the classifier answered `code`, `ops` or `explore` (omitted when there are none), the two most frequent mismatches as `predicted → observed count` (`code → read 3`), **Activity moves**, the moves to another route inside a tier, taken and refused for any reason, **Escalations**, such as `after a cheaper activity move: 1 in 12 moves`, the tool-error escalations that followed a move to a cheaper route in `on` while the turns stayed on it in `on` (turning routing off, a turn with routing off, or a turn in `off` ends the watch, a pin in between does not, and an escalation the credits cap held counts). Each of these lines appears only when it has data. The active classifier's p95 wait across sessions shows on its **Deadline** line instead (not recorded with activity routing `off`). This agreement compares the classifier's raw answer, so it can differ from the session's. The pane reads these counts when the session starts and when it opens, and adds this session's turns as they finish; another session's new latency and escalation readings show the next time the pane opens. **Delete history** on the Usage tab deletes these counts with the usage and subagent records, for this session and across sessions.
316
+ On the **Classifier** tab, **ACROSS SESSIONS · since the last reset** shows the counts kept across sessions, once there are any: the turns labelled from their tools, **Tool compatibility** over them, **Code/ops/explore**, the same agreement over the turns the classifier answered `code`, `ops` or `explore` (omitted when there are none), the two most frequent mismatches as `predicted → observed count` (`code → read 3`), **Activity moves**, the moves to another route inside a tier, taken and refused for any reason, **Escalations**, such as `after a cheaper activity move: 1 in 12 moves`, the tool-error escalations that followed a move to a cheaper route in `on` while the turns stayed on it in `on` (turning routing off, a turn with routing off, or a turn in `off` ends the watch, a pin in between does not, and an escalation the credits cap held counts). Each of these lines appears only when it has data. The active classifier's p95 wait across sessions shows on its **Deadline** line instead (not recorded with activity routing `off`). This agreement compares the classifier's raw answer, so it can differ from the session's. The pane reads these counts when the session starts and when it opens, and adds this session's turns as they finish; another session's new latency and escalation readings show the next time the pane opens. **Delete history** on the Usage tab deletes these counts with the usage and subagent records, for this session and across sessions.
299
317
 
300
- `/router` without a UI surface adds an `Activity: ops (81%)` line, the resolved route, and `Agreement across sessions: 19 of 22 turns (86%) · code/ops/explore 9 of 10 (90%)`. It also prints the session in the band's words, such as `Session: $6.40 billed · −$1.84 (−22%) vs Opus 5.5 $8.24 · 64 replies`, after a `Plan: 5h 48% · 7d 43%` line on a Claude plan.
318
+ `/router` without a UI surface distinguishes `Goal: code (95%)`, `Phase: verify` and `Route activity: ops`, followed by the resolved route. It labels tool compatibility explicitly as not accuracy. Goal-contract counters start a separate series; pre-change turn-label counters remain stored but are excluded until **Delete history** removes them. It also prints the session in the band's words, such as `Session: ≈$6.40 API estimate · −$1.84 (−22%) vs Opus 5.5 ≈$8.24 · 64 replies`, after a `Plan: 5h 48% · 7d 43%` line on a Claude plan.
301
319
 
302
320
  ## Change routing
303
321