Claude does "cd" even when it doesn't need to

Resolved 💬 10 comments Opened Mar 5, 2025 by greggh Closed Jul 31, 2025

Bug Description
I am working on 9 different projects at once. This is due to the nature of the projects, a base project template with github project best practices, a testing library for lua projects, and the projects that implement both of them. This means I need to run claude in one directory, and have it access and run commands in all 9 of those directories, and a couple other directories I am using to keep a project plan up to date and a library of prompts I have created with Claude Code to make all of this work easier. The big problems I run into are the fact that Claude code continues to try and use the cd command when it is not allowed do to your security settings. I tell it to use pushd and popd to run commands in directories, or git -C for git commands in other directories, or sometimes full file paths. That is all part of the initial prompt I always give Claude Code when starting up. It works sometimes, others it just forgets those instructions. But worse is that when it gives me the prompt with 3 options where I can say Yes, Yes and don't ask again, or No, it does not remember that I have said yes and dont ask again for those types of commands. It will ask me and I will say yes and dont ask again, and then it will ask me again. Over and Over. This is for any command that has to happen in other directories from the current working directory, but especially for commands that use pushd / popd or git -C. If this was fixed I would do my work in half the time.

Environment Info

  • Platform: linux
  • Terminal: kitty
  • Version: 0.2.30
  • Feedback ID: 32262158-fa9f-48d0-bb69-ce3060c31ac3

View original on GitHub ↗

This issue has 10 comments on GitHub. Read the full discussion on GitHub ↗