[BUG] cygpath command fails on Windows with Git Bash (MINGW64) - all file operations broken
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?
Description:
Claude Code is completely non-functional on Windows with Git Bash (MINGW64). Every single file operation (Read, Write, Edit, Bash) fails with:
Command failed: cygpath -u 'C:\Users\...\path'
Environment:
Windows 10/11
Git for Windows (MINGW64)
cygpath (cygwin) 3.6.6
Claude Code v2.1.38 (both Desktop app and npm CLI @anthropic-ai/claude-code)
Node.js installed via nodejs.org LTS
Steps to reproduce:
Install Claude Code on Windows (Desktop app or npm install -g @anthropic-ai/claude-code)
Open any project
Try ANY file operation - Read, Write, Edit, or Bash command
All fail with cygpath -u error
What works: Only Glob and Grep tools work (they apparently don't use cygpath).
What I tried (NONE of these fixed it):
Setting SHELL environment variable to Git Bash path
Setting MSYS, MSYSTEM, HOME environment variables
Adding C:\Program Files\Git\usr\bin to both User and Machine PATH
Creating a symlink C:\Windows\System32\cygpath.exe → Git's cygpath
Copying cygpath.exe + all MSYS DLLs (msys-2.0.dll, msys-intl-8.dll, msys-iconv-2.dll) to System32
Full system restart (multiple times)
Running Claude Desktop from PowerShell with PATH manually set
Installing Claude Code CLI via npm and running from Git Bash
Confirmed: cygpath -u "C:\Users\..." works perfectly fine when run manually in both Git Bash and PowerShell. The issue is specifically how Claude Code spawns its child processes - they don't inherit the correct PATH or MSYS2 environment.
Impact:
I spent my entire monthly Pro usage trying to debug this issue across multiple sessions. Claude itself kept suggesting PATH fixes, symlinks, DLL copies, restarts - none of which worked because the bug is in Claude Code's own process spawning logic, not in my system configuration.
I burned through hundreds of thousands of tokens going in circles trying to fix a bug that is entirely on Anthropic's side. This is extremely frustrating. Claude Code on Windows is advertised as functional, but it is fundamentally broken for any Git Bash / MINGW64 user. The tool is literally unusable - it cannot read a file, write a file, or execute a single command.
This should be a P0 fix. Windows + Git Bash is one of the most common developer setups. Please either:
Fix the cygpath subprocess spawning to inherit the correct environment, or
Don't use cygpath at all - use Node.js path module for path conversion instead
What Should Happen?
It works!
Error Messages/Logs
Steps to Reproduce
Claude Code is completely non-functional on Windows with Git Bash (MINGW64). Every single file operation (Read, Write, Edit, Bash) fails with:
Command failed: cygpath -u 'C:\Users\...\path'
Environment:
Windows 10/11
Git for Windows (MINGW64)
cygpath (cygwin) 3.6.6
Claude Code v2.1.38 (both Desktop app and npm CLI @anthropic-ai/claude-code)
Node.js installed via nodejs.org LTS
Steps to reproduce:
Install Claude Code on Windows (Desktop app or npm install -g @anthropic-ai/claude-code)
Open any project
Try ANY file operation - Read, Write, Edit, or Bash command
All fail with cygpath -u error
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.38 (Claude Code)
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
PowerShell
Additional Information
_No response_
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗