@alexeiled/claude-router 1.11.0 → 1.12.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.
- package/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +18 -0
- package/README.md +1 -1
- package/docs/activity-routing.md +3 -3
- package/docs/architecture.md +3 -3
- package/docs/evaluation.md +7 -7
- package/docs/native-router.md +5 -5
- package/docs/router-pane-now.svg +6 -4
- package/docs/router-pane-usage-whatif.svg +133 -0
- package/docs/router-pane-usage.svg +100 -87
- package/docs/user-guide.md +39 -17
- package/hooks/native-router.mjs +142 -33
- package/lib/display.mjs +5 -4
- package/lib/panel.mjs +525 -376
- package/lib/savings.mjs +8 -23
- package/lib/usage.mjs +399 -0
- package/lib/view.mjs +11 -0
- package/package.json +1 -1
- package/types/index.d.ts +34 -7
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 688 781" role="img" aria-labelledby="title desc">
|
|
2
2
|
<title id="title">Router pane, Usage tab</title>
|
|
3
|
-
<desc id="desc">The
|
|
3
|
+
<desc id="desc">The last 7 days across sessions: the period row, routing saved against each session’s own model as a ledger (your model, cheaper models, stronger models, switch cache writes, routed), the replies and tokens, the cost by activity with coding 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="
|
|
9
|
-
<rect x="10" y="10" width="
|
|
8
|
+
<rect width="688" height="781" rx="8" fill="#1c1c1c"/>
|
|
9
|
+
<rect x="10" y="10" width="668" height="761" rx="6" fill="none" stroke="#3f5f8f"/>
|
|
10
10
|
<text x="24.0" y="34" fill="#5fafd7" font-weight="700" xml:space="preserve">ROUTING</text>
|
|
11
11
|
<rect x="94.2" y="20" width="62.4" height="18" rx="4" fill="#87afff"/>
|
|
12
12
|
<text x="94.2" y="34" fill="#0d1016" font-weight="700" xml:space="preserve">[ ◉ on ]</text>
|
|
@@ -25,87 +25,100 @@
|
|
|
25
25
|
<text x="375.0" y="53" fill="#0d1016" font-weight="700" xml:space="preserve">[ Usage ]</text>
|
|
26
26
|
<rect x="453.0" y="39" width="39.0" height="18" rx="4" fill="#2e3340"/>
|
|
27
27
|
<text x="453.0" y="53" fill="#d0d0d0" xml:space="preserve">[ ? ]</text>
|
|
28
|
-
<
|
|
29
|
-
<text x="
|
|
30
|
-
<
|
|
31
|
-
<text x="
|
|
32
|
-
<
|
|
33
|
-
<text x="
|
|
34
|
-
<
|
|
35
|
-
<text x="
|
|
36
|
-
<
|
|
37
|
-
<text x="
|
|
38
|
-
<
|
|
39
|
-
<text x="
|
|
40
|
-
<text x="
|
|
41
|
-
<text x="
|
|
42
|
-
<text x="
|
|
43
|
-
<text x="
|
|
44
|
-
<text x="
|
|
45
|
-
<text x="
|
|
46
|
-
<text x="
|
|
47
|
-
<text x="
|
|
48
|
-
<text x="
|
|
49
|
-
<text x="
|
|
50
|
-
<text x="
|
|
51
|
-
<text x="
|
|
52
|
-
<text x="
|
|
53
|
-
<text x="
|
|
54
|
-
<text x="
|
|
55
|
-
<text x="
|
|
56
|
-
<text x="
|
|
57
|
-
<text x="
|
|
58
|
-
<text x="
|
|
59
|
-
<text x="
|
|
60
|
-
<text x="
|
|
61
|
-
<text x="
|
|
62
|
-
<text x="
|
|
63
|
-
<text x="
|
|
64
|
-
<text x="
|
|
65
|
-
<text x="
|
|
66
|
-
<
|
|
67
|
-
<text x="55.2" y="338" fill="#
|
|
68
|
-
<
|
|
69
|
-
<text x="156.6" y="338" fill="#
|
|
70
|
-
<
|
|
71
|
-
<text x="
|
|
72
|
-
<text x="
|
|
73
|
-
<text x="
|
|
74
|
-
<text x="
|
|
75
|
-
<text x="
|
|
76
|
-
<text x="
|
|
77
|
-
<text x="
|
|
78
|
-
<text x="
|
|
79
|
-
<text x="
|
|
80
|
-
<text x="
|
|
81
|
-
<text x="
|
|
82
|
-
<text x="
|
|
83
|
-
<text x="
|
|
84
|
-
<text x="
|
|
85
|
-
<text x="
|
|
86
|
-
<text x="39.6" y="
|
|
87
|
-
<text x="
|
|
88
|
-
<text x="211.2" y="
|
|
89
|
-
<text x="
|
|
90
|
-
<text x="
|
|
91
|
-
<text x="
|
|
92
|
-
<text x="
|
|
93
|
-
<text x="
|
|
94
|
-
<text x="
|
|
95
|
-
<text x="
|
|
96
|
-
<text x="
|
|
97
|
-
<text x="
|
|
98
|
-
<text x="
|
|
99
|
-
<text x="
|
|
100
|
-
<text x="
|
|
101
|
-
<text x="
|
|
102
|
-
<text x="
|
|
103
|
-
<
|
|
104
|
-
<
|
|
105
|
-
<
|
|
106
|
-
<text x="24.0" y="
|
|
107
|
-
<text x="
|
|
108
|
-
<text x="
|
|
109
|
-
<
|
|
110
|
-
<text x="
|
|
28
|
+
<rect x="24.0" y="77" width="85.8" height="18" rx="4" fill="#2e3340"/>
|
|
29
|
+
<text x="24.0" y="91" fill="#d0d0d0" xml:space="preserve">[ Session ]</text>
|
|
30
|
+
<rect x="117.6" y="77" width="70.2" height="18" rx="4" fill="#2e3340"/>
|
|
31
|
+
<text x="117.6" y="91" fill="#d0d0d0" xml:space="preserve">[ Today ]</text>
|
|
32
|
+
<rect x="195.6" y="77" width="46.8" height="18" rx="4" fill="#87afff"/>
|
|
33
|
+
<text x="195.6" y="91" fill="#0d1016" font-weight="700" xml:space="preserve">[ 7d ]</text>
|
|
34
|
+
<rect x="250.2" y="77" width="54.6" height="18" rx="4" fill="#2e3340"/>
|
|
35
|
+
<text x="250.2" y="91" fill="#d0d0d0" xml:space="preserve">[ 30d ]</text>
|
|
36
|
+
<rect x="312.6" y="77" width="70.2" height="18" rx="4" fill="#2e3340"/>
|
|
37
|
+
<text x="312.6" y="91" fill="#d0d0d0" xml:space="preserve">[ Month ]</text>
|
|
38
|
+
<rect x="390.6" y="77" width="54.6" height="18" rx="4" fill="#2e3340"/>
|
|
39
|
+
<text x="390.6" y="91" fill="#d0d0d0" xml:space="preserve">[ All ]</text>
|
|
40
|
+
<text x="453.0" y="91" fill="#7c7c7c" xml:space="preserve"> p next</text>
|
|
41
|
+
<text x="24.0" y="110" fill="#7c7c7c" xml:space="preserve">all sessions · Oct 7 – Oct 13 · each session vs its own model</text>
|
|
42
|
+
<text x="24.0" y="148" fill="#d0d0d0" xml:space="preserve">Routing saved </text>
|
|
43
|
+
<text x="133.2" y="148" fill="#6fcf97" font-weight="700" xml:space="preserve">$7.96 (46%)</text>
|
|
44
|
+
<text x="219.0" y="148" fill="#d0d0d0" xml:space="preserve"> vs your model</text>
|
|
45
|
+
<text x="55.2" y="186" fill="#d0d0d0" xml:space="preserve">Your model</text>
|
|
46
|
+
<text x="211.2" y="186" fill="#d0d0d0" xml:space="preserve"> $17.20</text>
|
|
47
|
+
<text x="304.8" y="186" fill="#7c7c7c" xml:space="preserve">each session’s own model</text>
|
|
48
|
+
<text x="24.0" y="205" fill="#7c7c7c" xml:space="preserve"> − </text>
|
|
49
|
+
<text x="55.2" y="205" fill="#d0d0d0" xml:space="preserve">Cheaper models</text>
|
|
50
|
+
<text x="211.2" y="205" fill="#6fcf97" xml:space="preserve"> $8.29</text>
|
|
51
|
+
<text x="24.0" y="224" fill="#7c7c7c" xml:space="preserve"> + </text>
|
|
52
|
+
<text x="55.2" y="224" fill="#d0d0d0" xml:space="preserve">Stronger models</text>
|
|
53
|
+
<text x="211.2" y="224" fill="#d0d0d0" xml:space="preserve"> $0.00</text>
|
|
54
|
+
<text x="24.0" y="243" fill="#7c7c7c" xml:space="preserve"> + </text>
|
|
55
|
+
<text x="55.2" y="243" fill="#d0d0d0" xml:space="preserve">Switch cache writes</text>
|
|
56
|
+
<text x="211.2" y="243" fill="#f0b429" xml:space="preserve"> $0.33</text>
|
|
57
|
+
<text x="304.8" y="243" fill="#7c7c7c" xml:space="preserve">21 route switches · 4% of the saving</text>
|
|
58
|
+
<text x="24.0" y="262" fill="#7c7c7c" xml:space="preserve"> = </text>
|
|
59
|
+
<text x="55.2" y="262" fill="#d0d0d0" font-weight="700" xml:space="preserve">Routed</text>
|
|
60
|
+
<text x="211.2" y="262" fill="#d0d0d0" font-weight="700" xml:space="preserve"> $9.24</text>
|
|
61
|
+
<text x="304.8" y="262" fill="#5fafd7" xml:space="preserve">████████████</text>
|
|
62
|
+
<text x="398.4" y="262" fill="#7c7c7c" xml:space="preserve">░░░░░░░░░░</text>
|
|
63
|
+
<text x="476.4" y="262" fill="#7c7c7c" xml:space="preserve"> 54% of your model</text>
|
|
64
|
+
<text x="24.0" y="300" fill="#7c7c7c" xml:space="preserve"> 141 replies · 47 turns · input 9.73M · cache hit 90% · output 126.9K</text>
|
|
65
|
+
<text x="24.0" y="338" fill="#5fafd7" font-weight="700" xml:space="preserve">BY </text>
|
|
66
|
+
<rect x="55.2" y="324" width="93.6" height="18" rx="4" fill="#87afff"/>
|
|
67
|
+
<text x="55.2" y="338" fill="#0d1016" font-weight="700" xml:space="preserve">[ Activity ]</text>
|
|
68
|
+
<rect x="156.6" y="324" width="70.2" height="18" rx="4" fill="#2e3340"/>
|
|
69
|
+
<text x="156.6" y="338" fill="#d0d0d0" xml:space="preserve">[ Model ]</text>
|
|
70
|
+
<rect x="234.6" y="324" width="62.4" height="18" rx="4" fill="#2e3340"/>
|
|
71
|
+
<text x="234.6" y="338" fill="#d0d0d0" xml:space="preserve">[ Tier ]</text>
|
|
72
|
+
<text x="304.8" y="338" fill="#7c7c7c" xml:space="preserve"> g next</text>
|
|
73
|
+
<text x="24.0" y="357" fill="#7c7c7c" xml:space="preserve"> replies cost vs yours mostly on</text>
|
|
74
|
+
<text x="39.6" y="376" fill="#d0d0d0" xml:space="preserve">▾</text>
|
|
75
|
+
<text x="55.2" y="376" fill="#d7875f" font-style="italic" xml:space="preserve">coding</text>
|
|
76
|
+
<text x="211.2" y="376" fill="#d0d0d0" xml:space="preserve"> 83 $7.74</text>
|
|
77
|
+
<text x="351.6" y="376" fill="#6fcf97" xml:space="preserve"> −$3.05</text>
|
|
78
|
+
<text x="437.4" y="376" fill="#7c7c7c" xml:space="preserve"> Sonnet 5.5 · high</text>
|
|
79
|
+
<text x="70.8" y="395" fill="#d0d0d0" xml:space="preserve">Sonnet 5.5 · high</text>
|
|
80
|
+
<text x="211.2" y="395" fill="#d0d0d0" xml:space="preserve"> 61 $4.88</text>
|
|
81
|
+
<text x="351.6" y="395" fill="#6fcf97" xml:space="preserve"> −$3.05</text>
|
|
82
|
+
<text x="70.8" y="414" fill="#d0d0d0" xml:space="preserve">Opus 5.5 · xhigh</text>
|
|
83
|
+
<text x="211.2" y="414" fill="#d0d0d0" xml:space="preserve"> 22 $2.86</text>
|
|
84
|
+
<text x="351.6" y="414" fill="#d0d0d0" xml:space="preserve"> $0.00</text>
|
|
85
|
+
<text x="24.0" y="433" fill="#7c7c7c" xml:space="preserve"> cheaper −$3.17 · stronger $0.00 · switch +$0.12 · input 5.73M · output 74.7K</text>
|
|
86
|
+
<text x="39.6" y="452" fill="#d0d0d0" xml:space="preserve">▸</text>
|
|
87
|
+
<text x="55.2" y="452" fill="#d7875f" font-style="italic" xml:space="preserve">running</text>
|
|
88
|
+
<text x="211.2" y="452" fill="#d0d0d0" xml:space="preserve"> 25 $0.75</text>
|
|
89
|
+
<text x="351.6" y="452" fill="#6fcf97" xml:space="preserve"> −$2.25</text>
|
|
90
|
+
<text x="437.4" y="452" fill="#7c7c7c" xml:space="preserve"> Haiku 5.5 · high</text>
|
|
91
|
+
<text x="39.6" y="471" fill="#d0d0d0" xml:space="preserve">▸</text>
|
|
92
|
+
<text x="55.2" y="471" fill="#d7875f" font-style="italic" xml:space="preserve">exploring</text>
|
|
93
|
+
<text x="211.2" y="471" fill="#d0d0d0" xml:space="preserve"> 22 $0.62</text>
|
|
94
|
+
<text x="351.6" y="471" fill="#6fcf97" xml:space="preserve"> −$1.80</text>
|
|
95
|
+
<text x="437.4" y="471" fill="#7c7c7c" xml:space="preserve"> Haiku 5.5 · high</text>
|
|
96
|
+
<text x="39.6" y="490" fill="#d0d0d0" xml:space="preserve">▸</text>
|
|
97
|
+
<text x="55.2" y="490" fill="#d7875f" font-style="italic" xml:space="preserve">planning</text>
|
|
98
|
+
<text x="211.2" y="490" fill="#d0d0d0" xml:space="preserve"> 11 $0.13</text>
|
|
99
|
+
<text x="351.6" y="490" fill="#6fcf97" xml:space="preserve"> −$0.86</text>
|
|
100
|
+
<text x="437.4" y="490" fill="#7c7c7c" xml:space="preserve"> Haiku 5.5 · low</text>
|
|
101
|
+
<text x="24.0" y="528" fill="#5fafd7" font-weight="700" xml:space="preserve">COST BY DAY </text>
|
|
102
|
+
<text x="117.6" y="528" fill="#5fafd7" xml:space="preserve">▆█▂·▇█▆</text>
|
|
103
|
+
<text x="172.2" y="528" fill="#7c7c7c" xml:space="preserve"> peak $2.13 </text>
|
|
104
|
+
<rect x="289.2" y="514" width="85.8" height="18" rx="4" fill="#2e3340"/>
|
|
105
|
+
<text x="289.2" y="528" fill="#d0d0d0" xml:space="preserve">[ What if ]</text>
|
|
106
|
+
<text x="24.0" y="566" fill="#5fafd7" font-weight="700" xml:space="preserve">WORTH A LOOK</text>
|
|
107
|
+
<text x="117.6" y="566" fill="#7c7c7c" xml:space="preserve"> · from the numbers; answer quality is not measured</text>
|
|
108
|
+
<text x="39.6" y="585" fill="#d7875f" font-style="italic" xml:space="preserve">coding</text>
|
|
109
|
+
<text x="86.4" y="585" fill="#7c7c7c" xml:space="preserve"> · </text>
|
|
110
|
+
<text x="109.8" y="585" fill="#d7af5f" font-weight="700" xml:space="preserve">medium</text>
|
|
111
|
+
<text x="156.6" y="585" fill="#d0d0d0" xml:space="preserve"> carried 53% of the cost</text>
|
|
112
|
+
<text x="343.8" y="585" fill="#7c7c7c" xml:space="preserve"> · mostly Sonnet 5.5 · high</text>
|
|
113
|
+
<rect x="570.0" y="571" width="78.0" height="18" rx="4" fill="#2e3340"/>
|
|
114
|
+
<text x="570.0" y="585" fill="#d0d0d0" xml:space="preserve">[ Routes ]</text>
|
|
115
|
+
<text x="24.0" y="623" fill="#5fafd7" font-weight="700" xml:space="preserve">SUBAGENTS · across sessions</text>
|
|
116
|
+
<text x="234.6" y="623" fill="#7c7c7c" xml:space="preserve"> subagent routing on</text>
|
|
117
|
+
<text x="24.0" y="642" fill="#7c7c7c" xml:space="preserve"> no subagents yet</text>
|
|
118
|
+
<text x="24.0" y="680" fill="#7c7c7c" xml:space="preserve"> API list prices · same tokens and output length · not a bill;</text>
|
|
119
|
+
<text x="24.0" y="699" fill="#7c7c7c" xml:space="preserve"> on a Claude plan it stands for quota · answer quality not measured</text>
|
|
120
|
+
<rect x="24.0" y="723" width="140.4" height="18" rx="4" fill="#2e3340"/>
|
|
121
|
+
<text x="24.0" y="737" fill="#7c7c7c" xml:space="preserve">[ Delete history ]</text>
|
|
122
|
+
<rect x="24.0" y="742" width="70.2" height="18" rx="4" fill="#2e3340"/>
|
|
123
|
+
<text x="24.0" y="756" fill="#d0d0d0" xml:space="preserve">[ Close ]</text>
|
|
111
124
|
</svg>
|
package/docs/user-guide.md
CHANGED
|
@@ -71,13 +71,13 @@ Run `/router` or select **Router** above the prompt. Without a UI surface, as in
|
|
|
71
71
|
| 2 Routes | Which model runs: one grid of tiers by activities, the activity routing mode, and an editor for the selected cell. |
|
|
72
72
|
| 3 Policy | How readily the router changes models: the start tier, going down, going up, the activity threshold, the credits cap; the `router.json` path. |
|
|
73
73
|
| 4 Classifier | Which classifier to ask: one row per classifier to compare, the active one's deadline, wait, health and credentials, and the counts kept across sessions. |
|
|
74
|
-
| 5 Usage | What routing cost
|
|
74
|
+
| 5 Usage | What routing cost against your model this session, today, over 7 or 30 days, this month or in all: by activity, model or tier, and what is worth a look. |
|
|
75
75
|
|
|
76
76
|
The top line of every tab, `ROUTING [ ◉ 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. **?** shows what the estimates leave out. When routing is unavailable, the top line reads `ROUTING unavailable Claude’s model is kept` with the reason under it, and offers no on or off: see [Troubleshooting](#troubleshooting).
|
|
77
77
|
|
|
78
78
|

|
|
79
79
|
|
|
80
|
-
The **Now** tab answers "what runs next turn, and why". **Next turn** names the tier, the model and effort, and, when an activity override runs, the tier's own model beside it. **Activity** names the classifier's activity as a verb, such as `coding 84%`, with the two next answers and the threshold at which an activity applies. **Why** gives the reason; under it, `Jev gave stronger tiers 88% (needs 82%) · switch ≈ $0.48` compares the classifier's support for the switch with the bar the policy set, and gives the estimated switch cost. The ladder lists the tiers from strongest to cheapest with the route each one uses and the support the classifier gave it on the last turn. **pin** forces that tier for the next turn only.
|
|
80
|
+
The **Now** tab answers "what runs next turn, and why". **Next turn** names the tier, the model and effort, and, when an activity override runs, the tier's own model beside it. **Activity** names the classifier's activity as a verb, such as `coding 84%`, with the two next answers and the threshold at which an activity applies. **Why** gives the reason; under it, `Jev gave stronger tiers 88% (needs 82%) · switch ≈ $0.48` compares the classifier's support for the switch with the bar the policy set, and gives the estimated switch cost. The ladder lists the tiers from strongest to cheapest with the route each one uses and the support the classifier gave it on the last turn. **pin** forces that tier for the next turn only. The last lines give the context gauge, the cache reuse and the cost Claude reports; **details** adds the counters and estimates in [Understand usage and estimates](#understand-usage-and-estimates).
|
|
81
81
|
|
|
82
82
|
### Save and undo changes
|
|
83
83
|
|
|
@@ -90,23 +90,44 @@ Every write applies from the next turn and can be undone. **Undo** (`u`) puts ba
|
|
|
90
90
|
|
|
91
91
|
### Compare routing with your model
|
|
92
92
|
|
|
93
|
-

|
|
94
94
|
|
|
95
|
-
The Usage tab
|
|
95
|
+
The Usage tab answers what routing cost against your model. Your model is the model `/model` (or `--model`) selected, at the session effort, when a reply ran. The router prices each routed reply's tokens twice at the list prices in `router.json`: on the model that served it, and on your model.
|
|
96
96
|
|
|
97
|
-
|
|
98
|
-
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
99
|
-
| Routed replies | What the routed replies cost on the models that served them. |
|
|
100
|
-
| Same tokens on your model | What the same input and output tokens cost on your model, with one cache that never switched. |
|
|
101
|
-
| Difference | Routed minus yours. Green with a percentage when routing cost less; amber with `+$` when it cost more, `×N` once it is twice yours or more. |
|
|
102
|
-
| cheaper models | The part from replies on models cheaper than yours. |
|
|
103
|
-
| stronger than yours | The part from replies on stronger models, with how many replies ran on them. |
|
|
104
|
-
| cache writes from switches | The part from rewriting the prompt cache after model switches. |
|
|
97
|
+
The top row picks the period: **Session**, **Today**, **7d** (today and the six days before), **30d**, **Month** (since the first of this month) and **All**. Press `p` for the next one. The pane remembers the choice across sessions. Session holds this session's replies, and the line under the row names your model, or every model when `/model` changed during the session. The other periods add up the replies of every session on those calendar days. Each session counts against its own model, and the line reads `all sessions · Oct 7 – Oct 13 · each session vs its own model`.
|
|
105
98
|
|
|
106
|
-
The
|
|
99
|
+
The answer comes first: `Routing saved $7.96 (46%) vs your model`, or `Routing cost $2.48 (×5.0) more than your model`. Below 10 routed replies it adds `early sample`, because one switch and its cache write can decide a short run. The ledger under it adds up to the routed cost in whole cents:
|
|
100
|
+
|
|
101
|
+
| Line | What it is |
|
|
102
|
+
| --------------------- | ---------------------------------------------------------------------------------------------- |
|
|
103
|
+
| Your model | What the same input and output tokens cost on your model, with one cache that never switched. |
|
|
104
|
+
| − Cheaper models | What routing saved on replies that ran on models cheaper than yours. |
|
|
105
|
+
| + Stronger models | What replies on models stronger than yours cost on top. |
|
|
106
|
+
| + Switch cache writes | What rewriting the prompt cache after a model switch cost, and its share of the saving. |
|
|
107
|
+
| = Routed | What the routed replies cost, with a bar against your model: `54% of your model`, or `×2.1`. |
|
|
108
|
+
|
|
109
|
+
A line of counts follows: 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.
|
|
110
|
+
|
|
111
|
+
**BY** splits the period's cost by **Activity**, **Model** or **Tier**. Press `g` for the next grouping. Each row gives the replies, the routed cost and `vs yours`, the difference against your model. The last column is the route most of the row's replies used, or, by model, the row's share of the cost. Select **▸** to open a row. An activity lists its routes, and a model or a tier lists its activities. A line under them gives the row's cheaper, stronger and switch parts and its tokens. A narrow pane drops the last column first.
|
|
112
|
+
|
|
113
|
+
The next line draws the routed cost as blocks: **COST BY HOUR** over today's hours for Session and Today, **COST BY WEEK** for a period longer than 45 days, and **COST BY DAY** otherwise. A dot is a bucket without replies. **What if** (`c`) shows instead the period's tokens priced on each model alone, beside the routed cost and your model. It answers whether a cheaper default would have cost less than routing. A model without a price for some reply is left out. **Trend** (`c`) goes back.
|
|
114
|
+
|
|
115
|
+
From 20 routed replies in the period, **WORTH A LOOK** lists up to three findings:
|
|
116
|
+
|
|
117
|
+
- the activity and tier that carried a quarter or more of the cost
|
|
118
|
+
- the switch cache writes, when they used 15% or more of the cheaper-model saving
|
|
119
|
+
- the activity and tier that ran most above your model
|
|
120
|
+
|
|
121
|
+
Each line has a button to the tab that changes it. **Routes** opens that cell in the grid, and **Policy** the switching thresholds. The tab never says which model to use, because it does not measure answer quality.
|
|
122
|
+
|
|
123
|
+
**All** also counts the totals that earlier versions kept without dates, and says so: `includes $4.10 routed before dated records, kept without a breakdown`. The breakdown and the trend start at the first dated day. The router keeps the daily records for 400 days.
|
|
124
|
+
|
|
125
|
+
**Delete history**, at the bottom, asks once more, then deletes the usage, activity and subagent records of every session and clears this session's counts. Nothing brings them back. To look at a shorter span, pick a period instead.
|
|
107
126
|
|
|
108
127
|
These are estimates, not a bill. They hold the tokens and the output length the same, although another model may write more or less, and they do not measure answer quality. On a Claude plan the dollars stand for quota. Your model's cache reads the previous prompt inside the cache lifetime Claude Code uses, one hour on a Claude plan, and never less than the API actually read. A route that changes only the effort, such as Opus at `xhigh` to Opus at `medium`, costs no less per token: it shows only its cache writes. [Evaluation](evaluation.md#routing-vs-your-model) explains the method.
|
|
109
128
|
|
|
129
|
+

|
|
130
|
+
|
|
110
131
|
### Understand usage and estimates
|
|
111
132
|
|
|
112
133
|
- **Cost** comes from Claude Code's native usage API. If the account is on a plan, a configured list-price estimate is not the subscription cash charge.
|
|
@@ -114,12 +135,12 @@ These are estimates, not a bill. They hold the tokens and the output length the
|
|
|
114
135
|
- **Cache** reuse is cache-read tokens divided by the last response's input counters.
|
|
115
136
|
- **Classifier support**, such as **Jev support**, is the probability the classifier gave each tier on the last classified turn. The line under **Why** compares the support for a switch with the bar the policy required, and shows the estimated switch cost.
|
|
116
137
|
- **Last replies** on the Now tab 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. The heading counts the model switches between those replies: a change of model or effort, so a move from Sonnet to Haiku inside `low` counts too, although its color stays. Under the strip, the replies per tier, `■ low 12 ■ medium 2 ■ high 6`, double as the color key, and the replies per activity follow, such as `coding 12 · exploring 4 · running 2`.
|
|
117
|
-
- **Input per reply**, under **details** on the
|
|
138
|
+
- **Input per reply**, under **details** on the Now tab, scales the last 30 input sizes from the lowest to the highest reading. It is a scale comparison, not a forecast.
|
|
118
139
|
- **Cache hits saved** is a configured-price estimate for cached reads before write costs. It is not a measured saving.
|
|
119
140
|
- **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.
|
|
120
141
|
- **Payback** estimates later turns to recover an initial difference under assumed future cache reads and the last observed output size. It does not guarantee savings.
|
|
121
142
|
|
|
122
|
-
|
|
143
|
+
On the Usage tab, **SUBAGENTS · across sessions** shows each routed agent type, what routing cost against the model Claude Code would have used, and the spawns that passed through (see [Subagent routing](configuration.md#subagent-routing)). Plan quota is not on the pane: Claude Code shows it in `/usage`. 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.
|
|
123
144
|
|
|
124
145
|
The router keeps no bill. Routing vs your model is an estimate at configured list prices. The pane does not include classifier charges. Claude's native `/cost` is the source for its reported API cost.
|
|
125
146
|
|
|
@@ -182,9 +203,10 @@ These thresholds are starting values. They are not tuned on data yet.
|
|
|
182
203
|
|
|
183
204
|
- **Now**: the **Activity** line names the classifier's choice as a verb with its share, the two next-best answers, and the threshold at which an activity applies, such as `coding 84% debugging 8% · planning 5% applies at 60%+`. An `uncertain` answer is shown dim: it applies no activity. In `on`, **Why** names the cell when the activity moved the route or the route is an override, such as `coding at low runs on Sonnet 5.5 · high`, or `low runs on its base route, Haiku 5.5 · high` for a move without an activity; a refused move, a hold, or a tier change keeps its reason. **Last replies** counts the replies per activity under the strip.
|
|
184
205
|
- **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.
|
|
185
|
-
- **Usage**: **BY
|
|
206
|
+
- **Usage**: **BY** with **Activity** lists the period's replies, cost and difference against your model 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 ledger's switch line counts the route switches by tier and by activity together. See [Compare routing with your model](#compare-routing-with-your-model).
|
|
207
|
+
- **Classifier**: **THIS SESSION** gives **Agreement**, how often the tools a turn used fit the classifier's activity (see [Evaluation](evaluation.md#tool-agreement)).
|
|
186
208
|
|
|
187
|
-
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. **
|
|
209
|
+
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.
|
|
188
210
|
|
|
189
211
|
`/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 against your model, such as `vs your model (Opus 5.5 · xhigh): −$1.84 (−22%) this session, 64 replies, est. at list prices`.
|
|
190
212
|
|