Track spend
agents cost rolls up $ and duration across the local, cross-agent session index. agents output joins that burn to what shipped.
agents cost
Every session is priced when it's scanned — tokens × a per-model rate from an offline, versioned price table. No API calls, no telemetry, and an unpriced model contributes $0, never a crash.
agents cost # daily histogram + top sessions + per-agent breakdown
agents cost --since 30d # last 30 days only
agents cost --by project # break down by project instead of agent
agents cost --by day --json # machine-readable daily rollupCost · pricing 2026-07-01 · since 30d
$412.30 across 214 sessions · 61h 12m total
Daily
▂▃▁▄▆█▅▃▂▄▇▆▃▁▂▃▅▇▆▄
2026-08-04 $38.20
2026-08-01 $31.05
2026-07-28 $27.90
Top sessions by cost
$18.40 a7f3e2c1 claude fix the flaky routines test rush-cli 42m
$14.02 e91b6c04 codex port the billing module to v2 payments 1h 08m
$11.75 9c2f0a88 claude audit the secrets broker teardown agents-cli 33m
By agent
claude $261.40 148 sessions 38h 02m
codex $102.15 41 sessions 14h 55m
droid $48.75 25 sessions 8h 15magents cost is distinct from agents usage, which reports live rate-limit / quota status per agent — a different question, a different command.
Per-session figures
Every session carries its own cost and duration, so you don't need the rollup for a one-off question:
agents sessions --sort cost --limit 10 --json | jq '.[] | {shortId, agent, costUsd, durationMs, topic}'
agents sessions --sort duration --limit 10agents output
agents cost answers what you spent. agents output joins that burn to what actually shipped — output tokens, PRs, commits — the "was it worth it" axis. It leads with output tokens (real generation), not the cache-inflated total.
agents output # burn split + shipped output, actual (cache-discounted) cost
agents output --pricing no-cache # lead with the burn as if caching were off
agents output --json | jq '.burn | {costUsd, costUsdNoCache, inputTokens, cacheReadTokens, cacheWriteTokens}'Where the harness reports a per-message cache split (Claude, Codex, Gemini, Droid), the rollup separates uncached input, cache-read, and cache-write tokens, and shows the saving caching bought you: caching: actual $84.10 vs no-cache $211.40 (saved $127.30, 60%).
Related: Cap spend, Where it goes, Rotate accounts.