Preflight Checklist
What's Wrong?
CLAUDE_SESSION_ID seems to be no longer available in the main agent context.
❯ What is CLAUDE_SESSION_ID?
⏺ CLAUDE_SESSION_ID is a built-in environment variable provided by Claude Code that contains a unique identifier for the current conversation/session. It's a UUID that stays
constant throughout a single conversation but changes when a new conversation starts.
You can see its current value:
⏺ Bash(echo $CLAUDE_SESSION_ID)
⎿ (No content)
⏺ Interesting — it's empty in this shell context. Let me check how it's typically available:
⏺ Bash(env | grep -i claude)
⎿ CLAUDE_CODE_SSE_PORT=32421
CLAUDE_CODE_ENTRYPOINT=cli
CLAUDECODE=1
What Should Happen?
CLAUDE_SESSION_ID should be exported and available.
Error Messages/Logs
Steps to Reproduce
- start claude:
claude
- ask for
CLAUDE_SESSION_ID
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
No response
Claude Code Version
2.1.37
Platform
Other
Operating System
macOS
Terminal/Shell
iTerm2
Additional Information
No response
Preflight Checklist
What's Wrong?
CLAUDE_SESSION_IDseems to be no longer available in the main agent context.What Should Happen?
CLAUDE_SESSION_IDshould be exported and available.Error Messages/Logs
Steps to Reproduce
claudeCLAUDE_SESSION_IDClaude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
No response
Claude Code Version
2.1.37
Platform
Other
Operating System
macOS
Terminal/Shell
iTerm2
Additional Information
No response