Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Analyze token usage patterns and recommend cost optimizations with estimated savings
.claude/skills/ruvnet-cost-optimize/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-07 | ✗→✓ | ▲ Improved | -6% | 0% |
| case-08 | ✗→✓ | ▲ Improved | -5% | 0% |
| case-09 | ✗→✓ | ▲ Improved | -7% | 0% |
| case-19 | ✗→✓ | ▲ Improved | -30% | 0% |
| case-10 | ✗→✓ | ▲ Improved | -12% | 0% |
Analyze recent token usage across agents and models, identify waste, and recommend specific optimizations with estimated dollar savings.
When costs are higher than expected or you want to proactively reduce spending. Analyzes model selection efficiency, cache utilization, agent redundancy, and prompt efficiency.
mcp__plugin_ruflo-core_ruflo__memory_search on the cost-tracking namespace (last 7 days). The memory_* tools route by namespace; use them — not agentdb_hierarchical-* (which routes by tier).mcp__plugin_ruflo-core_ruflo__agentdb_pattern-search (ReasoningBank-routed; don't pass a namespace argument — pattern- tools ignore it).mcp__plugin_ruflo-core_ruflo__agentdb_pattern-store with type: 'cost-optimization'. Don't pass a namespace arg — ReasoningBank routes it; on bridge unavailability the fallback writes to the reserved pattern namespace with controller: 'memory-store-fallback' (see ruflo-agentdb ADR-0001).mcp__plugin_ruflo-core_ruflo__memory_store --namespace cost-patterns — this DOES respect the cost-patterns namespace because memory_* is namespace-routed.hooks_model-outcome -- for each downgrade recommendation, format the outcome-emit command as part of the recommendation table so it can be run directly:bash # success path (downgrade worked) node plugins/ruflo-cost-tracker/scripts/outcome.mjs "<task-description>" <model> success
# escalated path (had to upgrade after downgrade attempt) node plugins/ruflo-cost-tracker/scripts/outcome.mjs "<task-description>" <model> escalated
The script wraps npx @claude-flow/cli hooks model-outcome -t ... -m ... -o ... with explicit-argv spawnSync so quoting is safe. Without this signal the router does not learn from cost-tracker's recommendations and the booster bypass rate (see cost-booster-route skill) does not improve over time. This is the typed equivalent of the legacy routing-outcomes namespace (see ruflo-intelligence ADR-0001 §"Neutral").
bashnpx @claude-flow/cli@latest memory search --query "cost optimization strategies" --namespace cost-patterns npx @claude-flow/cli@latest memory store --key "opt-2026-05-04" --value '{...}' --namespace cost-patterns
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-05 | pass→pass | 13,603 | 8,584 | -37% | 1 | 1 | 0% | 2,310 | 2,298 | -1% | 0 | 0 | — |
case-01 | fail→fail | 21,651 | 6,350 | -71% | 1 | 1 | 0% | 3,961 | 1,351 | -66% | 0 | 0 | — |
case-02 | fail→fail | 23,634 | 6,438 | -73% | 1 | 1 | 0% | 4,896 | 1,357 | -72% | 0 | 0 | — |
case-03 | fail→fail | 19,326 | 6,068 | -69% | 1 | 1 | 0% | 3,799 | 1,278 | -66% | 0 | 0 | — |
case-04 | pass→pass | 12,252 | 14,662 | +20% | 1 | 1 | 0% | 2,171 | 3,091 | +42% | 0 | 0 | — |
case-06 | pass→pass | 8,012 | 2,569 | -68% | 1 | 1 | 0% | 1,492 | 1,297 | -13% | 0 | 0 | — |
case-07 | fail→pass | 7,184 | 1,703 | -76% | 1 | 1 | 0% | 1,270 | 1,194 | -6% | 0 | 0 | — |
case-08 | fail→pass | 9,591 | 3,481 | -64% | 1 | 1 | 0% | 1,642 | 1,555 | -5% | 0 | 0 | — |
case-09 | fail→pass | 8,210 | 2,201 | -73% | 1 | 1 | 0% | 1,434 | 1,335 | -7% | 0 | 0 | — |
case-19 | fail→pass | 10,995 | 2,596 | -76% | 1 | 1 | 0% | 1,949 | 1,374 | -30% | 0 | 0 | — |
case-10 | fail→pass | 7,689 | 1,544 | -80% | 1 | 1 | 0% | 1,352 | 1,192 | -12% | 0 | 0 | — |
case-11 | fail→pass | 17,297 | 1,973 | -89% | 1 | 1 | 0% | 2,657 | 1,174 | -56% | 0 | 0 | — |
case-12 | fail→pass | 16,568 | 3,205 | -81% | 1 | 1 | 0% | 1,499 | 1,511 | +1% | 0 | 0 | — |
case-13 | fail→pass | 11,603 | 3,463 | -70% | 1 | 1 | 0% | 2,019 | 1,601 | -21% | 0 | 0 | — |
case-14 | fail→pass | 5,877 | 4,052 | -31% | 1 | 1 | 0% | 1,031 | 1,598 | +55% | 0 | 0 | — |
case-15 | pass→pass | 11,895 | 9,177 | -23% | 1 | 1 | 0% | 2,093 | 2,355 | +13% | 0 | 0 | — |
case-16 | fail→pass | 3,496 | 2,360 | -32% | 1 | 1 | 0% | 704 | 1,213 | +72% | 0 | 0 | — |
case-17 | fail→pass | 4,695 | 2,496 | -47% | 1 | 1 | 0% | 947 | 1,372 | +45% | 0 | 0 | — |
case-18 | fail→pass | 6,937 | 3,142 | -55% | 1 | 1 | 0% | 1,097 | 1,352 | +23% | 0 | 0 | — |
case-20 | pass→pass | 11,519 | 5,914 | -49% | 1 | 1 | 0% | 2,091 | 1,951 | -7% | 0 | 0 | — |
case-21 | pass→pass | 19,378 | 16,191 | -16% | 1 | 1 | 0% | 3,777 | 4,024 | +7% | 0 | 0 | — |
case-22 | pass→pass | 16,700 | 15,076 | -10% | 1 | 1 | 0% | 2,931 | 3,010 | +3% | 0 | 0 | — |
case-23 | pass→pass | 9,016 | 9,834 | +9% | 1 | 1 | 0% | 1,789 | 2,794 | +56% | 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. 23 cases were attempted, and 19 counted toward the lift figure. The other 4 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 +52 percentage points is the difference between those two pass rates over the 19 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
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.