Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Multi-baseline counterfactual cost analysis. Compares actual session spend to hypothetical always-haiku / always-sonnet / always-opus routing baselines. Answers "is the routing earning its keep?" Negative savings flag over-escalation; positive savings quantify the router's win.
.claude/skills/ruvnet-cost-counterfactual/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 11% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 11% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 399% | 0% |
| case-07 | ✗→✓ | ▲ Improved | -33% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 117% | 0% |
Multi-baseline counterfactual cost analysis. Pairs with the existing observability surface:
cost-budget-check — "have we crossed a threshold?" (reactive)cost-projection — "when will we cross a threshold?" (predictive)cost-counterfactual — "is the routing earning its keep?" (comparative) ← this onesession-* records from the cost-tracking namespace.--since window filter (default all-time).byModel[*] entries for each session.counterfactualUsd = (input × tier.input + output × tier.output + cache_write × tier.cache_write + cache_read × tier.cache_read) / 1Msavings = counterfactualUsd − actualUsd.| Sessions considered | 2 |
| Total input tokens | 100,000 |
| Actual spend | $0.162500 |
| Baseline | Hypothetical | Actual | Savings | % |
| `always-haiku` | $0.025000 | $0.162500 | -$0.137500 | -550.00% |
| `always-sonnet` | $0.300000 | $0.162500 | +$0.137500 | 45.83% |
| `always-opus` | $1.500000 | $0.162500 | +$1.337500 | 89.17% |A negative always-haiku result means the router chose more-expensive models than haiku on tasks haiku could have handled. That's an over-escalation signal:
cost optimize (or inspect specific sessions via cost conversation) to investigatePositive savings quantify the router's win against that baseline. The most informative number is usually always-sonnet — it's the standard "safe default" baseline most teams would pick if they didn't have routing.
cost counterfactual --format json | jq '.baselines[1].savingsPct > 30' — fail builds if routing isn't saving ≥30% vs sonnet baseline (workload-shift detector).Like all counterfactual analyses, this assumes the same tokens at the same complexity would have produced the same outcome from the baseline model. That's an upper bound — the baseline might have failed and required retries, which the math doesn't capture. Treat the numbers as a quality-blind ceiling.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-03 | pass→pass | 15,161 | 20,668 | +36% | 1 | 1 | 0% | 3,621 | 5,467 | +51% | 0 | 0 | — |
case-04 | pass→pass | 7,817 | 6,199 | -21% | 1 | 1 | 0% | 1,327 | 1,971 | +49% | 0 | 0 | — |
case-05 | pass→pass | 4,517 | 6,262 | +39% | 1 | 1 | 0% | 879 | 2,083 | +137% | 0 | 0 | — |
case-01 | fail→pass | 12,536 | 11,082 | -12% | 1 | 1 | 0% | 2,708 | 3,019 | +11% | 0 | 0 | — |
case-02 | fail→pass | 11,927 | 9,598 | -20% | 1 | 1 | 0% | 2,530 | 2,806 | +11% | 0 | 0 | — |
case-06 | fail→pass | 4,927 | 14,736 | +199% | 1 | 1 | 0% | 779 | 3,891 | +399% | 0 | 0 | — |
case-07 | fail→pass | 10,578 | 2,672 | -75% | 1 | 1 | 0% | 1,986 | 1,323 | -33% | 0 | 0 | — |
case-08 | pass→pass | 13,556 | 9,877 | -27% | 1 | 1 | 0% | 2,343 | 2,707 | +16% | 0 | 0 | — |
case-09 | fail→pass | 25,134 | 22,901 | -9% | 1 | 1 | 0% | 1,243 | 2,696 | +117% | 0 | 0 | — |
case-10 | fail→pass | 14,525 | 8,918 | -39% | 1 | 1 | 0% | 2,151 | 2,234 | +4% | 0 | 0 | — |
case-11 | fail→pass | 18,175 | 2,376 | -87% | 1 | 1 | 0% | 926 | 1,237 | +34% | 0 | 0 | — |
case-12 | pass→pass | 6,801 | 2,014 | -70% | 1 | 1 | 0% | 1,250 | 1,122 | -10% | 0 | 0 | — |
case-13 | fail→pass | 24,401 | 4,073 | -83% | 1 | 1 | 0% | 1,000 | 1,466 | +47% | 0 | 0 | — |
case-14 | fail→pass | 12,938 | 5,100 | -61% | 1 | 1 | 0% | 2,045 | 1,607 | -21% | 0 | 0 | — |
case-15 | pass→pass | 11,495 | 9,159 | -20% | 1 | 1 | 0% | 2,139 | 2,586 | +21% | 0 | 0 | — |
case-16 | fail→pass | 16,177 | 13,140 | -19% | 1 | 1 | 0% | 2,556 | 3,063 | +20% | 0 | 0 | — |
case-17 | pass→pass | 14,286 | 15,562 | +9% | 1 | 1 | 0% | 2,184 | 3,489 | +60% | 0 | 0 | — |
case-18 | pass→pass | 15,848 | 7,660 | -52% | 1 | 1 | 0% | 3,230 | 2,265 | -30% | 0 | 0 | — |
case-19 | fail→pass | 7,416 | 1,998 | -73% | 1 | 1 | 0% | 1,702 | 1,226 | -28% | 0 | 0 | — |
case-20 | pass→pass | 4,675 | 2,890 | -38% | 1 | 1 | 0% | 1,133 | 1,421 | +25% | 0 | 0 | — |
case-21 | pass→pass | 2,336 | 2,370 | +1% | 1 | 1 | 0% | 466 | 1,246 | +167% | 0 | 0 | — |
case-22 | pass→pass | 7,913 | 1,945 | -75% | 1 | 1 | 0% | 1,282 | 1,118 | -13% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 19 counted toward the lift figure. The other 3 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +50 percentage points is the difference between those two pass rates over the 19 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.