[BUG] System prompt guidance on not using 'cd' in Bash leads to repeated failures
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?
I use Claude Code with Opus 4.7 in a scenario where deployment takes place on a remote machine and Claude has to execute commands over ssh. On the remote machine it needs to use cd to change directory. This used to work but now it often results in the agent failing to correctly preprend the 'cd' to its chain of commands. It will fail over and over again. The model at one point said that it could see its 'cd' was not appended and it was 'forgetting' to do it because of instructions in my CLAUDE.md. When I asked it instead clarified that it meant the system prompt, and showed me a chunk of text from the instructions on the Bash tool that instruct Claude not to use 'cd' unless given explicit permission by the user.
What Should Happen?
Claude should use the appropriate tools necessary to solve the problem. In this case, 'cd'.
Error Messages/Logs
Steps to Reproduce
Have claude need to edit / deploy a system on a remote host whereby the commands piped to ssh would require a 'cd' before them to succeed.
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.23
Platform
AWS Bedrock
Operating System
Other Linux
Terminal/Shell
Other
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗