بنقرة واحدة
cost-booster-route
Route tasks through hooks_route, partition by Agent Booster availability, and report Tier 1 bypass utilization with $0 cost
القائمة
Route tasks through hooks_route, partition by Agent Booster availability, and report Tier 1 bypass utilization with $0 cost
MAD-based outlier detection on session spend. Robust to the very outliers it hunts (unlike mean+sigma). Surfaces specific anomalous sessions with modified-z scores; optional --alert-on-outliers exit code for CI gates. Distinct from cost-burn (aggregate trend) — this answers "which INDIVIDUAL session is the outlier?".
Burn-rate trend over time with optional drift-alert exit code. Bins session spend into buckets, surfaces window-over-window delta, and can exit 1 when latest bucket exceeds prior mean by a configurable %. Distinct from `cost-trend` (benchmark drift); this tracks PRODUCTION spend trajectory.
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.
Snapshot delta between two cost-summary JSON outputs. PR-level cost regression detection — answers "what changed between these two specific snapshots?". Pairs with cost-summary's stable JSON contract.
Composite CI gate — runs cost-budget-check + cost-burn + cost-anomaly + cost-projection in parallel and surfaces a single combined health status with max exit code. The operationally-useful entry point — one shell-out covers all four alert ladders.
Forward-looking spend extrapolation. Computes a USD-per-day rate from the recent measurement window, projects to 7d/30d/90d/365d horizons, and surfaces "days until budget exhausted" when a budget is configured. Predictive counterpart to `cost-budget-check` (reactive).
| name | cost-booster-route |
| description | Route tasks through hooks_route, partition by Agent Booster availability, and report Tier 1 bypass utilization with $0 cost |
| argument-hint | [--from-recent] | <task-description> |
| allowed-tools | mcp__claude-flow__hooks_route mcp__claude-flow__memory_search mcp__claude-flow__memory_list Bash |
Wraps mcp__claude-flow__hooks_route and reports how many tasks the 3-tier router classified as Agent Booster (Tier 1) eligible. Tier 1 bypasses run as WASM transforms — no LLM call, structurally $0 cost.
Before a batch of similar tasks, or when cost-report shows Sonnet/Opus spend on descriptions that look like simple transforms (var-to-const, add-types, add-error-handling, async-await, add-logging, remove-console).
Collect tasks — single arg or recent entries from cost-tracking via memory_search. Cap batch at 50.
Route each — call hooks_route with the description; capture the full response string.
Partition — group by whether the response contains the literal [AGENT_BOOSTER_AVAILABLE] (Tier 1) vs. not (Tier 2/3). Extract [TASK_MODEL_RECOMMENDATION] Use model="X" when present.
Compute spend — Tier 1 partition: $0. Tier 2/3 partition: per-task upper-bound from REFERENCE.md pricing × recommended model.
Report
=== Booster bypass report ===
Tasks analyzed: 50
Tier 1 (booster): 18 (36%) — $0.00
Tier 2/3 (LLM): 32 (64%) — $X.XX (upper-bound)
Booster intents: var-to-const (8), add-types (5), remove-console (5)
Persist — memory_store --namespace cost-tracking --key "booster-route-$(date +%Y%m%d-%H%M%S)" --value '{"tier1": N, "tier2_or_3": M, ...}' so cost-report picks up the tier signal.
[AGENT_BOOSTER_AVAILABLE] fires only when the upstream router populates routeResult.agentBoosterIntent.type (v3/@claude-flow/cli/src/mcp-tools/hooks-tools.ts:1228). The published CLI's semantic-VectorDb path does not always trigger the classifier — treat the partition as a lower bound on Tier 1 eligibility.<1ms latency and 352× faster than LLM. <1ms and $0 are structural; 352× is claimed upstream, not yet verified here. Report what the router actually returns.docs/benchmarks/0002-baseline.md for the full upstream-claims-vs-measured table.ADR-0002 Decision #1 · ruflo-intelligence ADR-0001 §"Neutral" (closes the routing-outcomes loop via cost-optimize step 8) · CLAUDE.md root §"3-Tier Model Routing (ADR-026)".