[BUG] Shell Snapshot cause incorrect environment loaded
Environment
- Platform (select one):
- [x] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [ ] Other: <!-- specify -->
- Claude CLI version: 1.0.48 (Claude Code)
- Operating System: macOS 15.4.1
- Terminal: Ghostty + tmux + zsh
Bug Description
The shell snapshot feature causes the environment lookup to be incorrect.
Steps to Reproduce
When I work with 2 directories with uv venv feature:
/project_a/.venv
/project_b/.venv
I run the claude to enter Claude Code at /project_a and it snapshots the PATH=/project_a/.venv/bin. Then, I switch to /project_b and enter the Claude Code, the PATH is still PATH=/project_a/.venv/bin cannot be changed to PATH=/project_b/.venv/bin
Expected Behavior
Switch to another directory, it should follow the shell's environment instead of the "first enter claude shell" status.
Actual Behavior
When entering Claude at any shell, it always uses the same configuration and cannot be changed unless the snapshot file is removed. It causes many environment-based config losses and cannot work with the correct terminal config.
Additional Context
<!-- Add any other context about the problem here, such as screenshots, logs, etc. -->
6 Comments
Yeah, this is pretty bad if you use something like
direnvas well since your entire shell is different quite regularly. I'm guessing this is a regression in 1.0.48 which has this changelog entry:One of my machines is still running
1.0.44which has no issues.Sorry for this regression. This was an unintended side effect of fixing #2139
We'll get a fix out for this on Monday
Thanks! Rolling back a huge issue on my end. Have a good weekend.
@wolffiex
After upgrading to
1.0.51, I still got an incorrect environment. Is it fixed?yes, please upgrade to 1.0.56 and open a new issue if you're still having problems
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.