claude -p --max-budget-usd does not cap Sume renders

Claude Code's --max-budget-usd is a client-side estimate of API spend in print mode. Pair it with max_spend_usd on every paid Sume call and leave headroom.

4 min readSume
All posts

claude -p --max-budget-usd 5.00 stops a print-mode run when Claude Code's estimate of model spend reaches $5. It does not know what a Sume render costs. For video, send max_spend_usd on each paid call and keep the two budgets separate.

What does the flag cover?

Per the CLI reference, --max-budget-usd stops the run once estimated spend on API calls reaches the amount, in print mode only. Claude Code checks the cap against its client-side estimate, which can differ from your bill. Subagent spend counts, and spend can pass the cap, so the page says to leave headroom.

Claude Code CLI reference (read 2026-10-09)
FlagScopeNote
--max-budget-usdPrint mode onlyClient-side estimate; can differ from the bill; leave headroom
--max-turnsPrint mode onlyExits with an error at the limit; no limit by default

Where does a Sume render get capped?

On the Sume side. Paid MCP tools take an optional top-level max_spend_usd, which Sume enforces only when you send it. dry_run=true previews the cost first. Agent Completions requires generation_spend_cap_usd and has no default.

A safe print-mode command

Cap the model, cap the turns, and tell the agent to preview and cap every paid call.

claude -p --max-budget-usd 2.00 --max-turns 12 \
  "Use dry_run first. Pass max_spend_usd 3 and a fresh idempotency_key on every paid Sume call."

What can go wrong?

Two things. The model budget can stop the run while a job is in flight, and the job keeps running and billing; recover it by job id. And a wait that ends early is not a failure: jobs_wait holds at most 55 seconds and returns wait_slice_expired. See MCP generation admission before bursts.

Sources

Related posts

More in Developers

All Developers posts

Written by Sume