[BUG] [platform:windows] git-bash -> bash: /c: Is a directory Exit 126
Status Fixed / completed
Maintainer reply None cached
Workaround ✓ Mentioned in thread ↓
Activity 9 comments · opened Jul 15, 2025 · closed Jul 21, 2025
Environment
- Claude CLI version: 1.0.51 (Claude Code)
- Operating System: Windows 11
- Terminal: Windows-Terminal Version: 1.22.11141.0
Bug Description
Claude Code's Bash tool generates malformed commands on Windows by mixing Unix and Windows command syntax. When
Claude attempts to execute bash commands, it incorrectly constructs commands with Windows CMD syntax (/c CALL)
in a bash context, causing execution failures.
## Steps to Reproduce
- Run Claude Code in Windows Terminal with PowerShell 7 and Git Bash available
- Have Claude execute any bash command using the Bash tool
- Claude internally generates:
/usr/bin/bash --login -i /c CALL <path.to.node.exe> - Command fails with error:
bash: /c: Is a directory Exit 126
## Expected Behavior
Claude Code should generate proper bash commands for Windows environments, such as:
bash --login -i -c "command"(for Git Bash)- Or use appropriate Windows command syntax if targeting CMD
## Actual Behavior
Claude Code generates hybrid commands mixing Unix bash invocation (/usr/bin/bash) with Windows CMD flags (/c), resulting in syntax errors and command execution failures.
CALL
## Additional Context
- This occurs when Claude uses the Bash tool internally
- The
/cflag is valid for Windows CMD but not for bash - The
CALLcommand is Windows batch syntax, not bash - Git Bash is installed and functional when used directly
9 Comments
i got same error!
<img width="302" height="62" alt="Image" src="https://github.com/user-attachments/assets/251994b5-d8ea-4656-95d6-cacad3b97daf" />
<img width="312" height="53" alt="Image" src="https://github.com/user-attachments/assets/c37cc6d9-d5a2-4885-b7e1-ff0dd6e688b1" />
so, did we find why it causing error?
Looks like @oryon-dominik nailed the issue.
Workaround
Create or edit your
~/.bashrcfile to alias the script and run it directly in node.For example, just like @fatihaziz, I ran into this issue with
pnpm. By default, pnpm's$PATHpoints to a bash and/or .cmd script (this is whatwhich pnpmwill point to). We have to bypass those scripts because it looks like CC calls them incorrectly. We'll aliaspnpmto run directly via node instead.Mine looked like:
```.bashrc
alias pnpm='node /c/Users/<User>/AppData/Roaming/npm/node_modules/pnpm/bin/pnpm.cjs'
✅ Fixed.
Updated the
CLAUDE_CODE_GIT_BASH_PATHfrom<USERPROFILE>\scoop\shims\git-bash.exeto
<USERPROFILE>\scoop\apps\git\current\bin\bash.exeWorks as expected now. Closing.
how can I update it? I can't find where that setting is
@Mtartup find your preferred
bash.exeon your system and set an environment variableCLAUDE_CODE_GIT_BASH_PATHto match that path.Unfortunately that didn't fix it for me
Same here. It's not working. My install location is C:\Users\<user>\AppData\Local\Programs\Git\bin\bash.exe
I fixed it,uninstall your Git, and install it on the C drive.
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.