How-to
Know what your agents spend
The balanced strategy sprays every run across every signed-in account and every harness you have installed. That's the point of running a fleet instead of one chat window — and it's also why nothing rolls the bill up for you. Three commands do.
Muqsit Nawaz · Published August 8, 2026
Sum it
Every session is priced when it's scanned — tokens times a per-model rate from an offline, versioned price table. No API calls, no telemetry, no waiting on a billing dashboard that's a day behind. agents cost rolls that figure up across the local, cross-agent session index.
agents cost # daily histogram + top sessions + per-agent breakdown
agents cost --since 30d --by projectCost · pricing 2026-07-01 · since 30d
$412.30 across 214 sessions · 61h 12m total
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
By agent
claude $261.40 148 sessions 38h 02m
codex $102.15 41 sessions 14h 55magents output is the sibling command for the other half of the question — not what you spent, but what shipped for it: real generated output tokens, plus PRs and commits, joined against the same burn.
Split it by account
A rollup by agent hides the thing that actually matters once you have more than one login: which account is doing the spending. agents insights is the only surface that splits time and cost by the account that did the work — the same account balanced just picked for you.
agents insights --by account --since 30d
agents insights --by project --since 90d # which repo is eating the timeThe report also carries friction — interruptions, tool errors, and agent silent stalls, where the assistant ends a turn while work remains and only resumes when you type "continue" later. A fleet that stalls quietly is a fleet burning wall-clock time for nothing, and that shows up in the same report as the dollar figures.
Cap it
Observability can't reach back in time and stop the call that blew the budget.agents budget can — it estimates a run's cost before it starts, refuses to launch it under a breach, and for a local headless run kills the child the moment a cap is crossed.
# ~/.agents/agents.yaml
budget:
per_run: 5.00
per_day: 50.00
per_agent: { claude: 30.00, codex: 20.00 }
on_exceed: block$ agents budget set per_run 0.01 # lowered here on purpose, to force a block
$ agents run claude "big refactor across the repo" --model claude-opus-4
[budget] est. $2.48 for this claude run (claude-opus-4, prompt size)
[budget] BLOCKED: estimated $2.48 exceeds per_run cap $0.01
$ echo $?
2The guardrail is cross-vendor by construction — one per_day cap spans Claude, Codex, and every other agent the CLI dispatches, which no single vendor's own billing page can do.
Try it
curl -fsSL agi-cli.sh | sh