Evals
The unit tests in hooks/ cover the report: given a transcript, does the maths come out right. They say nothing about the half of this plugin that is prose - whether the routing guidance actually changes what a session does. That is what these cases are for, and until they existed the README's admission that there is no control group was simply true.
The one thing that makes this a measurement
Every case runs twice: once with the plugin loaded, once without. A number from the with-arm alone means nothing, because a capable model routes sensibly on its own a fair share of the time. The delta between the arms is the claim.
answers-codebase-question-inline (named delegates-codebase-question up to 0.16) is scored on two graders both arms can genuinely pass or fail - did the session keep the question in the main session, and did the answer come back right. Up to 0.16 the first grader was inverted: it rewarded handing the question to a subagent, and a third grader checked the with-arm picked scout. The results below were measured under that version.
Running them
claude plugin eval is the harness these cases are written for:
claude plugin eval model-routing --ablation with-withoutIt is early access and gated per organization; on a machine where the gate is closed it prints `plugin eval` is currently in early access and exits 1. Until then, run-local.mjs reads the same case files and does the same two-arm run through claude -p:
node evals/run-local.mjs --runs 3 --model opus
node evals/run-local.mjs --runs 1 --model haiku --arm without # smoke testThe baseline arm is made plugin-free by dropping the user's own settings (--setting-sources ""), since enabledPlugins is where a globally installed copy of this plugin would otherwise sneak into both arms. Verify that in a trace before trusting a run: the system/init event lists the available agents, and the baseline's list must not contain any model-routing:* entry.
Runs are real sessions against the real API, so they cost real tokens. Traces and an aggregate.json land in evals/results/<timestamp>/, which is gitignored; the aggregates behind every number published here are copied into evidence/, which is not.
The first result
Opus main session, 3 runs per arm, 2026-08-17:
| Grader | With | Without | Delta |
|---|---|---|---|
| delegated to a subagent | 3/3 | 0/3 | +1.00 |
| answer is correct | 3/3 | 3/3 | 0.00 |
| scout was the agent (indicator) | 3/3 | 0/3 | - |
Up to 0.16 the guidance changed what the session did, cleanly and every time - the arms separate perfectly, and the baseline is not a straw man: it had Explore available and still chose to grep inline. That is the control-group number the README did not have.
What it costs, per run, split by tier because the total hides the point:
| With | Without | |
|---|---|---|
| opus (the expensive tier) | $0.140, 59k in | $0.135, 90k in |
| the subagent | sonnet-5 $0.065, 94k in | - |
| total | $0.206 | $0.136 |
| wall clock | 31s | 11s |
Opus cost is flat and opus read 34% fewer tokens: the file contents went to sonnet instead, which is exactly the mechanism the plugin exists for, visible even at this size. The whole increase in the total is the second model - you now pay two models for a question one of them could answer alone.
On a four-file fixture that is overhead and nothing else. The 0.16 anchor said a dispatch costs more than the answer for anything trivial, and four files is trivial, so the routing fired where its own rule says it should not have.
The deeper limitation is structural, not a matter of fixture size: a -p run is one shot. The 31k opus tokens that did not enter the main context have no later turn to be re-read in, so the saving has nowhere to accumulate and the eval measures the cost of delegation without the return. A real session re-reads its context every turn, which is where the trade is supposed to flip. Any case written here under-measures the plugin by construction, and a case that claims otherwise is misreading its own numbers.
(First run of a batch pays a cold prompt cache - it came in at $0.518 against $0.206 for the two that followed. The figures above are the two warm runs; the cold one is in the traces.)
The second case, and what it took to make the numbers mean something
traces-a-flow-end-to-end is the case that can answer "does this save money". Three things had to be true before it could, and each one started out false:
The question has to be wide. A needle question is answered by one grep, and a grep costs the same in any session. The fixture is a twelve-stage pipeline where each stage hands off to exactly one other and no file states the order, so the chain has to be walked - and the stage modules are fat, so walking it costs something. The first fixture was four small files and could never have shown anything.
The session has to continue. A single -p turn measures the cost of delegating and none of the return. Follow-up turns (followup-*.md, run through --continue in the same session) are where a main session pays again for the context it carries: on one run the baseline re-wrote 80k of context to cache on its third turn.
The subagent's tier has to be cheap enough. This is the one that decided the result, and it is arithmetic rather than judgement. A fresh subagent pays cache write for everything it reads; a main session pays cache read for what it already has, and read is 12.5x cheaper than write at the same tier (50x on Fable and Mythos 5.2 and 5.1). Delegation converts cheap re-reads into expensive first-reads, so only a large tier discount pays for the conversion.
Opus main session, 4 turns, 3 runs per configuration. Per-run totals are shown rather than only means, because with three runs a mean can hide an overlap:
| Configuration | opus | subagent | total per run |
|---|---|---|---|
| no plugin | $1.358 | - | $1.339 $1.382 $1.356 |
scout pinned sonnet (shipped) | $1.169 | sonnet-5 $0.506 | $1.559 $1.998 $1.468 |
scout pinned haiku | $1.042 | haiku-4.5 $0.198 | $1.142 $1.260 $1.315 |
The haiku and sonnet rows come from re-running the arm with agents/scout.md edited to that pin - there is no flag for it, and the runner takes the tier from the agent's frontmatter unless --model overrides the whole session. To reproduce a row, change the pin, run the arm, change it back.
Both configurations separate cleanly from the baseline, in opposite directions. Every haiku run came in under the cheapest baseline run; every sonnet run came in over the dearest. Read the direction as solid and the exact percentage as not: three runs per arm, one workload, and the sonnet arm's own spread ($1.468 to $1.998) is wider than the gap it is being compared across.
The stage-order answer was right in every run of every arm. The three follow-up turns were not scored - this case carried two graders at the time, ordering and delegation - so "correctness held" covers the breadth question only, and follow-up 1 in particular ("what happens to an order when payment throws a non-retryable error") is exactly the kind of question the quality case below shows the cheap tier failing. The plugin dispatched exactly once per run and answered the follow-ups from scout's summary rather than dispatching again, which is what the guidance asked for up to 0.16.
So the 0.16 configuration cost 23% more than not having the plugin on this workload, and pinning scout to haiku costs 9% less. The expensive tier drops either way - opus spend down 14% with sonnet, 23% with haiku - which is the mechanism working in both cases. What differs is whether the subagent's bill comes to less than the saving it produces.
Two things this does not license. One case is no mandate to re-pin scout: this question rewards breadth over judgement, haiku's answer quality on a subtle question is untested, and a wrong answer that sends the main session back to re-read is the expensive failure mode nothing here measures. And the largest single line in every run is opus output tokens, $0.33 to $0.43, which no amount of tier routing touches.
What the eval still cannot see is context-window pressure. Four turns never compact; a real session does, and a compaction costs a full re-read plus lost fidelity. The baseline dodges that cost here and would not always dodge it in practice; its net effect on these numbers is unmeasured.
Writing another case
evals/<case>/prompt.md carries the prompt in its body and its settings in frontmatter; evals/<case>/graders/<name>.md carries one grader each, its type and pattern in frontmatter and its reasoning in the body - the body is for the next person, who needs to know why a grader is worth having and what it cannot tell them. run-local.mjs supports type: regex over target: trace and target: last_message; the real harness additionally has tool_used, tool_order, file_exists, llm, and baseline. Prefer the deterministic ones: a judge model scoring prose is one more thing that can be wrong.
A case names its fixture directory under evals/fixtures with a fixture: key, defaulting to mini-app. A fixture too large to commit ships as <name>.gen.mjs beside it and is regenerated before every run - order-service is 85 modules and 122k of source, which nobody installing this plugin should have to download. Keep fixtures boring: one that is interesting to read is one the model answers from memory of something similar.
Add followup-1.md, followup-2.md and so on to turn a case into a session rather than a single question. That is not decoration - it is the only way the context a subagent kept out of the main session gets a chance to pay for itself.
The comparison the wide case was answering, and the one it was not
The table above answers "should this session have delegated at all", and on a wide-reading question the answer is no - delegating cost more than doing it inline with the shipped sonnet pin - though not with haiku, which came in under the baseline. That is a real finding and it is not the question most users are in.
The question most users are in is "the dispatch is happening anyway - Superpowers dispatches, workflows dispatch, an unpinned agent inherits the session model - so what does routing it down buy?" That arm has not been run: forced-dispatch-tier exists for it and is blocked. What can be said without running it is arithmetic on the token counts already measured, because the subagent's work is the same work at a different price:
| per run | |
|---|---|
| subagent tokens measured | 74k cache write, 451k cache read, 6k output |
| billed at sonnet-5 (what ran) | $0.506 |
| the same tokens at opus-5 rates | $0.844 |
Which gives, against the $1.169 the opus main session cost in that arm:
| total | |
|---|---|
| no delegation | $1.359 |
| delegate, tier routed down | $1.675 |
| delegate, subagent inherits opus | $2.013 |
So routing is roughly a 17% discount on a dispatch that was going to happen, and a 23% surcharge on one that did not need to. Both numbers belong in the README and now are.
Two honest limits on the $2.013. It reprices measured tokens rather than reporting a run, and a live opus subagent might well read less - fewer loops, better first guesses - which would shrink the gap. The pricing model is not guesswork though: applied to the sonnet arm it reproduces the billed $0.506 to the cent, so the tier multiplier is right even if the token count would move.
The third case, which stopped the re-pin
subagent-answer-quality exists because the wide case made haiku look like a free 9%, and a tier that is cheaper on breadth is not therefore cheaper. It asks scout two questions whose code contains a confident wrong answer:
withRetryIntakeloopsmaxRetriestimes, andmaxRetriesis 3. It also breaks the momenterror?.retryable === false, and every stage error is built withretryable: cause?.retryable ?? false. SovalidateOrderis called once, and the file has a 3 sitting in it for anyone who reads one line.applyTaxPolicylooks upTAX_POLICY[batch.outcome]while the table is keyedonWarn,onFatal,onTimeout,onUnknown. An outcome of"warn"misses, falls through toonUnknown: "abort", and returns null - not thecontinuethat theonWarnrow appears to promise. That mismatch is a real defect in the fixture and the question asks whether it was intended.
Three runs per tier, four deterministic graders, no judge model:
| Tier | Graders passed | Cost per run |
|---|---|---|
| opus (reference, 1 run) | 4/4 | $0.715 |
| sonnet - the shipped pin | 12/12 | $0.212 |
| haiku | 11/12 | $0.103 |
haiku's miss was substantive, not formatting: it answered 3, having read the maxRetries line and not the loop. Once in three runs, on the question the fixture was built to trap.
One miss in three runs of one question cannot pin a failure rate - 1/3 against 0/3 is not a distinguishable difference at this sample size, and anyone quoting "fails a third of the time" from this table is quoting noise. What decides the pin is not the rate but the shape of the failure: it is asymmetric. A cheap correct answer saves cents; a cheap wrong one sends the main session back to read the files itself, which costs more than the tier ever saved, and it arrives looking exactly like a right one. That asymmetry does not need a tight estimate to act on.
So the pin stays sonnet, and what the two cases together support is a split rather than a re-pin: breadth to surveyor (haiku), judgement to scout (sonnet). Overriding scout downward with model=haiku would have been the smaller diff and is what the first draft did - the plugin's own floor rule forbids exactly that, and prescribes a pinned agent instead.
The case runs the tier directly with agent: scout in frontmatter, which makes the session be scout and grades what comes back. That is the instrument this question needed all along: no main session to argue with about whether it really delegated, and no way for it to contaminate the result by reading.
Implementer and reviewer cases
Three cases measure cost and quality of the implementer and reviewer agents, to compare two plugin versions. All run the session AS the agent (agent: frontmatter), so they have no without arm.
| Case | Agent | Fixture | Scored by |
|---|---|---|---|
implementer-single-file | model-routing:implementer | ledger | hidden tests + visible tests (rounding modes in src/money.js) |
implementer-multi-file | model-routing:implementer | ledger | hidden tests + visible tests (multi-currency across 6 modules) |
reviewer-seeded-bugs | model-routing:reviewer | ledger-review | one regex grader per seeded bug, 4 in all |
ledger is a small dependency-free Node ESM invoice ledger. ledger-review is ledger plus changes.diff with four seeded defects (off-by-one in the CSV export loop, percent discount rounded up, missing await on mkdir, tax computed after the discount against the README rule) and two harmless edits; it is generated by fixtures/ledger-review.gen.mjs from fixtures/ledger-review.changes.diff, so edit the .diff, not the generated copy.
Compare two plugin versions by pointing the with arm at a checkout of the other one:
node evals/run-local.mjs --case implementer --arm with --plugin-root /path/to/other/checkoutThe directory used is recorded as pluginRoot in aggregate.json.
type: command graders run a shell command in the run's workspace after the last turn, before the workspace is deleted (120 s limit). Without pattern the grader passes on exit code 0; with pattern it passes when the regex matches the command's stdout (stderr too when the command fails). hidden: <path> copies that file or directory from the case directory into the workspace at the same relative path just before the command runs, so the model never sees the tests. A run that did not exit 0 is notRun, as for every grader. The runner keeps --permission-mode dontAsk, so a case that must edit files and run tests lists them in allowed_tools (passed as --allowedTools).
Results, Claude Code 2.1.330, 3 runs per arm, 2026-11-23 (aggregates in evidence/):
| Case | Arm | Mean cost per run | Quality |
|---|---|---|---|
implementer-multi-file | sonnet (run with the unshipped context cap, which this task never reaches) | $0.209 ($0.190-0.239) | hidden tests 3/3 |
implementer-multi-file | opus (--model opus, the 0.16 multi-file trigger) | $0.445 ($0.421-0.458) | hidden tests 3/3 |
implementer-single-file | sonnet with autoCompactWindow/maxTurns (not shipped) | $0.110 | hidden tests 3/3 |
implementer-single-file | sonnet without them (PR #63 checkout) | $0.106 | hidden tests 3/3 |
reviewer-seeded-bugs | opus/medium (not shipped) | $0.231; $0.157 and $0.162 warm | 12/12 bugs |
reviewer-seeded-bugs | opus/high (PR #63 checkout) | $0.150 | 12/12 bugs |
Sending the multi-file task to sonnet cost 53% less with every hidden test passing; every sonnet run was cheaper than every opus run. The context cap never triggers on tasks this size, so the single-file pair measures only that it costs nothing; whether it saves on long runs needs live data. Medium and high review both found every seeded bug; warm medium runs averaged $0.159 against $0.150 for high (the first medium run paid a cold cache), so medium was not cheaper and four planted bugs cannot tell the levels apart. On a small diff review cost is cache reads, not reasoning. The reviewer pin stays high and the context cap is not shipped until live data shows they pay.
Next
Since 0.17 the small and wide cases grade staying inline (stayed-in-main-session, match: not_contains); the numbers above were measured when they graded the dispatch. forced-dispatch-tier still needs the fix described in its NOTES.md before it can price delegation at the session tier - the Superpowers-by-default question is still open.