claude-code - 💡(How to fix) Fix [DOCS] Cloud session docs missing `CLAUDE_CODE_FORK_SUBAGENT` enablement for forked subagents [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#51769Fetched 2026-04-22 07:53:20
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
labeled ×4

Code Example

CLAUDE_CODE_FORK_SUBAGENT=1
RAW_BUFFERClick to expand / collapse

Documentation Type

Missing documentation (feature not documented)

Documentation Location

https://code.claude.com/docs/en/claude-code-on-the-web

Section/Topic

Configure your environment and the cloud-session subagents note under Work with sessions

Current Documentation

The cloud-session docs currently say:

Environments control network access, environment variables, and the setup script that runs before a session starts. See Installed tools for what's available without any configuration.

Later on the same page they say:

Subagents work the same way they do locally. Claude can spawn them with the Task tool to offload research or parallel work into a separate context window, keeping the main conversation lighter. Subagents defined in your repo's .claude/agents/ are picked up automatically. Agent teams are off by default but can be enabled by adding CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 to your environment variables.

The skills docs also document forked subagent context:

Add context: fork to your frontmatter when you want a skill to run in isolation. The skill content becomes the prompt that drives the subagent. It won't have access to your conversation history.

No documentation currently exists for CLAUDE_CODE_FORK_SUBAGENT in the environment variable reference.

What's Wrong or Missing?

Changelog v2.1.117 says: Forked subagents can now be enabled on external builds by setting CLAUDE_CODE_FORK_SUBAGENT=1.

The current docs describe cloud/external sessions, environment variables, and forked subagent contexts, but they never explain that forked subagents on external builds require CLAUDE_CODE_FORK_SUBAGENT=1.

That leaves a gap for users running Claude Code on the web or other external-build workflows: the docs say subagents work in cloud sessions and describe context: fork, but they do not show the required enablement step or where to set it.

Suggested Improvement

Add CLAUDE_CODE_FORK_SUBAGENT to the environment variable reference with a short description such as:

CLAUDE_CODE_FORK_SUBAGENT — Set to 1 to enable forked subagents on external builds/cloud sessions.

Also add a note to the cloud-session docs near the existing subagents section showing where to configure it:

CLAUDE_CODE_FORK_SUBAGENT=1

If context: fork-based skills or similar forked workflows are supported in external builds, add a cross-reference from the relevant skills/subagent docs so users can discover the requirement from those pages too.

Impact

High - Prevents users from using a feature

Additional Context

Affected Pages:

PageContext
https://code.claude.com/docs/en/claude-code-on-the-webCloud-session environment configuration and the note that subagents work the same way locally
https://code.claude.com/docs/en/env-varsCanonical environment variable reference; CLAUDE_CODE_FORK_SUBAGENT is missing
https://code.claude.com/docs/en/skillsDocuments context: fork for forked subagent execution but not the external-build enablement requirement

Total scope: 3 pages affected

Source: Changelog v2.1.117

Exact changelog entry: Forked subagents can now be enabled on external builds by setting CLAUDE_CODE_FORK_SUBAGENT=1

extent analysis

TL;DR

Add CLAUDE_CODE_FORK_SUBAGENT to the environment variable reference and update cloud-session docs to enable forked subagents on external builds.

Guidance

  • Add a description for CLAUDE_CODE_FORK_SUBAGENT in the environment variable reference, such as: CLAUDE_CODE_FORK_SUBAGENT — Set to 1 to enable forked subagents on external builds/cloud sessions.
  • Update the cloud-session documentation to include a note about setting CLAUDE_CODE_FORK_SUBAGENT=1 to enable forked subagents.
  • Consider adding a cross-reference from the skills/subagent docs to the environment variable reference for users to discover the requirement.
  • Verify the changes by checking the affected pages: https://code.claude.com/docs/en/claude-code-on-the-web, https://code.claude.com/docs/en/env-vars, and https://code.claude.com/docs/en/skills.

Example

No code snippet is necessary for this documentation update.

Notes

The suggested improvement should be applied to the three affected pages to ensure consistent documentation and prevent user confusion.

Recommendation

Apply the workaround by adding the CLAUDE_CODE_FORK_SUBAGENT environment variable to the documentation, as it is a necessary step to enable forked subagents on external builds, and the current documentation lacks this crucial information.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [DOCS] Cloud session docs missing `CLAUDE_CODE_FORK_SUBAGENT` enablement for forked subagents [1 participants]