[BUG] Claude Code calls `cd` too many times when not needed

Resolved 💬 2 comments Opened Mar 2, 2026 by kosinal Closed Mar 2, 2026

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 Code, it is calling cd command almost before every bash command. Unfortunally, commands like cd XYZ && {do something} needs to be checked separately and allow all, or do not ask, does not work for them.

Claude code should not prepend bash commands with cd unless it needs to.

This is an image of my session, where CD had been called 3 time is succession. None of these is needed.
<img width="1089" height="437" alt="Image" src="https://github.com/user-attachments/assets/ac53820a-a6e6-4f95-b05d-be9c27c576a5" />

I am not changing directories or do not ask Claude Code to do it.

This happens both in worktree, or without worktree.

What Should Happen?

Claude code should use cd only when it needs to change the directory.

Error Messages/Logs

Steps to Reproduce

Force to use CC any bash command.

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.63

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

_No response_

View original on GitHub ↗

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