Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Wrap getTokenOptimizer().getCompactContext() to retrieve compacted ReasoningBank context for cost-analysis queries; report bridge-reported tokensSaved
.claude/skills/ruvnet-cost-compact-context/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-04 | ✗→✓ | ▲ Improved | -26% | 0% |
| case-05 | ✗→✓ | ▲ Improved | -23% | 0% |
| case-06 | ✗→✓ | ▲ Improved | -5% | 0% |
| case-07 | ✗→✓ | ▲ Improved | -36% | 0% |
| case-08 | ✗→✓ | ▲ Improved | -18% | 0% |
Wraps getTokenOptimizer().getCompactContext() from @claude-flow/integration for cost-analysis queries. The bridge dynamically imports agentic-flow with graceful fallback: when the package isn't installed, tokensSaved is 0 and the skill exits cleanly. No MCP tool wraps getTokenOptimizer today (ADR-0002 §"Riskiest assumption"); we shell a Node one-liner instead.
v3/ so @claude-flow/integration resolves:bash ( cd v3 && node ../plugins/ruflo-cost-tracker/scripts/compact.mjs "<QUERY>" )
The script imports @claude-flow/integration/token-optimizer (canonical export — not dist/token-optimizer.js, which would double the .js extension via Node's ./* exports rule), calls getCompactContext(query), and prints a markdown summary plus a JSON line via COMPACT_QUIET=1.
CLAUDE.md root claims ReasoningBank retrieval: -32% tokens. The bridge's tokensSaved is query_tokens − compact_prompt_tokens (token-optimizer.ts:141–143) — a heuristic, not a baseline-measured saving. token-optimizer.ts:9–10 itself says: "No fabricated metrics are reported — all stats reflect real measurements". This skill carries that disclaimer forward.
Booster-specific availability is not exposed as a getter — observable only through optimizedEdit() returning method: 'agent-booster'. The canonical Tier 1 signal is [AGENT_BOOSTER_AVAILABLE] (see cost-booster-route).
agentic-flow not installed → getCompactContext returns {tokensSaved: 0, memories: []} (line 116–124), optimizedEdit returns {method: 'traditional'}, getOptimalConfig falls back to anti-drift defaults. Skill exits cleanly with the "not available" message.
ADR-0002 Decision #2 + §"Riskiest assumption" · token-optimizer.ts:308 (singleton export) · docs/benchmarks/0002-baseline.md (verification findings).
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 6,871 | 1,899 | -72% | 1 | 1 | 0% | 1,241 | 852 | -31% | 0 | 0 | — |
case-02 | fail→fail | 6,892 | 4,049 | -41% | 1 | 1 | 0% | 1,234 | 898 | -27% | 0 | 0 | — |
case-03 | fail→fail | 12,816 | 3,790 | -70% | 1 | 1 | 0% | 2,308 | 848 | -63% | 0 | 0 | — |
case-04 | fail→pass | 7,529 | 2,138 | -72% | 1 | 1 | 0% | 1,453 | 1,068 | -26% | 0 | 0 | — |
case-05 | fail→pass | 9,846 | 3,792 | -61% | 1 | 1 | 0% | 1,814 | 1,389 | -23% | 0 | 0 | — |
case-06 | fail→pass | 9,257 | 4,441 | -52% | 1 | 1 | 0% | 1,520 | 1,442 | -5% | 0 | 0 | — |
case-07 | fail→pass | 10,530 | 2,518 | -76% | 1 | 1 | 0% | 1,733 | 1,107 | -36% | 0 | 0 | — |
case-08 | fail→pass | 8,574 | 9,679 | +13% | 1 | 1 | 0% | 1,492 | 1,220 | -18% | 0 | 0 | — |
case-09 | pass→pass | 9,391 | 1,680 | -82% | 1 | 1 | 0% | 814 | 927 | +14% | 0 | 0 | — |
case-10 | fail→pass | 5,743 | 2,272 | -60% | 1 | 1 | 0% | 975 | 1,093 | +12% | 0 | 0 | — |
case-11 | pass→pass | 9,680 | 1,346 | -86% | 1 | 1 | 0% | 1,723 | 846 | -51% | 0 | 0 | — |
case-12 | fail→pass | 11,021 | 2,214 | -80% | 1 | 1 | 0% | 1,927 | 1,080 | -44% | 0 | 0 | — |
case-13 | fail→pass | 9,966 | 2,465 | -75% | 1 | 1 | 0% | 1,889 | 1,007 | -47% | 0 | 0 | — |
case-14 | fail→pass | 4,634 | 1,871 | -60% | 1 | 1 | 0% | 809 | 948 | +17% | 0 | 0 | — |
case-15 | fail→pass | 5,916 | 4,613 | -22% | 1 | 1 | 0% | 996 | 1,446 | +45% | 0 | 0 | — |
case-16 | fail→pass | 11,758 | 2,872 | -76% | 1 | 1 | 0% | 2,025 | 1,143 | -44% | 0 | 0 | — |
case-17 | pass→pass | 5,636 | 2,621 | -53% | 1 | 1 | 0% | 994 | 1,079 | +9% | 0 | 0 | — |
case-18 | fail→pass | 11,240 | 4,542 | -60% | 1 | 1 | 0% | 2,050 | 942 | -54% | 0 | 0 | — |
case-19 | pass→pass | 5,076 | 1,368 | -73% | 1 | 1 | 0% | 736 | 847 | +15% | 0 | 0 | — |
case-20 | pass→pass | 9,543 | 7,270 | -24% | 1 | 1 | 0% | 2,145 | 2,248 | +5% | 0 | 0 | — |
case-21 | pass→pass | 3,267 | 3,197 | -2% | 1 | 1 | 0% | 680 | 1,168 | +72% | 0 | 0 | — |
case-22 | pass→pass | 2,218 | 2,932 | +32% | 1 | 1 | 0% | 352 | 1,127 | +220% | 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 20 counted toward the lift figure. The other 2 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 +55 percentage points is the difference between those two pass rates over the 20 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.