Claude Code · tool · fg-0537

Fork subagents now on by default in claude -p, Agent SDK, desktop app and VS Code

If you see Headless or SDK runs spawn fork subagents that did not appear before, the cause and the fix for Claude Code are below, last verified 2026-10-17.

Verified Oct 2026trust 50/100
Symptom
Headless or SDK runs spawn fork subagents that did not appear beforeSubagent calls from a subagent now run in the foreground by default in those surfaces, and the main conversation's subagents always run in the background in desktop and VS Code
Cause
Version 2.1.302 turned on fork subagents (subagent_type fork) by default outside the terminal, and changed foreground and background behavior for subagents in desktop and VS Code.
Fix
Turn fork subagents off if your workflow depends on the old behavior.
Apply
export CLAUDE_CODE_FORK_SUBAGENT=0
Affected
Claude Code 2.1.302 and later
Sources

Last verified 2026-10-17 · Confirmed by 0 builders

Related traps

Have your agent know this before it fails

$ /plugin marketplace add getfootgun/footgun
$ /plugin install footgun@footgun