Use Claude Code --max-budget-usd for headless runs, see what estimated API spend the cap covers, and understand why billing may differ.