cost-booster-route

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Cost Booster Route

Cost Booster 路由

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.
封装
mcp__claude-flow__hooks_route
,并报告3层路由器将多少任务归类为符合Agent Booster(Tier 1)条件的任务。Tier 1旁路以WASM转换的形式运行——无需调用LLM,从结构上实现0美元成本。

When to use

使用场景

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
).
在处理一批相似任务之前,或者当
cost-report
显示Sonnet/Opus在看似简单转换的描述上产生支出时(例如
var-to-const
add-types
add-error-handling
async-await
add-logging
remove-console
)。

Steps

步骤

  1. Collect tasks — single arg or recent entries from
    cost-tracking
    via
    memory_search
    . Cap batch at 50.
  2. Route each — call
    hooks_route
    with the description; capture the full response string.
  3. 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.
  4. Compute spend — Tier 1 partition: $0. Tier 2/3 partition: per-task upper-bound from REFERENCE.md pricing × recommended model.
  5. 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)
  6. 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.
  1. 收集任务 —— 单个参数或通过
    memory_search
    cost-tracking
    获取近期条目。批量上限为50个。
  2. 逐个路由 —— 使用任务描述调用
    hooks_route
    ;捕获完整响应字符串。
  3. 分区 —— 根据响应是否包含字面量
    [AGENT_BOOSTER_AVAILABLE]
    (Tier 1)进行分组,不包含则归为Tier 2/3。若存在
    [TASK_MODEL_RECOMMENDATION] Use model="X"
    则提取该内容。
  4. 计算支出 —— Tier 1分区:0美元。Tier 2/3分区:基于REFERENCE.md中的定价上限×推荐模型,计算每个任务的支出上限。
  5. 生成报告
    === Booster旁路报告 ===
    分析任务数:        50
    Tier 1(Booster):      18 (36%)  — $0.00
    Tier 2/3(LLM):        32 (64%)  — $X.XX (上限)
    Booster意图:       var-to-const (8), add-types (5), remove-console (5)
  6. 持久化存储 —— 执行
    memory_store --namespace cost-tracking --key "booster-route-$(date +%Y%m%d-%H%M%S)" --value '{"tier1": N, "tier2_or_3": M, ...}'
    ,以便
    cost-report
    能获取到分层信号。

Caveats — claimed upstream, not yet verified

注意事项——上游声称,尚未验证

  • [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.
  • CLAUDE.md root claims
    <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.
  • See
    docs/benchmarks/0002-baseline.md
    for the full upstream-claims-vs-measured table.
  • [AGENT_BOOSTER_AVAILABLE]
    仅在上游路由器填充
    routeResult.agentBoosterIntent.type
    时触发(路径:
    v3/@claude-flow/cli/src/mcp-tools/hooks-tools.ts:1228
    )。已发布的CLI的语义向量数据库路径并不总是触发分类器——请将分区结果视为Tier 1合格性的下限
  • CLAUDE.md根文档声称延迟
    <1ms
    ,比LLM快352倍
    <1ms
    0美元
    是结构特性;352倍是上游声称的数据,尚未在此处验证。请报告路由器实际返回的结果。
  • 完整的上游声称与实测数据对比表请查看
    docs/benchmarks/0002-baseline.md

Cross-references

交叉引用

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)".
ADR-0002 决策#1 · ruflo-intelligence ADR-0001 §"Neutral"(通过
cost-optimize
步骤8关闭路由结果循环)· CLAUDE.md根文档 §"3-Tier Model Routing (ADR-026)"。