[DOCS] `CLAUDE_CODE_SESSION_ID` env var docs still describe pre-v2.1.163 stdio MCP resume behavior

Resolved 💬 1 comment Opened Jun 4, 2026 by coygeek Closed Jun 27, 2026

Documentation Type

Incorrect/outdated documentation

Documentation Location

https://code.claude.com/docs/en/env-vars

Section/Topic

CLAUDE_CODE_SESSION_ID environment variable entry

Current Documentation

The docs currently say:

CLAUDE_CODE_SESSION_ID | Set automatically to the current session ID in Bash and PowerShell tool subprocesses, hook command subprocesses, and stdio MCP server subprocesses. For Bash, PowerShell, and hooks this matches the session_id field in the hook JSON input and is updated on /clear. An MCP server subprocess retains the ID it was spawned with, and may receive the initial startup ID rather than the resumed ID when launched via --resume or --continue. Use to correlate scripts and external tools with the Claude Code session that launched them

The v2.1.163 release notes say:

stdio MCP servers now receive the same CLAUDE_CODE_SESSION_ID as hooks/Bash on --resume

What's Wrong or Missing?

The env-vars page still documents the old stdio MCP resume behavior after the v2.1.163 release changed it.

A. The stdio MCP note still says resumed servers may keep the startup session ID

The current CLAUDE_CODE_SESSION_ID row says a stdio MCP subprocess "may receive the initial startup ID rather than the resumed ID when launched via --resume or --continue." That directly conflicts with the v2.1.163 release note saying stdio MCP servers now receive the same session ID behavior as hooks and Bash on resume.

B. The page no longer explains the post-fix parity clearly

The same row already explains that Bash, PowerShell, and hooks use the current session ID. After v2.1.163, stdio MCP servers on --resume should be described in the same current-session terms instead of being called out as a stale exception.

Suggested Improvement

Update the CLAUDE_CODE_SESSION_ID row in env-vars so the stdio MCP portion matches the v2.1.163 behavior.

Minimum fix:

Before:

An MCP server subprocess retains the ID it was spawned with, and may receive the initial startup ID rather than the resumed ID when launched via --resume or --continue.

After:

In Bash and PowerShell tool subprocesses, hook command subprocesses, and stdio MCP server subprocesses, CLAUDE_CODE_SESSION_ID is set to the current Claude Code session. On --resume or --continue, stdio MCP servers receive the resumed session ID so it stays aligned with hooks and shell tools.

If there are edge cases where only newly spawned stdio MCP subprocesses get the resumed ID, document that explicitly instead of leaving the current stale blanket statement in place.

Impact

Medium - Makes feature difficult to understand

Additional Context

Affected Pages:

| Page | Context |
|------|---------|
| https://code.claude.com/docs/en/env-vars | CLAUDE_CODE_SESSION_ID still says stdio MCP subprocesses may keep the initial startup ID on --resume / --continue |
| https://github.com/anthropics/claude-code/releases/tag/v2.1.163 | Release notes say stdio MCP servers now receive the same CLAUDE_CODE_SESSION_ID as hooks/Bash on --resume |

Total scope: 2 pages affected

This appears to be an outdated docs statement that remained after the v2.1.163 resume-behavior fix. The issue is specifically about resume/continue behavior for stdio MCP server subprocesses, not the broader CLAUDECODE environment variable coverage.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗