@alexeiled/claude-router 1.5.1 → 1.6.1

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,12 +1,12 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 594 686" role="img" aria-labelledby="title desc">
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 813 1123" role="img" aria-labelledby="title desc">
2
2
  <title id="title">Router pane, Routing tab</title>
3
- <desc id="desc">Model and effort per tier with prices and windows, the baseline tier, how the policy prices each step up, the policy controls, and the unsaved router.json change with Save and Discard.</desc>
3
+ <desc id="desc">Model and effort per tier with prices and windows, the baseline tier, how the policy prices each step up, the activity matrix and overrides, the policy controls, and the unsaved router.json changes with Save and Discard.</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="594" height="686" rx="8" fill="#1c1c1c"/>
9
- <rect x="10" y="10" width="574" height="666" rx="6" fill="none" stroke="#3f5f8f"/>
8
+ <rect width="813" height="1123" rx="8" fill="#1c1c1c"/>
9
+ <rect x="10" y="10" width="793" height="1103" rx="6" fill="none" stroke="#3f5f8f"/>
10
10
  <text x="24.0" y="34" fill="#5fafd7" font-weight="700" xml:space="preserve">ROUTING · on</text>
11
11
  <text x="141.0" y="34" fill="#87d787" xml:space="preserve">Jev ready · 347 ms</text>
12
12
  <rect x="24.0" y="39" width="109.2" height="18" rx="4" fill="#87afff"/>
@@ -63,32 +63,103 @@
63
63
  <rect x="24.0" y="324" width="218.4" height="18" rx="4" fill="#2e3340"/>
64
64
  <text x="24.0" y="338" fill="#d0d0d0" xml:space="preserve">[ Reset routes to defaults ]</text>
65
65
  <text x="24.0" y="357" fill="#7c7c7c" xml:space="preserve">A new model ID needs router.json → models: price, window, efforts.</text>
66
- <text x="24.0" y="395" fill="#5fafd7" font-weight="700" xml:space="preserve">POLICY</text>
67
- <text x="70.8" y="395" fill="#7c7c7c" xml:space="preserve"> · applies next turn · edit, then Save</text>
68
- <text x="24.0" y="414" fill="#d0d0d0" xml:space="preserve">Votes to go down</text>
69
- <text x="180.0" y="414" fill="#d0d0d0" xml:space="preserve">2 ▾</text>
70
- <text x="289.2" y="414" fill="#7c7c7c" xml:space="preserve">agreeing turns before cheaper</text>
71
- <text x="24.0" y="433" fill="#d0d0d0" xml:space="preserve">Payback horizon</text>
72
- <text x="180.0" y="433" fill="#d0d0d0" xml:space="preserve">5 turns ▾</text>
73
- <text x="289.2" y="433" fill="#7c7c7c" xml:space="preserve">a switch repays its cache</text>
74
- <text x="24.0" y="452" fill="#d0d0d0" xml:space="preserve">Credits cap</text>
75
- <text x="180.0" y="452" fill="#d0d0d0" xml:space="preserve">$2.00 ▾</text>
76
- <text x="289.2" y="452" fill="#7c7c7c" xml:space="preserve">max cold write on credits</text>
77
- <rect x="24.0" y="457" width="218.4" height="18" rx="4" fill="#2e3340"/>
78
- <text x="24.0" y="471" fill="#d0d0d0" xml:space="preserve">[ Reset policy to defaults ]</text>
79
- <text x="24.0" y="509" fill="#5fafd7" font-weight="700" xml:space="preserve">CONFIG</text>
80
- <text x="24.0" y="528" fill="#d0d0d0" xml:space="preserve">File ~/.claude/router.json </text>
81
- <rect x="273.6" y="514" width="62.4" height="18" rx="4" fill="#2e3340"/>
82
- <text x="273.6" y="528" fill="#d0d0d0" xml:space="preserve">[ copy ]</text>
83
- <text x="24.0" y="547" fill="#7c7c7c" xml:space="preserve">Main conversation only. Subagents keep their own model.</text>
84
- <text x="24.0" y="585" fill="#7c7c7c" xml:space="preserve">router.json changes:</text>
85
- <text x="24.0" y="604" fill="#e06c6c" xml:space="preserve">- routes.medium Opus 5.5 · medium</text>
86
- <text x="24.0" y="623" fill="#87d787" xml:space="preserve">+ routes.medium Sonnet 5.5 · xhigh</text>
87
- <text x="24.0" y="642" fill="#d7af5f" xml:space="preserve">● 1 unsaved routing change </text>
88
- <rect x="242.4" y="628" width="62.4" height="18" rx="4" fill="#87afff"/>
89
- <text x="242.4" y="642" fill="#0d1016" font-weight="700" xml:space="preserve">[ Save ]</text>
90
- <rect x="312.6" y="628" width="85.8" height="18" rx="4" fill="#2e3340"/>
91
- <text x="312.6" y="642" fill="#d0d0d0" xml:space="preserve">[ Discard ]</text>
92
- <rect x="24.0" y="647" width="70.2" height="18" rx="4" fill="#2e3340"/>
93
- <text x="24.0" y="661" fill="#d0d0d0" xml:space="preserve">[ Close ]</text>
66
+ <text x="24.0" y="395" fill="#5fafd7" font-weight="700" xml:space="preserve">ACTIVITIES · routing shadow</text>
67
+ <text x="273.6" y="395" fill="#7c7c7c" xml:space="preserve">micro low medium high </text>
68
+ <text x="24.0" y="414" fill="#d0d0d0" xml:space="preserve"> base H·med H·high S·xh O·xh </text>
69
+ <text x="24.0" y="433" fill="#d0d0d0" xml:space="preserve"> code · S·med · O·max </text>
70
+ <text x="24.0" y="452" fill="#d0d0d0" xml:space="preserve"> debug plan review · S·med · · </text>
71
+ <text x="24.0" y="471" fill="#d0d0d0" xml:space="preserve"> explore ops · · S·med · </text>
72
+ <text x="24.0" y="490" fill="#d0d0d0" xml:space="preserve"> docs · S·med S·med · </text>
73
+ <text x="24.0" y="509" fill="#7c7c7c" xml:space="preserve"> 6 distinct routes = 6 caches once activity routing is on</text>
74
+ <text x="24.0" y="547" fill="#5fafd7" font-weight="700" xml:space="preserve">OVERRIDES</text>
75
+ <text x="94.2" y="547" fill="#7c7c7c" xml:space="preserve"> · applies next turn · edit, then Save</text>
76
+ <text x="24.0" y="566" fill="#d0d0d0" xml:space="preserve">Activity routing: shadow ▾</text>
77
+ <text x="242.4" y="566" fill="#7c7c7c" xml:space="preserve">asks and shows what on would do; tier routes run</text>
78
+ <text x="24.0" y="585" fill="#d0d0d0" xml:space="preserve">code</text>
79
+ <text x="102.0" y="585" fill="#5f9fe0" font-weight="700" xml:space="preserve">low</text>
80
+ <text x="164.4" y="585" fill="#d0d0d0" xml:space="preserve">Sonnet 5.5 ▾</text>
81
+ <text x="273.6" y="585" fill="#d0d0d0" xml:space="preserve">medium ▾</text>
82
+ <rect x="382.8" y="571" width="78.0" height="18" rx="4" fill="#2e3340"/>
83
+ <text x="382.8" y="585" fill="#d0d0d0" xml:space="preserve">[ remove ]</text>
84
+ <text x="24.0" y="604" fill="#d0d0d0" xml:space="preserve">code</text>
85
+ <text x="102.0" y="604" fill="#e0708a" font-weight="700" xml:space="preserve">high</text>
86
+ <text x="164.4" y="604" fill="#d0d0d0" xml:space="preserve">Opus 5.5 ▾</text>
87
+ <text x="273.6" y="604" fill="#d0d0d0" xml:space="preserve">max ▾</text>
88
+ <text x="367.2" y="604" fill="#d7af5f" xml:space="preserve">●</text>
89
+ <rect x="382.8" y="590" width="78.0" height="18" rx="4" fill="#2e3340"/>
90
+ <text x="382.8" y="604" fill="#d0d0d0" xml:space="preserve">[ remove ]</text>
91
+ <text x="460.8" y="604" fill="#d7af5f" xml:space="preserve"> new (model, effort) pair: one more cache</text>
92
+ <text x="24.0" y="623" fill="#d0d0d0" xml:space="preserve">debug</text>
93
+ <text x="102.0" y="623" fill="#5f9fe0" font-weight="700" xml:space="preserve">low</text>
94
+ <text x="164.4" y="623" fill="#d0d0d0" xml:space="preserve">Sonnet 5.5 ▾</text>
95
+ <text x="273.6" y="623" fill="#d0d0d0" xml:space="preserve">medium ▾</text>
96
+ <rect x="382.8" y="609" width="78.0" height="18" rx="4" fill="#2e3340"/>
97
+ <text x="382.8" y="623" fill="#d0d0d0" xml:space="preserve">[ remove ]</text>
98
+ <text x="24.0" y="642" fill="#d0d0d0" xml:space="preserve">explore</text>
99
+ <text x="102.0" y="642" fill="#d7af5f" font-weight="700" xml:space="preserve">medium</text>
100
+ <text x="164.4" y="642" fill="#d0d0d0" xml:space="preserve">Sonnet 5.5 ▾</text>
101
+ <text x="273.6" y="642" fill="#d0d0d0" xml:space="preserve">medium ▾</text>
102
+ <rect x="382.8" y="628" width="78.0" height="18" rx="4" fill="#2e3340"/>
103
+ <text x="382.8" y="642" fill="#d0d0d0" xml:space="preserve">[ remove ]</text>
104
+ <text x="24.0" y="661" fill="#d0d0d0" xml:space="preserve">plan</text>
105
+ <text x="102.0" y="661" fill="#5f9fe0" font-weight="700" xml:space="preserve">low</text>
106
+ <text x="164.4" y="661" fill="#d0d0d0" xml:space="preserve">Sonnet 5.5 ▾</text>
107
+ <text x="273.6" y="661" fill="#d0d0d0" xml:space="preserve">medium ▾</text>
108
+ <rect x="382.8" y="647" width="78.0" height="18" rx="4" fill="#2e3340"/>
109
+ <text x="382.8" y="661" fill="#d0d0d0" xml:space="preserve">[ remove ]</text>
110
+ <text x="24.0" y="680" fill="#d0d0d0" xml:space="preserve">review</text>
111
+ <text x="102.0" y="680" fill="#5f9fe0" font-weight="700" xml:space="preserve">low</text>
112
+ <text x="164.4" y="680" fill="#d0d0d0" xml:space="preserve">Sonnet 5.5 ▾</text>
113
+ <text x="273.6" y="680" fill="#d0d0d0" xml:space="preserve">medium ▾</text>
114
+ <rect x="382.8" y="666" width="78.0" height="18" rx="4" fill="#2e3340"/>
115
+ <text x="382.8" y="680" fill="#d0d0d0" xml:space="preserve">[ remove ]</text>
116
+ <text x="24.0" y="699" fill="#d0d0d0" xml:space="preserve">ops</text>
117
+ <text x="102.0" y="699" fill="#d7af5f" font-weight="700" xml:space="preserve">medium</text>
118
+ <text x="164.4" y="699" fill="#d0d0d0" xml:space="preserve">Sonnet 5.5 ▾</text>
119
+ <text x="273.6" y="699" fill="#d0d0d0" xml:space="preserve">medium ▾</text>
120
+ <rect x="382.8" y="685" width="78.0" height="18" rx="4" fill="#2e3340"/>
121
+ <text x="382.8" y="699" fill="#d0d0d0" xml:space="preserve">[ remove ]</text>
122
+ <text x="24.0" y="718" fill="#d0d0d0" xml:space="preserve">docs</text>
123
+ <text x="102.0" y="718" fill="#5f9fe0" font-weight="700" xml:space="preserve">low</text>
124
+ <text x="164.4" y="718" fill="#d0d0d0" xml:space="preserve">Sonnet 5.5 ▾</text>
125
+ <text x="273.6" y="718" fill="#d0d0d0" xml:space="preserve">medium ▾</text>
126
+ <rect x="382.8" y="704" width="78.0" height="18" rx="4" fill="#2e3340"/>
127
+ <text x="382.8" y="718" fill="#d0d0d0" xml:space="preserve">[ remove ]</text>
128
+ <text x="24.0" y="737" fill="#d0d0d0" xml:space="preserve">docs</text>
129
+ <text x="102.0" y="737" fill="#d7af5f" font-weight="700" xml:space="preserve">medium</text>
130
+ <text x="164.4" y="737" fill="#d0d0d0" xml:space="preserve">Sonnet 5.5 ▾</text>
131
+ <text x="273.6" y="737" fill="#d0d0d0" xml:space="preserve">medium ▾</text>
132
+ <rect x="382.8" y="723" width="78.0" height="18" rx="4" fill="#2e3340"/>
133
+ <text x="382.8" y="737" fill="#d0d0d0" xml:space="preserve">[ remove ]</text>
134
+ <text x="24.0" y="756" fill="#d0d0d0" xml:space="preserve">add an override… ▾</text>
135
+ <text x="24.0" y="794" fill="#5fafd7" font-weight="700" xml:space="preserve">POLICY</text>
136
+ <text x="70.8" y="794" fill="#7c7c7c" xml:space="preserve"> · applies next turn · edit, then Save</text>
137
+ <text x="24.0" y="813" fill="#d0d0d0" xml:space="preserve">Votes to go down</text>
138
+ <text x="180.0" y="813" fill="#d0d0d0" xml:space="preserve">2 ▾</text>
139
+ <text x="289.2" y="813" fill="#7c7c7c" xml:space="preserve">agreeing turns before cheaper</text>
140
+ <text x="24.0" y="832" fill="#d0d0d0" xml:space="preserve">Payback horizon</text>
141
+ <text x="180.0" y="832" fill="#d0d0d0" xml:space="preserve">5 turns ▾</text>
142
+ <text x="289.2" y="832" fill="#7c7c7c" xml:space="preserve">a switch repays its cache</text>
143
+ <text x="24.0" y="851" fill="#d0d0d0" xml:space="preserve">Credits cap</text>
144
+ <text x="180.0" y="851" fill="#d0d0d0" xml:space="preserve">$2.00 ▾</text>
145
+ <text x="289.2" y="851" fill="#7c7c7c" xml:space="preserve">max cold write on credits</text>
146
+ <rect x="24.0" y="856" width="218.4" height="18" rx="4" fill="#2e3340"/>
147
+ <text x="24.0" y="870" fill="#d0d0d0" xml:space="preserve">[ Reset policy to defaults ]</text>
148
+ <text x="24.0" y="908" fill="#5fafd7" font-weight="700" xml:space="preserve">CONFIG</text>
149
+ <text x="24.0" y="927" fill="#d0d0d0" xml:space="preserve">File ~/.claude/router.json </text>
150
+ <rect x="273.6" y="913" width="62.4" height="18" rx="4" fill="#2e3340"/>
151
+ <text x="273.6" y="927" fill="#d0d0d0" xml:space="preserve">[ copy ]</text>
152
+ <text x="24.0" y="946" fill="#7c7c7c" xml:space="preserve">Main conversation only. Subagents keep their own model.</text>
153
+ <text x="24.0" y="984" fill="#7c7c7c" xml:space="preserve">router.json changes:</text>
154
+ <text x="24.0" y="1003" fill="#e06c6c" xml:space="preserve">- routes.medium Opus 5.5 · medium</text>
155
+ <text x="24.0" y="1022" fill="#87d787" xml:space="preserve">+ routes.medium Sonnet 5.5 · xhigh</text>
156
+ <text x="24.0" y="1041" fill="#e06c6c" xml:space="preserve">- activities.code.high no override</text>
157
+ <text x="24.0" y="1060" fill="#87d787" xml:space="preserve">+ activities.code.high Opus 5.5 · max</text>
158
+ <text x="24.0" y="1079" fill="#d7af5f" xml:space="preserve">● 2 unsaved routing changes </text>
159
+ <rect x="250.2" y="1065" width="62.4" height="18" rx="4" fill="#87afff"/>
160
+ <text x="250.2" y="1079" fill="#0d1016" font-weight="700" xml:space="preserve">[ Save ]</text>
161
+ <rect x="320.4" y="1065" width="85.8" height="18" rx="4" fill="#2e3340"/>
162
+ <text x="320.4" y="1079" fill="#d0d0d0" xml:space="preserve">[ Discard ]</text>
163
+ <rect x="24.0" y="1084" width="70.2" height="18" rx="4" fill="#2e3340"/>
164
+ <text x="24.0" y="1098" fill="#d0d0d0" xml:space="preserve">[ Close ]</text>
94
165
  </svg>
@@ -30,15 +30,15 @@ Keys are stored as sensitive plugin options. Do not paste them into a model conv
30
30
 
31
31
  ## Read the status band
32
32
 
33
- Router draws one line above the prompt. The line ends with a **Router** button that opens the pane. When the band is narrow, the less important parts drop first: classifier figures, then context and cache, then the reason. The tier and model always stay, except behind a classifier warning: the warning and its **Set up** button come first, and the route gives way to them.
33
+ Router draws one line above the prompt. The line ends with a **Router** button that opens the pane. When the band is narrow, the less important parts drop first: classifier figures, then context and cache, then the activity, then the reason. The tier and model always stay, except behind a classifier warning: the warning and its **Set up** button come first, and the route gives way to them.
34
34
 
35
- ![Five band states: routed to high, two rows with the hover row, a pending pin, a missing classifier key, and routing off](router-band.svg)
35
+ ![Seven band states: routed to high, two rows with the hover row, a pending pin, a missing classifier key, routing off, an activity move with activity routing on, and an activity label in shadow](router-band.svg)
36
36
 
37
37
  Read the first line of the picture from left to right:
38
38
 
39
39
  - **Tier meter** `▂▄▆█`: one bar per tier, lit up to the current tier in its color, like signal strength.
40
- - **Tier and model**: the route for this turn. **fallback** means Claude Code answered with another model.
41
- - **Reason**: one or two words with a direction, such as `↑ jump`, `↓ downgrade`, `= fits`, or `… waiting to go down`.
40
+ - **Tier, activity, and model**: the route for this turn. The activity, such as `code →`, sits between the tier and the model; see [Route by activity](#route-by-activity). **fallback** means Claude Code answered with another model.
41
+ - **Reason**: one or two words with a direction, such as `↑ jump`, `↓ downgrade`, `= fits`, or `… waiting to go down`. An activity move reads `↗ code` or `↘ ops`, and a refused one `… ops: not worth a switch`.
42
42
  - **Classifier support**: what the active classifier, such as Jev or Clef Flash, gave the switch against the bar the policy required.
43
43
  - **ctx** and **cache**: context use and cache reuse on the last reply. They turn yellow at 60% context and red at 80%.
44
44
 
@@ -64,20 +64,20 @@ Tool continuations do not trigger another classification. Subagent choices remai
64
64
 
65
65
  Run `/router` or select **Router** above the prompt. Without a UI surface, as in `claude -p`, `/router` prints a short status instead. The pane has four tabs. Select a tab or press its digit while the pane has focus.
66
66
 
67
- ![The Now tab: the route and reason, classifier support per tier with pin buttons, recent replies by tier, and context, cache and cost](router-pane-now.svg)
67
+ ![The Now tab: the route, the activity and its alternatives, the reason, classifier support per tier with pin buttons, recent replies by tier and activity, and context, cache and cost](router-pane-now.svg)
68
68
 
69
- The **Now** tab answers "what runs next turn, and why". The ladder lists the tiers from strongest to cheapest with the route each one uses. The bar is the support the classifier gave that tier on the last turn. The line under the ladder compares the support for a switch with the bar the policy required and shows the estimated switch tax. **pin** forces that tier for the next turn only.
69
+ The **Now** tab answers "what runs next turn, and why". The ladder lists the tiers from strongest to cheapest with the route each one uses. The bar is the support the classifier gave that tier on the last turn. The line under the ladder compares the support for a switch with the bar the policy required and shows the estimated switch tax. **pin** forces that tier for the next turn only. The **Activity** and **Route** lines under the route are covered in [Route by activity](#route-by-activity).
70
70
 
71
- ![The Routing tab: model and effort per tier, the baseline tier, how each step up is priced, the policy controls, and the unsaved router.json change with Save and Discard](router-pane-routing.svg)
71
+ ![The Routing tab: model and effort per tier, the baseline tier, how each step up is priced, the activity matrix and overrides, the policy controls, and the unsaved router.json changes with Save and Discard](router-pane-routing.svg)
72
72
 
73
- The **Routing** tab edits the routes and the policy. In the picture, `medium` was changed to Sonnet 5.5 at `xhigh`: the tier shows **●**, the tab reads **Routing ●**, the switch-cost lines now price `medium → high` as a model change, and the status bar lists the one `router.json` line that **Save** will write. [Edit routes and policy](#edit-routes-and-policy) explains the controls.
73
+ The **Routing** tab edits the routes, the activity overrides, and the policy. In the picture, `medium` was changed to Sonnet 5.5 at `xhigh`: the tier shows **●**, the tab reads **Routing ●**, the switch-cost lines now price `medium → high` as a model change, and the status bar lists the `router.json` lines that **Save** will write. The same picture shows the activity matrix and overrides, with a `code` override at `high` added. [Edit routes and policy](#edit-routes-and-policy) explains the controls.
74
74
 
75
- | Tab | What it shows |
76
- | ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
77
- | 1 Now | The current tier, model, and reason; the classifier's support for each tier with a **pin** button; the last 30 replies by tier; context and cache. |
78
- | 2 Routing | The model and effort for each tier, the baseline tier, the cache cost of each step up; downgrade votes, payback horizon, and credits cap; the `router.json` path. |
79
- | 3 Classifier | The classifier rows with their credentials state, the active classifier's deadline and health, and the credentials each classifier needs. |
80
- | 4 Usage | Claude-reported cost, context and cache detail, input per reply, quota, and configured-price estimates. |
75
+ | Tab | What it shows |
76
+ | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
77
+ | 1 Now | The current tier, model, activity, and reason; the classifier's support for each tier with a **pin** button; the last 30 replies by tier and activity; context and cache. |
78
+ | 2 Routing | The model and effort for each tier, the baseline tier, the cache cost of each step up; the activity matrix and overrides; downgrade votes, payback horizon, and credits cap; the `router.json` path. |
79
+ | 3 Classifier | The classifier rows with their credentials state, the active classifier's deadline and health, and the credentials each classifier needs. |
80
+ | 4 Usage | Claude-reported cost, context and cache detail, input per reply, quota, activity counts for this session and across sessions, and configured-price estimates. |
81
81
 
82
82
  **Routing on** and **Routing off** stay at the top of every tab. **?** shows what the estimates leave out.
83
83
 
@@ -96,7 +96,7 @@ Every write applies from the next turn and can be undone. **Undo** (`u`) puts ba
96
96
  - **Context** compares the larger available context reading with the routed model's configured window. The router reserves 20% of that window. Values can be unknown when Claude does not provide the needed estimate.
97
97
  - **Cache** reuse is cache-read tokens divided by the last response's input counters.
98
98
  - **Classifier support**, such as **Jev support**, is the probability the classifier gave each tier on the last classified turn. The line under it compares the support for a switch with the bar the policy required, and shows the estimated switch tax.
99
- - **Replies** colors each of the last 30 main-conversation replies by the tier that served it. A dot marks a reply the router did not choose, such as one with routing off.
99
+ - **Replies** colors each of the last 30 main-conversation replies by the tier that served it. A dot marks a reply the router did not choose, such as one with routing off. When activity routing is on or in shadow, a row of letters under the strip names each reply's activity: `c` code, `d` debug, `e` explore, `p` plan, `r` review, `o` ops, `w` docs.
100
100
  - **Input per reply** scales the last 30 input sizes from the lowest to the highest reading. It is a scale comparison, not a forecast.
101
101
  - **Cache read benefit** is a configured-price estimate for cached reads before write costs. It is not a measured saving.
102
102
  - **Next-turn difference** compares the candidate with the current model under five-minute and one-hour cache-write scenarios. A negative number means the candidate is estimated to cost less for that request.
@@ -104,17 +104,65 @@ Every write applies from the next turn and can be undone. **Undo** (`u`) puts ba
104
104
 
105
105
  There is no router-side spend or savings ledger. The pane does not include classifier charges. Claude's native `/cost` is the source for its reported API cost.
106
106
 
107
+ ## Route by activity
108
+
109
+ 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:
110
+
111
+ | Activity | The turn produces |
112
+ | --------- | --------------------------------------------------------------- |
113
+ | `code` | Changed code or config, including tests |
114
+ | `debug` | A found cause: failing tests, stack traces, "why does X..." |
115
+ | `explore` | An answer: explain code, find where something happens, research |
116
+ | `plan` | A decision or plan: design, task breakdown, trade-offs |
117
+ | `review` | Findings about existing code: a PR, a diff, an audit |
118
+ | `ops` | Executed commands: git, builds, test runs, CI, deploys |
119
+ | `docs` | Prose for people: README, docs, comments, commit messages |
120
+
121
+ 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 activity routing on and the default overrides, a `low` coding turn runs on Sonnet 5.5 at `medium`, while a `low` git turn stays on Haiku 5.5 at `high`. [Configuration](configuration.md#activity-routing) has the full matrix and how to change it.
122
+
123
+ The mode decides what happens with the label:
124
+
125
+ | Mode | What the router does |
126
+ | -------- | ---------------------------------------------------------------------------------------------------------------------------------- |
127
+ | `off` | Asks nothing new. The routes are the tier routes. |
128
+ | `shadow` | The default. Shows the activity, records the stats, and works out what `on` would run. The tier route still runs; nothing changes. |
129
+ | `on` | Applies the activity overrides. This is opt-in: run `/router activities on`. |
130
+
131
+ In `shadow` you can see what `on` would do before you switch it on. The band marks the label `(shadow)` and dims it, and the **Now** tab says `low + code would use Sonnet 5.5 · medium (shadow; using Haiku 5.5 · high)`, or `same route` when both agree. In `on` the **Now** tab reads `low + code → Sonnet 5.5 · medium (override)` with the tier's base route next to it, or `(base)` when the cell has no override.
132
+
133
+ How the router moves inside a tier:
134
+
135
+ - It compares routes, not labels. If the new activity resolves to the route already running, nothing switches.
136
+ - 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.
137
+ - An activity applies only when the classifier gives it at least 60% probability (`policy.activityMass`). Below that, or on `uncertain`, the turn goes back to its tier's route, if the move passes the same checks. Tool continuations inside a turn keep the turn's route. When the classifier sees a new prompt as a continuation of the task, the activity may only move to a stronger route: `explore` can become `code`, but not the other way. Ollama does not answer the continuation question, so this rule does not apply to it.
138
+ - A pinned turn uses the pin's tier route and shows no activity.
139
+ - 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 `shadow` and `off` the tier route always runs, as in 1.5.
140
+ - 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` and `shadow` it does not.
141
+
142
+ 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.
143
+
144
+ ### Read the activity on the pane
145
+
146
+ - **Now**: the **Activity** line names the classifier's choice with its share and the two next-best answers, such as `code 84% debug 8% · plan 5%`. The **Route** line shows the route the cell resolves to. **Replies** has a letter row under the strip.
147
+ - **Routing**: the **ACTIVITIES** matrix shows the effective routes per tier, with `·` where a cell uses the tier's route, and counts the distinct routes, because each is its own cache. **OVERRIDES** lists each override with a model, an effort, and **remove**, plus a selector to add one and the mode selector. Edits join the routing draft: **Save** and **Discard** apply as for routes. Yellow notes flag an override with no effect (`same as base`), one stronger than the tier above, and one that adds a cache.
148
+ - **Usage**: **ACTIVITY · this session** lists turns, requests, and share per activity, the switches split by tier and by activity, and **Agreement**, how often the tools a turn used fit the classifier's activity (see [Evaluation](evaluation.md#tool-agreement)). In `shadow` the **Shadow** line counts how many turns `on` would have routed differently, such as `on would route 5 of 20 turns differently · est. −$0.300 … −$0.120 at list prices`. The estimate sums, over those turns, what the next request on the route `on` would use would cost against the route that ran, as a low and a high scenario at the configured list prices in `router.json`. Minus means cheaper. It covers only turns after a measured reply, and adds `for 3` when only three of the turns have one. It is not a measured saving.
149
+
150
+ **ACROSS SESSIONS · since the last reset** shows the counts kept across sessions: 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`), lateral switches taken and refused, and the **Shadow** line summed over all shadow turns. 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 after each turn. **Reset activity stats** clears the session counts and the counts kept across sessions.
151
+
152
+ `/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%)`.
153
+
107
154
  ## Change routing
108
155
 
109
- | Command or action | Result |
110
- | ---------------------------------------- | --------------------------------------------------------------------------------- |
111
- | `/router` | Open the pane. |
112
- | `/router auto` | Resume automatic routing. |
113
- | `/router off` | Turn routing off and keep Claude's selected model. |
114
- | `/router pin <micro\|low\|medium\|high>` | Pin the next turn and its tool continuations. Routing on must already be enabled. |
115
- | `/model <name>` | Select a model and turn routing off. Use `/router auto` to turn it back on. |
116
- | **Routing on** / **Routing off** | The same as `/router auto` and `/router off`. |
117
- | **pin** on the Now tab | Pin that tier for the next turn. Routing on must already be enabled. |
156
+ | Command or action | Result |
157
+ | ---------------------------------------- | --------------------------------------------------------------------------------------------------------- |
158
+ | `/router` | Open the pane. |
159
+ | `/router auto` | Resume automatic routing. |
160
+ | `/router off` | Turn routing off and keep Claude's selected model. |
161
+ | `/router pin <micro\|low\|medium\|high>` | Pin the next turn and its tool continuations. Routing on must already be enabled. |
162
+ | `/router activities <off\|shadow\|on>` | Set the [activity routing](#route-by-activity) mode. Saved to `router.json` at once; **Undo** reverts it. |
163
+ | `/model <name>` | Select a model and turn routing off. Use `/router auto` to turn it back on. |
164
+ | **Routing on** / **Routing off** | The same as `/router auto` and `/router off`. |
165
+ | **pin** on the Now tab | Pin that tier for the next turn. Routing on must already be enabled. |
118
166
 
119
167
  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 with routing on. A fresh session on any other model starts with routing off. `/clear` starts the new session with routing on. Resuming a saved session restores its saved routing on or off.
120
168
 
@@ -122,7 +170,7 @@ A pin does not change the next turn after the pinned turn finishes. A fresh sess
122
170
 
123
171
  On the **Routing** tab, pick a model and an effort for any tier. The model list comes from the aliases in `router.json` `models`, limited by the `availableModels` setting. `session` keeps the effort Claude Code sends. A model without effort levels, such as a custom one with `"efforts": []`, shows `none`.
124
172
 
125
- Changed tiers show **●**. **Reset routes to defaults** (`r`) loads the built-in routes into the draft; **Save** then removes your route overrides from `router.json`.
173
+ Changed tiers and overrides show **●**. **Reset routes to defaults** (`r`) loads the built-in routes into the draft; **Save** then removes your route overrides from `router.json`.
126
174
 
127
175
  **Switch cost** reads the draft from the bottom tier up and shows how the policy prices each step. A model change is priced as a cold cache write. An effort change on the same model is also priced as a new messages cache; whether the API actually keeps the cache across an effort change is not measured. Two identical tiers make that step change nothing.
128
176
 
@@ -132,7 +180,7 @@ A new model ID needs an entry in `router.json` `models` with its price, context
132
180
 
133
181
  Under **Policy** on the same tab, pick the values. One **Save** writes them with any route changes:
134
182
 
135
- - **Votes to go down:** 1, 2, or 3 consecutive votes before a cheaper tier.
183
+ - **Votes to go down:** 1, 2, or 3 consecutive votes before a cheaper tier. A new or reset history needs one.
136
184
  - **Payback horizon:** 1, 3, 5, or 10 later turns used by the downgrade estimate.
137
185
  - **Credits cap:** $0.50, $1, $2, or $5 for an estimated cold cache write on a `credits` model.
138
186
 
@@ -160,7 +208,7 @@ Select a row to switch. The choice is written to `router.json` at once and appli
160
208
  - **Health** shows recent failures or a pause. **Sends** names the service that receives prompt text.
161
209
  - **Credentials** lists what each classifier needs, such as `Jev: API key · Clef, Clef Flash: API token, account ID · OpenAI: API key · Ollama: no key needed`. **Edit** opens Claude Code's secure plugin configuration, where you enter them.
162
210
 
163
- **Sends** names the service that receives the prompt and recent dialogue. With Clef or Clef Flash that is Cloudflare, not typesafe.ai; with OpenAI it is OpenAI; with Ollama it stays on this machine. Give the Cloudflare token Workers AI permissions only.
211
+ With `shadow` or `on`, the activity question goes in the same request as the tier question (Ollama makes a second call), with the same text and nothing more. **Sends** names the service that receives the prompt and recent dialogue. With Clef or Clef Flash that is Cloudflare, not typesafe.ai; with OpenAI it is OpenAI; with Ollama it stays on this machine. Give the Cloudflare token Workers AI permissions only.
164
212
 
165
213
  The routing policy thresholds were tuned against Jev's probabilities. Clef's, OpenAI's, and Ollama's probabilities have not been compared with Jev's, so the same prompt can switch tiers at a different point. Watch **Classifier support** for a few sessions before you rely on a new classifier.
166
214