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.
The finding doesn't say exactly what persistence behavior changes as a result, only that the flag gates the probe.
New in this build: CLAUDE_CODE_SESSION_ATTENDED