Cost Monitoring In development
Aggregate token spend from 5 CLIs in one place
Switch unifies token spend from tools like Claude Code / Codex / Gemini / PicoClaw / NullClaw, and alerts you before you exceed budget.
Cost aggregation
Once the Switch background process is running, requests from every CLI process started by Switch pass through the local proxy (default 127.0.0.1:41234) and are recorded to a local SQLite database:
~/.lurus-switch/costs.dbAggregation dimensions:
claude-code / codex / gemini / picoclaw / nullclaw
claude-sonnet-4 / gpt-5 / gemini-3-pro, etc.
By the git repo root containing the CWD
Day / week / month
Threshold alerts
Configure these on the Switch settings page:
| Alert type | Example |
|---|---|
| Daily budget | System notification when you exceed ¥50/day |
| Single call | Highlighted in red when a call exceeds ¥2 |
| Model share | Prompt to downshift when Claude Opus > 60% |
Alert channels: System notification Email Webhook
Attribution analysis
"Why did spend suddenly jump today?"
Switch provides flame-graph-style attribution, drilling down layer by layer to the exact culprit:
总消费 ¥38.2 (↑ 250% vs 昨日)
├─ claude-code ¥28.4 (74%) ← 主因
│ └─ 项目: 2l-bs-docs ¥21.3 ← 具体元凶
│ └─ 模型: claude-opus ¥19.8
├─ codex ¥6.5
└─ gemini ¥3.3Lumen integration
For agent projects that use the Lumen SDK, Switch can merge Lumen’s fine-grained trace data:
Switch 粗粒度: 项目 / 工具 / 模型
+
Lumen 细粒度: Graph / Node / LLM Call
=
完整成本拓扑Enable Lumen integration
http://localhost:7070 to merge Switch’s coarse-grained cost with Lumen’s Graph / Node / LLM Call level traces into a complete cost topology.Export
In the UI:
右键 → 导出为 CSV / JSONOr from the command line:
lurus-switch export --format csv --since 30d > costs.csv