Documentation Type
Incorrect/outdated documentation
Documentation Location
https://code.claude.com/docs/en/sub-agents
Section/Topic
The "Fork the current conversation" section, plus the CLAUDE_CODE_FORK_SUBAGENT environment variable reference for non-interactive usage.
Current Documentation
The docs currently say:
Fork mode works only in interactive sessions. It is disabled in non-interactive mode, which includes the Agent SDK. A fork cannot spawn further forks.
And the environment variable reference says:
CLAUDE_CODE_FORK_SUBAGENT | Set to 1 to enable forked subagents. A forked subagent inherits the full conversation context from the main session instead of starting fresh. When enabled, /fork spawns a forked subagent rather than acting as an alias for /branch, and all subagent spawns run in the background. Interactive mode only
The claude -p / Agent SDK page is the canonical non-interactive entry point:
This page covers using the Agent SDK via the CLI (claude -p).
but it does not currently mention CLAUDE_CODE_FORK_SUBAGENT or that forked subagents now work in non-interactive sessions.
What's Wrong or Missing?
Changelog v2.1.121 says:
SDK and claude -p: CLAUDE_CODE_FORK_SUBAGENT=1 now works in non-interactive sessions
The current docs still explicitly say fork mode is interactive-only and disabled in non-interactive mode, which now contradicts current behavior.
That leaves automation users with the opposite guidance of what the product now supports. Someone reading the docs would reasonably conclude that forked subagents cannot be used from the Agent SDK or claude -p, even though v2.1.121 added exactly that support.
Suggested Improvement
Update the forked subagent documentation to reflect v2.1.121:
- Remove the "interactive mode only" limitation from the forked subagent docs and
CLAUDE_CODE_FORK_SUBAGENT env var reference.
- Add a short note in the
claude -p / Agent SDK docs explaining that CLAUDE_CODE_FORK_SUBAGENT=1 now works in non-interactive sessions.
- Clarify any non-interactive-specific behavior or remaining limitations, especially which parts of fork mode apply to SDK /
claude -p sessions versus interactive-only UI features like /fork.
Impact
Medium - Makes feature difficult to understand
Additional Context
Affected Pages:
Total scope: 4 pages affected
Source: Changelog v2.1.121
Exact changelog entry: SDK and claude -p: CLAUDE_CODE_FORK_SUBAGENT=1 now works in non-interactive sessions
Documentation Type
Incorrect/outdated documentation
Documentation Location
https://code.claude.com/docs/en/sub-agents
Section/Topic
The "Fork the current conversation" section, plus the
CLAUDE_CODE_FORK_SUBAGENTenvironment variable reference for non-interactive usage.Current Documentation
The docs currently say:
And the environment variable reference says:
The
claude -p/ Agent SDK page is the canonical non-interactive entry point:but it does not currently mention
CLAUDE_CODE_FORK_SUBAGENTor that forked subagents now work in non-interactive sessions.What's Wrong or Missing?
Changelog v2.1.121 says:
The current docs still explicitly say fork mode is interactive-only and disabled in non-interactive mode, which now contradicts current behavior.
That leaves automation users with the opposite guidance of what the product now supports. Someone reading the docs would reasonably conclude that forked subagents cannot be used from the Agent SDK or
claude -p, even though v2.1.121 added exactly that support.Suggested Improvement
Update the forked subagent documentation to reflect v2.1.121:
CLAUDE_CODE_FORK_SUBAGENTenv var reference.claude -p/ Agent SDK docs explaining thatCLAUDE_CODE_FORK_SUBAGENT=1now works in non-interactive sessions.claude -psessions versus interactive-only UI features like/fork.Impact
Medium - Makes feature difficult to understand
Additional Context
Affected Pages:
CLAUDE_CODE_FORK_SUBAGENTentry still says "Interactive mode only"claude -p/ non-interactive page does not mention the new supportTotal scope: 4 pages affected
Source: Changelog v2.1.121
Exact changelog entry:
SDK and claude -p: CLAUDE_CODE_FORK_SUBAGENT=1 now works in non-interactive sessions