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.
What it is
Set to 1 in subprocesses Claude Code spawns via the Bash, PowerShell, and Monitor tools, [hook](/docs/en/hooks) commands, and [status line](/docs/en/statusline) commands. Not set for stdio [MCP server](/docs/en/mcp) 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-08-28.
Presence across releases
| Releases | Reading | Declared type | Default |
|---|---|---|---|
| 2.1.245 – 2.1.250 5 releases | never mined | — | — |
| 2.1.172 – 2.1.243 65 releases | in the build | bool | — |
A row reading never mined is a release with no archived bundle behind it. Nothing was read out of it, so nothing here says whether the name was in it. A declared type or a default is only ever what that release's own bundle stated.
Changelog entries naming it
No changelog entry here has ever named it. That is a statement about what has been written, not about the name: it has been in the build since v2.1.172 without anybody writing a line about it.
Documentation pages
- Environment variables reference table Claude Code CLI
- Error reference mentions it Claude Code CLI
- Recommend your plugin from your CLI mentions it Claude Code CLI
A reference table page is one whose own table defines this name, and it is where the description above came from. A page that mentions it carries the name somewhere in its text and may say nothing about it at all. Every page carrying it.
Names beside it
Every environment variable in the inventory starting claude_code, up to twelve of them.
CLAUDE_CODE_3P_PROBE_WROTE_OPUS_DEFAULTNo description from anybody. 2.1.207
CLAUDE_CODE_3P_PROBE_WROTE_SONNET_DEFAULTNo description from anybody. 2.1.207
CLAUDE_CODE_ACCESSIBILITYSet to 1 to keep the native terminal cursor visible and disable the inverted-text cursor indicator. Allows screen magnifiers like macOS Zoom to track cursor position 2.1.138
CLAUDE_CODE_ACCOUNT_TAGGED_IDNo description from anybody. 2.1.138
CLAUDE_CODE_ACCOUNT_UUIDThe device bridge is skipped entirely when the host's account UUID doesn't match the stored one. 2.1.138
CLAUDE_CODE_ACT_DONT_REDERIVEThree existing feature gates moved position; their defaults are unchanged. 2.1.162
CLAUDE_CODE_ACTIONNo description from anybody. 2.1.138
CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MDSet to 1 to load memory files from directories specified with --add-dir. Loads CLAUDE.md, .claude/CLAUDE.md, .claude/rules/*.md, and CLAUDE.local.md. By default, additional directories do not load memory files 2.1.138
CLAUDE_CODE_ADDITIONAL_PROTECTIONNo description from anybody. 2.1.138
CLAUDE_CODE_ADOPT_UNDERIVABLE_PARKED_PERMISSIONA resumed headless session could hand you back a permission prompt left unanswered, but three variables must be set. 2.1.238
CLAUDE_CODE_AGENTNo description from anybody. 2.1.138
CLAUDE_CODE_AGENT_COST_STEERNo description from anybody. 2.1.138
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.