CLAUDE_CODE_CHILD_SESSION
A Claude Code environment variable, read out of the shipped bundle. It has been in the build since v2.1.172, including the newest one read.
Set to 1 in subprocesses Claude Code spawns via the Bash, PowerShell, and Monitor tools, hook commands, and status line commands. Not set for stdio MCP server subprocesses, which are long-lived and outlive the session that spawned them. Unlike CLAUDECODE, this is only set by Claude Code itself when it launches a subprocess and not by IDE extensions, so it reliably distinguishes a nested session from a top-level claude launched in an IDE-integrated terminal. A nested interactive claude TUI started this way is automatically excluded from --resume, --continue, up-arrow history, and the claude agents list. Non-interactive claude -p sessions still persist. Set CLAUDE_CODE_FORCE_SESSION_PERSISTENCE=1 to override this exclusion. Requires Claude Code v2.1.172 or later
Anthropic's own wording. Read off Environment variables, captured 2026-09-28.
In the changelogs
10Releases whose published page names CLAUDE_CODE_CHILD_SESSION.
-
v2.1.286
Editor commands now share one check for being run inside a session
The skill, Chrome and worktree editor commands now use one shared check before refusing to run from inside a Claude Code session
found in this entry's text, named in this entry
-
v2.1.285
Hidden command lets the VS Code extension clear out deleted worktrees
A hidden
claude drop-worktree-registrationscommand, used by the VS Code extension, removes git's records of deleted worktreesfound in this entry's text
-
v2.1.284
New message about signing in to Claude Design from inside a Claude Code session
Claude Code includes a new error saying Claude Design cannot be signed in from inside a Claude Code session
found in this entry's text, named in this entry
-
v2.1.280
claude edit-hook refuses to run when spawned inside a Claude Code session
The 'claude edit-hook' command now refuses to run from inside another Claude Code session
found in this entry's text, named in this entry
-
v2.1.280
Three new hidden CLI settings-edit commands for the VS Code extension
Three new hidden CLI commands let the VS Code extension edit skill, sandbox, and Chrome settings
found in this entry's text
-
v2.1.269
claude plugin eval initcan delegate the authoring interview to a parent Claude Code sessionclaude plugin eval initcan now hand its interview off to the parent Claude Code session instead of failing without a terminalfound in this entry's text
-
v2.1.269
'claude plugin eval' skips auto-publishing its report when the run looks like it was launched by Claude Code itself
'claude plugin eval' no longer auto-publishes reports when the run looks machine-launched rather than started by a person
found in this entry's text
-
v2.1.267
projectsOwnerRowsForwarding: owner-row credit forwarding gated behind NPt()/vsr()
A new owner-row credit-forwarding feature for auto mode is gated behind conditions and disabled in nested or teammate sessions
found in this entry's text, named in this entry
-
v2.1.217
Transcript Persistence Warnings
found in this entry's text
-
v2.1.172
CLAUDE_CODE_CHILD_SESSION Environment Variable
found in this entry's text
First cited
1The earliest release whose published evidence quoted CLAUDE_CODE_CHILD_SESSION was v2.1.172, 10 Jun 2026. That is the oldest release this project wrote about it, so it is a floor on the name's age and not the release that introduced it. It is not a presence reading: which builds carried the name is the table below.
Presence across releases
1Build by build
119One row per release since the first build this name was read out of. Absent means the build was read and the name was not in it, never mined means no bundle for that release was ever archived, and a declared type or a default is only ever what that release's own bundle stated.
Read out of the published npm bundle release by release, and out of Anthropic's own documentation as this site captured it. Nothing on this page is a description anybody here wrote about what the environment variable does. All environment variables.