Documentation Type
Missing documentation (feature not documented)
Documentation Location
https://code.claude.com/docs/en/env-vars
Section/Topic
The environment variables table (alphabetical listing)
Current Documentation
The env-vars reference page lists CLAUDE_CODE_REMOTE_SESSION_ID:
CLAUDE_CODE_REMOTE_SESSION_ID — Set automatically in cloud sessions to the current session's ID. Read this to construct a link back to the session transcript.
No entry exists for CLAUDE_CODE_SESSION_ID. The page documents related session-ID variables but omits this one.
What's Wrong or Missing?
The changelog for v2.1.132 records this addition:
Added CLAUDE_CODE_SESSION_ID environment variable to the Bash tool subprocess environment, matching the session_id passed to hooks
The session_id field is documented in the hooks reference as a common field passed to all hooks:
"session_id" — Current session identifier
However, the env-vars reference page has no entry for CLAUDE_CODE_SESSION_ID, leaving users without a description of its purpose, when it is set, or how it differs from CLAUDE_CODE_REMOTE_SESSION_ID.
Suggested Improvement
Add an entry to the environment variables table for CLAUDE_CODE_SESSION_ID. Suggested description:
Set automatically in Bash tool subprocesses to the current session's identifier, matching the session_id field passed to hooks. Use this to correlate Bash subprocess activity with a specific Claude Code session.
Placement should be near CLAUDE_CODE_SESSIONEND_HOOKS_TIMEOUT_MS (alphabetically).
Impact
Medium - Makes feature difficult to understand
Additional Context
Changelog source (v2.1.132): https://code.claude.com/docs/en/changelog#2.1.132
Added CLAUDE_CODE_SESSION_ID environment variable to the Bash tool subprocess environment, matching the session_id passed to hooks
Hooks reference — common fields (session_id): https://code.claude.com/docs/en/hooks#common-input-fields
session_id — Current session identifier
Affected Pages:
Total scope: 1 page affected (env-vars)
Documentation Type
Missing documentation (feature not documented)
Documentation Location
https://code.claude.com/docs/en/env-vars
Section/Topic
The environment variables table (alphabetical listing)
Current Documentation
The env-vars reference page lists
CLAUDE_CODE_REMOTE_SESSION_ID:No entry exists for
CLAUDE_CODE_SESSION_ID. The page documents related session-ID variables but omits this one.What's Wrong or Missing?
The changelog for v2.1.132 records this addition:
The
session_idfield is documented in the hooks reference as a common field passed to all hooks:However, the env-vars reference page has no entry for
CLAUDE_CODE_SESSION_ID, leaving users without a description of its purpose, when it is set, or how it differs fromCLAUDE_CODE_REMOTE_SESSION_ID.Suggested Improvement
Add an entry to the environment variables table for
CLAUDE_CODE_SESSION_ID. Suggested description:Placement should be near
CLAUDE_CODE_SESSIONEND_HOOKS_TIMEOUT_MS(alphabetically).Impact
Medium - Makes feature difficult to understand
Additional Context
Changelog source (v2.1.132): https://code.claude.com/docs/en/changelog#2.1.132
Hooks reference — common fields (session_id): https://code.claude.com/docs/en/hooks#common-input-fields
Affected Pages:
CLAUDE_CODE_SESSION_IDnot listedsession_idfield documented for hooksTotal scope: 1 page affected (env-vars)