[BUG] Read/Write/Bash tools fail with "Command failed: cygpath -u" on Windows
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?
On Windows 10, the Read, Write, and Bash tools fail with Command failed: cygpath -u 'C:\Temp' even though cygpath.exe is installed and working correctly in the system PATH.
Environment:
OS: Windows 10 (MSYS_NT-10.0-19045)
Claude Code version: 2.1.30
Git for Windows installed (includes cygpath.exe at C:\Program Files\Git\usr\bin\cygpath.exe)
WSL Ubuntu also installed
Steps to Reproduce:
Install Claude Code on Windows 10
Launch Claude Code from any directory (tested both C:\ClaudePlayground and paths with spaces)
Attempt to use Read, Write, or Bash tools
Expected Behavior:
Tools should execute normally, using the system-installed cygpath.exe for path conversion.
Actual Behavior:
All Read, Write, and Bash operations fail immediately with:
Command failed: cygpath -u 'C:\Temp'
The error occurs during internal initialization, before the actual command runs. The C:\Temp path suggests Claude Code is trying to convert a temp directory path and failing.
Diagnostic Information:
cygpath.exe works correctly from PowerShell:
PS> & "C:\Program Files\Git\usr\bin\cygpath.exe" -u "C:\Users\jaytw"
/c/Users/jaytw
cygpath.exe is in the system PATH:
PS> where.exe cygpath
C:\Program Files\Git\usr\bin\cygpath.exe
Git Bash can run cygpath:
PS> & "C:\Program Files\Git\bin\bash.exe" -c "cygpath -u 'C:\Users\jaytw'"
/c/Users/jaytw
Glob and Grep tools work correctly - only Read, Write, and Bash fail.
Debug logs show:
[DEBUG] Using bash path: "C:\Program Files\Git\bin\git.exe"
[ERROR] Command failed: cygpath -u 'C:\Temp'
Note: The bash path shows git.exe which is incorrect - it should be bash.exe.
Attempted Fixes (none worked):
Added C:\Program Files\Git\usr\bin to system PATH
Created .bashrc with PATH export
Full system restart
Tested with simple directory paths (no spaces)
Configured preferredShell in settings.json
Suspected Cause:
Claude Code's internal process spawning doesn't inherit the Windows PATH correctly, and/or it's incorrectly detecting git.exe as the bash executable instead of bash.exe.
What Should Happen?
Tools should execute normally, using the system-installed cygpath.exe for path conversion.
Error Messages/Logs
Steps to Reproduce
Install Claude Code on Windows 10
Launch Claude Code from any directory (tested both C:\ClaudePlayground and paths with spaces)
Attempt to use Read, Write, or Bash tools
Claude Model
Opus
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
2.1.30
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Other
Additional Information
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗