Claude Code v2.1.212 adds runaway-loop limits, better background sessions

Claude Code v2.1.212 adds runaway-loop limits, better background sessions

Claude Code v2.1.212 changes how `/fork` works: it now copies your conversation into a new background session (its own entry in ``) while you keep working in the original one. The old behavior of `/fork` — launching an in-session subagent — moved to a new `/subtask` command. calls now have a default session-wide cap of 200, tunable via `CLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSION`, to stop runaway search loops.

Subagent spawning gets the same treatment: a default 200-per-session cap (override with `CLAUDE_CODE_MAX_SUBAGENTS_PER_SESSION`), reset by `/clear`, to stop runaway chains. MCP tool calls that run longer than 2 minutes now automatically move to the background so the session doesn't freeze (configurable via `CLAUDE_CODE_MCP_AUTO_BACKGROUND_MS`). Typing `/resume` now opens a picker of past sessions — including ones deleted from the visible list — and resumes the chosen one as a background session.

Several bugs were fixed too: plan mode was auto-running file-modifying Bash commands like `touch` and `rm` without a , worktree creation could follow a committed symlink and create files outside the repo, and some hook error-handling issues were corrected.

Key points

  • /fork now clones the conversation into a new background session; in-session subagents moved to /subtask
  • calls capped at 200 per session by default (env var to adjust)
  • Subagent spawns capped at 200 per session by default, reset with /clear
  • MCP tool calls over 2 minutes auto-move to the background
  • Fixed a plan-mode bug where file-modifying commands like rm/touch ran without a
Read original