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.

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.
| Flag | Scope | Note |
|---|---|---|
| --max-budget-usd | Print mode only | Client-side estimate; can differ from the bill; leave headroom |
| --max-turns | Print mode only | Exits 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
- claude -p --max-turns exits with an error: Sume job in flight
When --max-turns ends a CI run, a Sume job may still be rendering. Keep the job id in the output, resume with jobs_wait, and never repeat the paid create.
- Claude Code 2.1.288: MCP calls that ran twice, and paid Sume calls
2.1.288 fixed MCP tool calls sometimes running twice when a remote result was over 16 MB or unparsable. Why every paid Sume call needs an idempotency_key.
- claude -p --permission-prompts none: Sume tools in CI
With --permission-prompts none, prompts nobody can answer are denied. Which Sume tools still run? Read-only OAuth ones do; paid ones need mcp:write.
- Claude Code remote MCP backoff up to 30 s: retrying Sume safely
Headless Claude Code now backs off up to 30 s after remote MCP drops. A retried paid Sume call needs the same idempotency_key or you may pay twice.
Written by Sume