Bash Command Execution Fails on Windows with Cygpath Not Found

Status Fixed / completed
Maintainer reply ✓ Yes — ant-kurt
Activity 5 comments · opened Jul 18, 2025 · closed Jul 21, 2025
💡 Likely answer: A maintainer (ant-kurt, collaborator) responded on this thread — see the highlighted reply below.

Bug Description
since 1.0.55, claude code can't execute any bash commands. Search, LS, Grep and all other tools work fine. Just the Bash tool gives this error:

Error: Command failed: cygpath -u 'C:\Users\xxxx\AppData\Local\Temp'
/usr/bin/bash: line 1: cygpath: command not found
⎿  Interrupted by user

Environment Info

  • Platform: win32
  • Terminal: windows-terminal
  • Version: 1.0.55
  • Feedback ID: 07978100-3678-4978-8c9a-f5d3783a2f14

Errors

[{"error":"Error: Command failed: tasklist | findstr /I \"Code.exe Cursor.exe Windsurf.exe idea64.exe pycharm64.exe webstorm64.exe phpstorm64.exe rubymine64.exe clion64.exe goland64.exe rider64.exe datagrip64.exe appcode.exe dataspell64.exe aqua64.exe gateway64.exe fleet.exe studio64.exe\"\nFINDSTR: Cannot open Code.exe Cursor.exe Windsurf.exe idea64.exe pycharm64.exe webstorm64.exe phpstorm64.exe rubymine64.exe clion64.exe goland64.exe rider64.exe datagrip64.exe appcode.exe dataspell64.exe aqua64.exe gateway64.exe fleet.exe studio64.exe\r\n\n    at genericNodeError (node:internal/errors:983:15)\n    at wrappedFn (node:internal/errors:537:14)\n    at checkExecSyncError (node:child_process:883:11)\n    at execSync (node:child_process:955:15)\n    at q5 (file:///C:/Users/xxxx/OneDrive/Documenten/LocalApps/node-v22.17.0-win-x64/node_modules/@anthropic-ai/claude-code/cli.js:727:4693)\n    at tc (file:///C:/Users/xxxx/OneDrive/Documenten/LocalApps/node-v22.17.0-win-x64/node_modules/@anthropic-ai/claude-code/cli.js:1208:1937)\n    at file:///C:/Users/xxxx/OneDrive/Documenten/LocalApps/node-v22.17.0-win-x64/node_modules/@anthropic-ai/claude-code/cli.js:2654:9369\n    at async file:///C:/Users/xxxx/OneDrive/Documenten/LocalApps/node-v22.17.0-win-x64/node_modules/@anthropic-ai/claude-code/cli.js:2409:6947\n    at async Promise.all (index 12)\n    at async XZ4 (file:///C:/Users/xxxx/OneDrive/Documenten/LocalApps/node-v22.17.0-win-x64/node_modules/@anthropic-ai/claude-code/cli.js:2409:6906)","timestamp":"2025-07-18T13:01:15.443Z"}]

View original on GitHub ↗

4 Comments

ant-kurt collaborator · 1 year ago

Would you mind providing some additional info to help debug this?

  • Are you setting a custom CLAUDE_CODE_GIT_BASH_PATH?
  • If so, can you try running your/path/to/bash.exe -c "cygpath C:"? If this fails, that means your bash.exe may not have the proper environment loaded. There are sometimes a few different bash.exe paths that Git for Windows installs, some of which may not have the full environment configured.
  • Otherwise, can you provide the results of where.exe git?
nhopDV · 1 year ago

Thanks @ant-kurt for the debugging guidance! With your suggestions and Claude Code's help, I was able to
identify and resolve the issue.

Diagnostic Results:

  • CLAUDE_CODE_GIT_BASH_PATH: Not set (empty)
  • where.exe git: C:\Users\[username]\AppData\Local\Programs\Git\cmd\git.exe
  • The bash environment was missing cygpath, indicating Claude Code was using the wrong bash executable

Root Cause:
Claude Code was using /usr/bin/bash instead of Git Bash, which explains why cygpath wasn't available.

Solution:
Set the CLAUDE_CODE_GIT_BASH_PATH environment variable to point to your Git Bash executable:

CLAUDE_CODE_GIT_BASH_PATH=C:\Users\[username]\AppData\Local\Programs\Git\bin\bash.exe

This completely resolved the bash command issues for me. Thanks for the help debugging this!

HHHNEO · 1 year ago

In my case, I also had to add C:\Program Files\Git\usr\bin to my environment variables to resolve the issue.

I found the solution in the following document:
https://www.deepresearcharchives.com/item/cQQQCLNyPFiY

github-actions[bot] · 1 year ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

Showing cached comments. Read the full discussion on GitHub ↗