[BUG] CLAUDE_ENV_FILE not sourced on resumed sessions (--continue)
Resolved 💬 3 comments Opened Nov 26, 2025 by ww2283 Closed Nov 29, 2025
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When using claude --continue or claude --resume, the CLAUDE_ENV_FILE written by SessionStart hooks is not
sourced, even though the hooks run successfully.
What Should Happen?
Environment variables written to CLAUDE_ENV_FILE during SessionStart hooks should be available in subsequent Bash
commands, regardless of whether the session is fresh or resumed.
- Fresh session:
CLAUDE_ENV_FILEis sourced correctly ✓ - Resumed session: Hook runs, writes to file, but variables NOT available ✗
Error Messages/Logs
Steps to Reproduce
- Create SessionStart hook writing to
CLAUDE_ENV_FILE - Fresh start:
claude→echo $TEST_VAR→ works - Resume:
claude --continue→echo $TEST_VAR→ empty
Claude Model
None
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
2.0.52
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
## Use Case
Loading .envrc (direnv) at session start. Users use --continue for context but lose environment.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗