@alexeiled/claude-router 1.3.2 → 1.4.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,7 +1,7 @@
1
1
  {
2
2
  "name": "router",
3
3
  "displayName": "Router",
4
- "version": "1.3.2",
4
+ "version": "1.4.0",
5
5
  "description": "Model and effort routing for the main conversation, advised by a prompt classifier (Jev, Clef or Clef Flash). Preserves subagent model choices.",
6
6
  "author": {
7
7
  "name": "Alexei Ledenev",
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.4.0 (2026-10-08)
4
+
5
+ ### Changed
6
+
7
+ - `low` is now Haiku 5.5 at `high` effort (was Sonnet 5.5 on the session effort), and `micro` Haiku 5.5 at `medium` (was `low`). On Anthropic's OSWorld 2.1 effort chart, Haiku 5.5 at `high` scored above Sonnet 5.5 at `low`, and at `xhigh` near Sonnet at `medium`, for a fraction of the cost per attempt; OSWorld is computer use, not coding.
8
+ - `medium` and `high` stay Opus 5.5 at `medium` and `xhigh`. Opus 5.5 at `medium` matched or beat Sonnet 5.5 at `xhigh` at 25 to 50% lower cost per task on Terminal-Bench 4.0, FrontierCode v1.1, and CursorBench 4.0 (anthropic.com/claude-sonnet-5-5).
9
+ - No default tier keeps the session effort now. The `sonnet` alias stays. To restore the 1.3 ladder, add to `router.json`: `"routes": { "low": { "model": "sonnet", "effort": null }, "micro": { "model": "haiku", "effort": "low" } }`.
10
+ - A new session starts in Auto when its model is the model of any configured tier, not only the baseline's, and in Manual otherwise. A saved mode still wins on resume, `/model` still enters Manual, and `/clear` still starts Auto.
11
+
12
+ ### Upgrade notes
13
+
14
+ - A session started on Sonnet 5.5, as the 1.3 guides suggested, now starts in Manual, because no default tier routes to Sonnet. Start on Opus 5.5 or Haiku 5.5, run `/router auto`, or restore the 1.3 ladder above.
15
+ - A `routes.low` entry in `router.json` without an `effort` used to keep the session effort, because the 1.3 default named none. It now takes the new default, `high`. Add `"effort": null` to that entry to keep the session effort.
16
+
17
+ ### Fixed
18
+
19
+ - The start mode was decided by whichever ran first, the band or session start. When the band drew first, a session on a model no tier routes to could start in Auto.
20
+
3
21
  ## 1.3.2 (2026-10-08)
4
22
 
5
23
  ### Fixed
package/README.md CHANGED
@@ -38,14 +38,14 @@ sequenceDiagram
38
38
 
39
39
  The active classifier labels a new logical turn once. Tool continuations keep that choice. A local policy applies vote, context, failure, and cache-cost rules before the Mod changes the next step. Claude Code owns request construction, model credentials, tools, streaming, and the API cost ledger.
40
40
 
41
- | Tier | Default model | Effort |
42
- | -------- | ------------- | ------------------------ |
43
- | `micro` | Haiku 5.5 | `low` |
44
- | `low` | Sonnet 5.5 | Keeps the session effort |
45
- | `medium` | Opus 5.5 | `medium` |
46
- | `high` | Opus 5.5 | `xhigh` |
41
+ | Tier | Default model | Effort |
42
+ | -------- | ------------- | -------- |
43
+ | `micro` | Haiku 5.5 | `medium` |
44
+ | `low` | Haiku 5.5 | `high` |
45
+ | `medium` | Opus 5.5 | `medium` |
46
+ | `high` | Opus 5.5 | `xhigh` |
47
47
 
48
- These are routing defaults. They do not claim equal model quality.
48
+ These are routing defaults. They do not claim equal model quality. [Configuration](docs/configuration.md#built-in-defaults) gives the published results behind them and the `router.json` lines that restore the 1.3 Sonnet ladder.
49
49
 
50
50
  ## Install
51
51
 
@@ -56,7 +56,7 @@ claude plugin marketplace add alexei-led/claude-router
56
56
  claude plugin install router@alexei-led-claude-router
57
57
  ```
58
58
 
59
- Start Claude Code on the full baseline model, for example `claude --model claude-sonnet-5-5`. Run `/plugin configure router` and save the key. For Clef or Clef Flash, save the Cloudflare token and account ID, then pick the classifier on the pane's Classifier tab. A session on the baseline model starts in Auto; on another model it starts in Manual, and `/router auto` turns routing on.
59
+ Start Claude Code on the full baseline model, for example `claude --model claude-haiku-5-5`. Run `/plugin configure router` and save the key. For Clef or Clef Flash, save the Cloudflare token and account ID, then pick the classifier on the pane's Classifier tab. A new session on a model that one of the tiers routes to starts in Auto; on another model it starts in Manual, and `/router auto` turns routing on.
60
60
 
61
61
  Claude Code updates the plugin at startup when auto-update is on for this marketplace. Otherwise run `claude plugin marketplace update alexei-led-claude-router`, then `claude plugin update router@alexei-led-claude-router`.
62
62
 
@@ -64,10 +64,10 @@ Upgrading from 0.8? Remove the gateway settings that 0.8 `/router:setup` wrote b
64
64
 
65
65
  ## Run from a checkout
66
66
 
67
- Start Claude Code with this directory as a local plugin and the full Sonnet baseline model:
67
+ Start Claude Code with this directory as a local plugin and the full Haiku baseline model:
68
68
 
69
69
  ```sh
70
- claude --plugin-dir "$PWD" --model claude-sonnet-5-5
70
+ claude --plugin-dir "$PWD" --model claude-haiku-5-5
71
71
  ```
72
72
 
73
73
  In Claude Code, run `/plugin configure router` and save your classifier key in the sensitive plugin option. The Mod adds its status band and `/router` pane. No status-line setup or gateway environment variables are needed.
@@ -68,7 +68,7 @@ An explicit context-window failure marks that model ineligible until the next hi
68
68
 
69
69
  `$.state` stores route decisions, response observations, and UI state for the active session. Version-checked writes reject stale turn results. A private in-memory view merges state writes during one dispatch because state reads are frozen for that dispatch.
70
70
 
71
- Clear, branch, rewind, and committed compaction clear cache evidence and votes. A turn in progress keeps its route, pin, and any engine fallback. `/clear` starts the new session in Auto. A fresh session on the configured baseline starts in Auto. A fresh session on another model starts in Manual. Resume restores the selected session's saved mode. Hot reload retains valid `$.state`. Running `/model` enters Manual, including an explicit choice of the baseline. `/router auto` resumes routing. `/router off` also enters Manual. Pins apply to the next turn and its tool continuations. The prior Auto route resumes afterward.
71
+ Clear, branch, rewind, and committed compaction clear cache evidence and votes. A turn in progress keeps its route, pin, and any engine fallback. `/clear` starts the new session in Auto. A fresh session on a model that a configured tier routes to starts in Auto. A fresh session on any other model starts in Manual. Session start sets the mode; the band and pane only read it, even when they draw first. Resume restores the selected session's saved mode. Hot reload retains valid `$.state`. Running `/model` enters Manual, including an explicit choice of the baseline. `/router auto` resumes routing. `/router off` also enters Manual. Pins apply to the next turn and its tool continuations. The prior Auto route resumes afterward.
72
72
 
73
73
  Subagent events pass directly to Claude Code. They do not create classifier requests or change main-conversation metrics. This is the selected scope because Mods do not expose whether a subagent model was explicit or inherited.
74
74
 
@@ -30,12 +30,22 @@ Project and local settings cannot set `HOME` or `CLAUDE_CONFIG_DIR` for this Mod
30
30
 
31
31
  The default baseline is tier `low`. Each route refers to an alias in `models`.
32
32
 
33
- | Tier | Model alias | Model ID | Effort |
34
- | -------- | ----------- | ------------------- | ------------------------------------ |
35
- | `micro` | `haiku` | `claude-haiku-5-5` | `low` |
36
- | `low` | `sonnet` | `claude-sonnet-5-5` | Keeps the effort sent by Claude Code |
37
- | `medium` | `opus` | `claude-opus-5-5` | `medium` |
38
- | `high` | `opus` | `claude-opus-5-5` | `xhigh` |
33
+ | Tier | Model alias | Model ID | Effort |
34
+ | -------- | ----------- | ------------------ | -------- |
35
+ | `micro` | `haiku` | `claude-haiku-5-5` | `medium` |
36
+ | `low` | `haiku` | `claude-haiku-5-5` | `high` |
37
+ | `medium` | `opus` | `claude-opus-5-5` | `medium` |
38
+ | `high` | `opus` | `claude-opus-5-5` | `xhigh` |
39
+
40
+ Every default route names its effort, so no default tier keeps the effort Claude Code sends. The ladder follows Anthropic's published charts. On the OSWorld 2.1 effort chart, Haiku 5.5 at `high` scored above Sonnet 5.5 at `low`, and Haiku at `xhigh` near Sonnet at `medium`, for a fraction of the cost per attempt; OSWorld measures computer use, not coding. On Terminal-Bench 4.0, FrontierCode v1.1, and CursorBench 4.0, Opus 5.5 at `medium` matched or beat Sonnet 5.5 at `xhigh` at 25 to 50% lower cost per task (chart data on anthropic.com/claude-sonnet-5-5). These are routing defaults, not a claim of equal model quality.
41
+
42
+ `micro` and `low` share a model, so a step between them changes only the effort. The policy prices it as a new messages cache, as it does `medium` to `high`.
43
+
44
+ To restore the 1.3 ladder, with Sonnet 5.5 at `low` on the session effort and Haiku 5.5 at `low` effort for `micro`:
45
+
46
+ ```json
47
+ { "routes": { "low": { "model": "sonnet", "effort": null }, "micro": { "model": "haiku", "effort": "low" } } }
48
+ ```
39
49
 
40
50
  Default model settings:
41
51
 
@@ -45,7 +55,7 @@ Default model settings:
45
55
  | `sonnet` | 2 / 10 / 0.2 | 1,000,000 | `plan` | `low`, `medium`, `high`, `xhigh`, `max` |
46
56
  | `haiku` | 0.1 / 0.5 / 0.01 | 1,000,000 | `plan` | `low`, `medium`, `high`, `xhigh`, `max` |
47
57
 
48
- Prices are configured list-price inputs for estimates. They are not a subscription bill or a claim of savings. Haiku 5.5 prices are for prompts up to 100,000 tokens; above that Anthropic charges more, so estimates run low there. A model with `"efforts": []` receives no effort field. A route without an effort keeps the session effort, clamped to what the model supports. To make a tier whose default names an effort keep the session effort instead, set `"effort": null`, for example `"routes": { "high": { "model": "opus", "effort": null } }`.
58
+ Prices are configured list-price inputs for estimates. They are not a subscription bill or a claim of savings. Haiku 5.5 prices are for prompts up to 100,000 tokens; above that Anthropic charges more, so estimates run low there. A model with `"efforts": []` receives no effort field. A route in `router.json` without an `effort` takes the effort of that tier's default route. To keep the session effort, clamped to what the model supports, set `"effort": null`, for example `"routes": { "high": { "model": "opus", "effort": null } }`. A 1.3 file whose `low` route had no `effort` kept the session effort; in 1.4 it runs at `high` until you add `"effort": null`.
49
59
 
50
60
  ## Classifiers
51
61
 
@@ -146,7 +156,7 @@ A marketplace install keeps the plugin ID `router@alexei-led-claude-router`: upd
146
156
  CLAUDE_CONFIG_DIR=/path/to/profile claude plugin disable router@alexei-led-claude-router --scope user
147
157
  ```
148
158
 
149
- Then inspect that profile's `settings.json`. Remove the old `jev-router[1m]` model-picker row and any `model` or `env.ANTHROPIC_MODEL` value set to that alias. Remove `env.ANTHROPIC_BASE_URL` when it points to the router's loopback port. Clear `env.CLAUDE_CODE_GATEWAY_HINT_HEADERS`. Restore or remove a router-specific `statusLine` that points to the deleted script. Remove `env.ENABLE_TOOL_SEARCH` only if the old router setup added it and you do not need it for another reason. Preserve unrelated settings. Set the normal full baseline model, for example `claude-sonnet-5-5`.
159
+ Then inspect that profile's `settings.json`. Remove the old `jev-router[1m]` model-picker row and any `model` or `env.ANTHROPIC_MODEL` value set to that alias. Remove `env.ANTHROPIC_BASE_URL` when it points to the router's loopback port. Clear `env.CLAUDE_CODE_GATEWAY_HINT_HEADERS`. Restore or remove a router-specific `statusLine` that points to the deleted script. Remove `env.ENABLE_TOOL_SEARCH` only if the old router setup added it and you do not need it for another reason. Preserve unrelated settings. Set the normal full baseline model, for example `claude-haiku-5-5`.
150
160
 
151
161
  No conversion is needed if you never created `router.json`. For an existing file, run the migration command that ships with the installed plugin:
152
162
 
@@ -22,7 +22,7 @@ The default tiers are defined in [Configuration](configuration.md#built-in-defau
22
22
 
23
23
  The pane's **Set up** and **Credentials → Edit** buttons open Claude Code's secure plugin configuration. Claude Code refuses `$.command.run` from inside a `command.run` hook, so the Mod starts that dialog from a timer after the press returns.
24
24
 
25
- Mode belongs to a Claude Code session. Clear starts a new session in Auto. Resume restores the saved mode for that session. A new or forked session has a new ID: it starts in Auto on the baseline model and in Manual on another model, as a fresh launch does. A pin applies to one logical turn, then the prior Auto incumbent resumes. A history reset clears votes and cache evidence; the current turn keeps its route, pin and any native fallback.
25
+ Mode belongs to a Claude Code session. Clear starts a new session in Auto. Resume restores the saved mode for that session. A new or forked session has a new ID: it starts in Auto on a model that one of the tiers routes to and in Manual on any other model, as a fresh launch does. A pin applies to one logical turn, then the prior Auto incumbent resumes. A history reset clears votes and cache evidence; the current turn keeps its route, pin and any native fallback.
26
26
 
27
27
  ## Router pane
28
28
 
@@ -80,6 +80,6 @@ On 2026-10-05, live probes of Clef and Clef Flash on Workers AI took 0.7 to 1.3
80
80
 
81
81
  Recorded acceptance checks cover the local HTTP deadline and one-request admission, session clear/resume, circuit-breaker pause, reload, replacement, unload, engine fallback, and interrupt during Jev advice. The interrupt check closed the loopback socket within 4 ms and discarded late advice without changing the active route or UI. Results are stored under [`experiments/mod-router/results`](../experiments/mod-router/results/).
82
82
 
83
- A billed chain of pinned turns moved across Opus, Haiku 4.5, and Sonnet with a tool call on every turn, and no request was rejected. Claude Code builds each model's request itself; Haiku 4.5 received its own thinking mode and a 32K output cap. Haiku 5.5 was not probed. Sonnet and Opus accepted histories above 589K input tokens. These probes validate the tested path only. Claude Code and organization policy control other model and request combinations.
83
+ A billed chain of pinned turns moved across Opus, Haiku 4.5, and Sonnet with a tool call on every turn, and no request was rejected. Claude Code builds each model's request itself; Haiku 4.5 received its own thinking mode and a 32K output cap. On Claude Code 2.1.293, a turn pinned to `low` ran on Haiku 5.5 at `high` with a tool call and was served by the requested model (2026-10-08). Sonnet and Opus accepted histories above 589K input tokens. These probes validate the tested path only. Claude Code and organization policy control other model and request combinations.
84
84
 
85
85
  To stop routing in a session, run `/router off`. To stop loading the Mod, run `claude plugin disable router@alexei-led-claude-router` and restart.
@@ -78,19 +78,19 @@
78
78
  <text x="39.6" y="224" fill="#7c7c7c" xml:space="preserve">▆</text>
79
79
  <text x="47.4" y="224" fill="#7c7c7c" xml:space="preserve">█</text>
80
80
  <text x="55.2" y="224" fill="#5f9fe0" font-weight="700" xml:space="preserve"> low </text>
81
- <text x="94.2" y="224" fill="#d0d0d0" xml:space="preserve">Sonnet 5.5 · medium</text>
82
- <text x="242.4" y="224" fill="#7c7c7c" xml:space="preserve"> · </text>
83
- <text x="281.4" y="224" fill="#d7af5f" xml:space="preserve">⏵ next turn: </text>
84
- <text x="382.8" y="224" fill="#d7af5f" font-weight="700" xml:space="preserve">medium</text>
85
- <text x="437.4" y="224" fill="#d0d0d0" xml:space="preserve">✕</text>
86
- <text x="445.2" y="224" fill="#7c7c7c" xml:space="preserve"> · </text>
87
- <text x="484.2" y="224" fill="#7c7c7c" xml:space="preserve">= fits</text>
88
- <text x="531.0" y="224" fill="#7c7c7c" xml:space="preserve"> · </text>
89
- <text x="570.0" y="224" fill="#d0d0d0" xml:space="preserve">ctx </text>
90
- <text x="601.2" y="224" fill="#87d787" xml:space="preserve">40%</text>
91
- <text x="624.6" y="224" fill="#d0d0d0" xml:space="preserve"> · cache </text>
92
- <text x="694.8" y="224" fill="#87d787" xml:space="preserve">100%</text>
93
- <text x="741.6" y="224" fill="#d0d0d0" xml:space="preserve">Router</text>
81
+ <text x="94.2" y="224" fill="#d0d0d0" xml:space="preserve">Haiku 5.5 · high</text>
82
+ <text x="219.0" y="224" fill="#7c7c7c" xml:space="preserve"> · </text>
83
+ <text x="258.0" y="224" fill="#d7af5f" xml:space="preserve">⏵ next turn: </text>
84
+ <text x="359.4" y="224" fill="#d7af5f" font-weight="700" xml:space="preserve">medium</text>
85
+ <text x="414.0" y="224" fill="#d0d0d0" xml:space="preserve">✕</text>
86
+ <text x="421.8" y="224" fill="#7c7c7c" xml:space="preserve"> · </text>
87
+ <text x="460.8" y="224" fill="#7c7c7c" xml:space="preserve">= fits</text>
88
+ <text x="507.6" y="224" fill="#7c7c7c" xml:space="preserve"> · </text>
89
+ <text x="546.6" y="224" fill="#d0d0d0" xml:space="preserve">ctx </text>
90
+ <text x="577.8" y="224" fill="#87d787" xml:space="preserve">40%</text>
91
+ <text x="601.2" y="224" fill="#d0d0d0" xml:space="preserve"> · cache </text>
92
+ <text x="671.4" y="224" fill="#87d787" xml:space="preserve">100%</text>
93
+ <text x="718.2" y="224" fill="#d0d0d0" xml:space="preserve">Router</text>
94
94
  <text class="cap" x="20" y="263">No classifier key: Router keeps the model and offers Set up</text>
95
95
  <rect x="12" y="271" width="897.6" height="29" rx="5" fill="#232323"/>
96
96
  <text x="24.0" y="289" fill="#d7af5f" xml:space="preserve">⚠ Jev: no API key</text>
@@ -102,10 +102,10 @@
102
102
  <text x="328.2" y="289" fill="#7c7c7c" xml:space="preserve">▆</text>
103
103
  <text x="336.0" y="289" fill="#7c7c7c" xml:space="preserve">█</text>
104
104
  <text x="343.8" y="289" fill="#5f9fe0" font-weight="700" xml:space="preserve"> low </text>
105
- <text x="382.8" y="289" fill="#d0d0d0" xml:space="preserve">Sonnet 5.5 · medium</text>
106
- <text x="531.0" y="289" fill="#7c7c7c" xml:space="preserve"> · </text>
107
- <text x="570.0" y="289" fill="#d7af5f" xml:space="preserve">keeping model</text>
108
- <text x="687.0" y="289" fill="#d0d0d0" xml:space="preserve">Router</text>
105
+ <text x="382.8" y="289" fill="#d0d0d0" xml:space="preserve">Haiku 5.5 · high</text>
106
+ <text x="507.6" y="289" fill="#7c7c7c" xml:space="preserve"> · </text>
107
+ <text x="546.6" y="289" fill="#d7af5f" xml:space="preserve">keeping model</text>
108
+ <text x="663.6" y="289" fill="#d0d0d0" xml:space="preserve">Router</text>
109
109
  <text class="cap" x="20" y="328">Manual: /model chose the model; Auto resumes routing</text>
110
110
  <rect x="12" y="336" width="897.6" height="29" rx="5" fill="#232323"/>
111
111
  <text x="24.0" y="354" fill="#7c7c7c" xml:space="preserve">○ </text>
@@ -36,12 +36,12 @@
36
36
  <text x="351.6" y="224" fill="#d0d0d0" xml:space="preserve"> 7% </text>
37
37
  <text x="406.2" y="224" fill="#d0d0d0" xml:space="preserve">[ pin ]</text>
38
38
  <text x="39.6" y="243" fill="#5f9fe0" font-weight="700" xml:space="preserve">low </text>
39
- <text x="102.0" y="243" fill="#d0d0d0" xml:space="preserve">Sonnet 5.5 · session </text>
39
+ <text x="102.0" y="243" fill="#d0d0d0" xml:space="preserve">Haiku 5.5 · high </text>
40
40
  <text x="273.6" y="243" fill="#5f9fe0" xml:space="preserve">░░░░░░░░░░</text>
41
41
  <text x="351.6" y="243" fill="#d0d0d0" xml:space="preserve"> 3% </text>
42
42
  <text x="406.2" y="243" fill="#d0d0d0" xml:space="preserve">[ pin ]</text>
43
43
  <text x="39.6" y="262" fill="#5fd7af" font-weight="700" xml:space="preserve">micro </text>
44
- <text x="102.0" y="262" fill="#d0d0d0" xml:space="preserve">Haiku 5.5 · low </text>
44
+ <text x="102.0" y="262" fill="#d0d0d0" xml:space="preserve">Haiku 5.5 · medium </text>
45
45
  <text x="273.6" y="262" fill="#5fd7af" xml:space="preserve">░░░░░░░░░░</text>
46
46
  <text x="351.6" y="262" fill="#d0d0d0" xml:space="preserve"> 2% </text>
47
47
  <text x="406.2" y="262" fill="#d0d0d0" xml:space="preserve">[ pin ]</text>
@@ -32,13 +32,13 @@
32
32
  <text x="304.8" y="167" fill="#d0d0d0" xml:space="preserve">2 · 10</text>
33
33
  <text x="414.0" y="167" fill="#d0d0d0" xml:space="preserve">1M</text>
34
34
  <text x="24.0" y="186" fill="#5f9fe0" font-weight="700" xml:space="preserve">low</text>
35
- <text x="86.4" y="186" fill="#d0d0d0" xml:space="preserve">Sonnet 5.5 ▾</text>
36
- <text x="195.6" y="186" fill="#d0d0d0" xml:space="preserve">session ▾</text>
37
- <text x="304.8" y="186" fill="#d0d0d0" xml:space="preserve">2 · 10</text>
35
+ <text x="86.4" y="186" fill="#d0d0d0" xml:space="preserve">Haiku 5.5 ▾</text>
36
+ <text x="195.6" y="186" fill="#d0d0d0" xml:space="preserve">high ▾</text>
37
+ <text x="304.8" y="186" fill="#d0d0d0" xml:space="preserve">0.1 · 0.5</text>
38
38
  <text x="414.0" y="186" fill="#d0d0d0" xml:space="preserve">1M</text>
39
39
  <text x="24.0" y="205" fill="#5fd7af" font-weight="700" xml:space="preserve">micro</text>
40
40
  <text x="86.4" y="205" fill="#d0d0d0" xml:space="preserve">Haiku 5.5 ▾</text>
41
- <text x="195.6" y="205" fill="#d0d0d0" xml:space="preserve">low ▾</text>
41
+ <text x="195.6" y="205" fill="#d0d0d0" xml:space="preserve">medium ▾</text>
42
42
  <text x="304.8" y="205" fill="#d0d0d0" xml:space="preserve">0.1 · 0.5</text>
43
43
  <text x="414.0" y="205" fill="#d0d0d0" xml:space="preserve">1M</text>
44
44
  <text x="24.0" y="224" fill="#d0d0d0" xml:space="preserve">Baseline tier: low ▾</text>
@@ -49,10 +49,10 @@
49
49
  <text x="164.4" y="281" fill="#d0d0d0" xml:space="preserve">model change: priced as a cold cache write</text>
50
50
  <text x="24.0" y="300" fill="#7c7c7c" xml:space="preserve">· </text>
51
51
  <text x="39.6" y="300" fill="#d0d0d0" xml:space="preserve">low → medium </text>
52
- <text x="164.4" y="300" fill="#d0d0d0" xml:space="preserve">same model, new effort: priced as a new cache</text>
52
+ <text x="164.4" y="300" fill="#d0d0d0" xml:space="preserve">model change: priced as a cold cache write</text>
53
53
  <text x="24.0" y="319" fill="#7c7c7c" xml:space="preserve">· </text>
54
54
  <text x="39.6" y="319" fill="#d0d0d0" xml:space="preserve">micro → low </text>
55
- <text x="164.4" y="319" fill="#d0d0d0" xml:space="preserve">model change: priced as a cold cache write</text>
55
+ <text x="164.4" y="319" fill="#d0d0d0" xml:space="preserve">same model, new effort: priced as a new cache</text>
56
56
  <text x="24.0" y="338" fill="#d0d0d0" xml:space="preserve">[ Reset routes to defaults ]</text>
57
57
  <text x="24.0" y="357" fill="#7c7c7c" xml:space="preserve">A new model ID needs router.json → models: price, window, efforts.</text>
58
58
  <text x="24.0" y="395" fill="#5fafd7" font-weight="700" xml:space="preserve">POLICY</text>
@@ -12,7 +12,7 @@ claude plugin install router@alexei-led-claude-router
12
12
  Start with the full baseline model so Auto mode has a known starting point:
13
13
 
14
14
  ```sh
15
- claude --model claude-sonnet-5-5
15
+ claude --model claude-haiku-5-5
16
16
  ```
17
17
 
18
18
  In Claude Code:
@@ -22,7 +22,7 @@ In Claude Code:
22
22
  - **Jev** (the default): the Jev API key from typesafe.ai.
23
23
  - **Clef** or **Clef Flash** on Cloudflare Workers AI: the Cloudflare API token and the Cloudflare account ID. One token covers both models.
24
24
  3. To use Clef or Clef Flash, open the pane's **Classifier** tab and select its row. See [Choose the classifier](#choose-the-classifier).
25
- 4. Check the band above the prompt: `▂▄▆█ Auto · ready`. On another model the session starts in Manual; run `/router auto` to route.
25
+ 4. Check the band above the prompt: `▂▄▆█ Auto · ready`. On a model that no tier routes to, the session starts in Manual; run `/router auto` to route.
26
26
 
27
27
  Keys are stored as sensitive plugin options. Do not paste them into a model conversation. The [configuration guide](configuration.md) covers optional settings and migrations.
28
28
 
@@ -114,7 +114,7 @@ There is no router-side spend or savings ledger. The pane does not include class
114
114
  | **Auto** / **Manual** | The same as `/router auto` and `/router off`. |
115
115
  | **pin** on the Now tab | Pin that tier for the next turn. Auto must already be enabled. |
116
116
 
117
- A pin does not change the next turn after the pinned turn finishes. A fresh session on the baseline model starts in Auto. A fresh session on another model starts in Manual. `/clear` starts the new session in Auto. Resuming a saved session restores its saved Auto or Manual mode.
117
+ A pin does not change the next turn after the pinned turn finishes. A fresh session on a model that one of the tiers routes to starts in Auto. A fresh session on any other model starts in Manual. `/clear` starts the new session in Auto. Resuming a saved session restores its saved Auto or Manual mode.
118
118
 
119
119
  ## Edit routes and policy
120
120
 
@@ -167,7 +167,7 @@ The v1 plugin has the same plugin ID, `router@alexei-led-claude-router`, but it
167
167
  1. Update the plugin: `claude plugin marketplace update alexei-led-claude-router`, then `claude plugin update router@alexei-led-claude-router`.
168
168
  2. Remove the settings that v0.8 `/router:setup` wrote. The [migration checklist](configuration.md#convert-a-v08-configuration) lists them: the `jev-router[1m]` model and picker row, the loopback `ANTHROPIC_BASE_URL`, the hint header, and the router status line.
169
169
  3. Convert `router.json` if you created one.
170
- 4. Restart Claude Code with a full baseline model, such as `claude-sonnet-5-5`.
170
+ 4. Restart Claude Code with a full baseline model, such as `claude-haiku-5-5`.
171
171
 
172
172
  Keep the plugin enabled: in v1 it is the Mod. The Jev key option keeps its saved value. If the band reads `v0.8 gateway settings remain`, step 2 is incomplete.
173
173
 
@@ -7,7 +7,6 @@ import {
7
7
  effectiveRoutes,
8
8
  loadConfig,
9
9
  MIGRATION_HINT,
10
- routeModel,
11
10
  supportedVersion,
12
11
  TIERS,
13
12
  tuningOf,
@@ -37,6 +36,7 @@ import {
37
36
  observeResponse,
38
37
  prepareLoop,
39
38
  resetHistory,
39
+ tierForModel,
40
40
  } from '../lib/route.mjs';
41
41
  import { CLEARED_READINGS, healthOf, initialView, responseMetrics } from '../lib/view.mjs';
42
42
 
@@ -80,19 +80,28 @@ async function readView($, router) {
80
80
  return (await $.state.get(VIEW)).value ?? router.view ?? initialView(await $.session.model());
81
81
  }
82
82
 
83
+ // Only a saved mode is cached: the engine can draw the band before session.start, and a cached fallback from that
84
+ // render would override the start rule.
83
85
  async function modeOf($, router, fallback = 'auto') {
84
86
  const sessionId = await $.session.id();
85
87
  if (router.modes.has(sessionId)) return router.modes.get(sessionId);
86
88
  try {
87
89
  const saved = await $.store.get(`${MODE_PREFIX}${sessionId}`);
88
- const mode = saved === 'manual' || saved === 'auto' ? saved : fallback;
89
- router.modes.set(sessionId, mode);
90
- return mode;
90
+ if (saved !== 'manual' && saved !== 'auto') return fallback;
91
+ router.modes.set(sessionId, saved);
92
+ return saved;
91
93
  } catch {
92
94
  return 'manual';
93
95
  }
94
96
  }
95
97
 
98
+ // A saved preference wins; a fresh session starts Auto on a model some tier routes to and Manual on any other.
99
+ async function startMode($, router, model) {
100
+ const mode = await modeOf($, router, tierForModel(router.config, model) === null ? 'manual' : 'auto');
101
+ router.modes.set(await $.session.id(), mode);
102
+ return mode;
103
+ }
104
+
96
105
  async function rememberMode($, mode) {
97
106
  try {
98
107
  await $.store.set(`${MODE_PREFIX}${await $.session.id()}`, mode);
@@ -545,14 +554,13 @@ export function register(on, options) {
545
554
  const base = await $.env.get('ANTHROPIC_BASE_URL');
546
555
  const version = await $.session.version().catch(() => null);
547
556
  const supported = supportedVersion(version?.version);
548
- const baselineModel = routeModel(router.config, router.config.baselineTier).id;
549
557
  const gateway =
550
558
  ['jev-router', 'jev-router[1m]'].includes(model) ||
551
559
  model === 'router' ||
552
560
  Boolean(base?.includes('127.0.0.1:43170') || base?.includes('localhost:43170'));
553
561
  await updateView($, router, {
554
562
  nativeModel: model,
555
- mode: await modeOf($, router, model === baselineModel ? 'auto' : 'manual'),
563
+ mode: await startMode($, router, model),
556
564
  phase: gateway || !supported ? 'unavailable' : 'ready',
557
565
  error: !supported ? 'requires Claude Code 2.1.289 or newer' : gateway ? GATEWAY_SETTINGS : null,
558
566
  ...(sameClassifier ? {} : CLEARED_READINGS),
package/lib/config.mjs CHANGED
@@ -4,15 +4,16 @@ export const TIERS = ['micro', 'low', 'medium', 'high'];
4
4
  export const EFFORTS = ['low', 'medium', 'high', 'xhigh', 'max'];
5
5
  export const DEFAULTS = {
6
6
  baselineTier: 'low',
7
- // Sonnet 5.5 is the worker at `low`, at the effort the user picked. `medium` is Opus 5.5 at medium effort, a balance
8
- // of speed and cost per task; `high` is Opus 5.5 at xhigh, the strongest setting this router asks for.
9
- // `micro` is Haiku 5.5 at low effort: Claude Code owns the thinking field, so low effort is the least thinking the router can ask for.
10
- // These are routing defaults, not a claim of equal model quality.
7
+ // Haiku 5.5 is the worker at `low` and `micro`: at high effort it scored above Sonnet 5.5 at low, and at xhigh near
8
+ // Sonnet at medium, for a fraction of the cost per attempt (Anthropic's OSWorld 2.1 effort chart: computer use, not
9
+ // coding). Opus 5.5 at medium matched or beat Sonnet 5.5 at xhigh at 25-50% lower cost per task on Terminal-Bench
10
+ // 4.0, FrontierCode v1.1 and CursorBench 4.0 (anthropic.com/claude-sonnet-5-5). `high` is Opus 5.5 at xhigh, the
11
+ // strongest setting this router asks for. These are routing defaults, not a claim of equal model quality.
11
12
  routes: {
12
13
  high: { model: 'opus', effort: 'xhigh' },
13
14
  medium: { model: 'opus', effort: 'medium' },
14
- low: { model: 'sonnet' },
15
- micro: { model: 'haiku', effort: 'low' },
15
+ low: { model: 'haiku', effort: 'high' },
16
+ micro: { model: 'haiku', effort: 'medium' },
16
17
  },
17
18
  // `id` selects the native model. List prices in USD per million tokens; `cacheRead` is absolute,
18
19
  // not a multiplier (Opus 5.5 reads at 0.05x input, the rest at the standard 0.1x). Haiku 5.5 lists the rates for
@@ -176,7 +177,7 @@ export function withRoutes(file, draft) {
176
177
  const { model, effort = null } = draft.routes[tier];
177
178
  const preset = DEFAULTS.routes[tier];
178
179
  if (model === preset.model && effort === (preset.effort ?? null)) continue;
179
- routes[tier] = effort !== null || preset.effort ? { model, effort } : { model };
180
+ routes[tier] = { model, effort };
180
181
  }
181
182
  const baseline =
182
183
  draft.baselineTier === base.baselineTier
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alexeiled/claude-router",
3
- "version": "1.3.2",
3
+ "version": "1.4.0",
4
4
  "description": "Native Claude Code Mod: model and effort routing for the main conversation, advised by Jev, Clef or Clef Flash.",
5
5
  "license": "MIT",
6
6
  "author": "Alexei Ledenev",