Two new backstops against runaway agent fan-out: a 20-subagent concurrency cap and `--max-budget-usd` that actually halts background agents
Claude Code Changelog·medium signal
v2.1.217 added a cap on concurrently-running subagents (default 20, override with `CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS`) so a single message can't spawn unbounded background work, and fixed `--max-budget-usd` not applying to background subagents — once the cap is hit, new spawns are denied and running background agents are halted. Before this fix, a budget ceiling was enforceable only on foreground work, which is exactly the wrong half for an overnight or CI run. If you run headless pipelines, both settings belong in your default invocation.