⌨️--max-budget-usd Flag
Also known as claude --max-budget-usd, Spend cap
It stops claude -p when the spend hits a dollar cap.
Think of it like
It is like you take five dollars to the fair. When it is gone, you go home.
Example
Jack runs Claude over a hundred repos at night. Each run gets --max-budget-usd 2, so one repo that goes wrong cannot eat the whole night's budget.
Why it matters
Unattended runs can cost more than you expect. A cap puts a limit on each one.
Definition
Example code
bash
claude -p --max-budget-usd 5 "Write tests for utils.py"Common mistake
Key takeaways
- 1Dollars, estimated. Not the bill.
- 2Subagents count. Toward the cap.
- 3Leave room. It can pass it.