Sweep 19 Sep 2026 · 02:36Z Build v2.1.278 500 read Stable v2.1.267 Latest v2.1.278 Next v2.1.278 Feeds RSS JSON llms.txt Unofficial
Claude Code v2.1.269 ·

New CLAUDE_CODE_SESSION_ATTENDED environment variable for child sessions

A new CLAUDE_CODE_SESSION_ATTENDED env var tells spawned Claude Code child processes whether the parent session is an attended, interactive one

TierUnder the hoodhow much it should matter to you
Useful2my rating, 1 to 5
Signal2worth watching, 1 to 5
AreaSessionswhat it touches
KindInternal Changesin v2.1.269,
Group of 2 Under the hood Notable No documentation found

A new CLAUDE_CODE_SESSION_ATTENDED env var tells spawned Claude Code child processes whether the parent session is an attended, interactive one

What

When Claude Code spawns a child process (a sub-process running its own Claude Code session), it now sets a new environment variable, CLAUDE_CODE_SESSION_ATTENDED, to "1" or "0". This is computed by checking whether the session type isn't a background/daemon/daemon-worker session and whether the session is interactive or was launched from a known interactive launcher (such as VS Code, the desktop app, or remote access). The child process reads this value back via setSpawnedByAttendedSession.

That flag then feeds into a check (spawnedByAttendedSession) that determines whether a non-interactive (non-TTY) child session probes for an 'ambient marker' (a signal used for session persistence, e.g. related to tmux) before falling back to other session-persistence behavior.

Why

This lets a child Claude Code process know whether it was launched from a real, attended user session versus an unattended/background one, so it can make a more accurate decision about how to persist or recover its session.

Read from
Names in the bundleCLAUDE_CODE_SESSION_ATTENDED
How sure we are
Something disagreesSomething we can check disagrees with this entry, or the writer said they could not settle it.
The writer flagged doubtThe finding doesn't say exactly what persistence behavior changes as a result, only that the flag gates the probe.
The name it cites is new in this buildNew in this build: CLAUDE_CODE_SESSION_ATTENDED

See this entry in the whole of v2.1.269 →