[BUG] Run shell command failed in bash mode , shell-snapshot change behavior of some common command like "cd"
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 I try to run shell commands in bash mode, the execution results of some commands don't match my expectations. For example, even the basic cd command is throwing errors.
<img width="946" height="398" alt="Image" src="https://github.com/user-attachments/assets/a60054e5-febf-4a8e-8e50-d118e2080cc3" />
When I checked the files in the shell-snapshot, I found that cd had been reimplemented.
<img width="2458" height="2352" alt="Image" src="https://github.com/user-attachments/assets/19331e6d-8236-466c-af6a-7067bb7065cf" />
Therefore, I guess the issue is most likely related to shell initialization, but I can't find any offcial documentation or issues related to shell-snapshot for reference.
What Should Happen?
the command execution to behave the same as when run normally in zsh.
Error Messages/Logs
Steps to Reproduce
As long as my default $SHELL is zsh, the issue persists, including unexpected behavior when using gvm.
Claude Model
None
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
1.0.128
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗