[BUG] [platform:windows] git-bash -> bash: /c: Is a directory Exit 126

Resolved 💬 9 comments Opened Jul 15, 2025 by oryon-dominik 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

  1. Run Claude Code in Windows Terminal with PowerShell 7 and Git Bash available
  2. Have Claude execute any bash command using the Bash tool
  3. Claude internally generates: /usr/bin/bash --login -i /c CALL <path.to.node.exe>
  4. 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
CALL
), resulting in syntax errors and command execution failures.

## Additional Context

  • This occurs when Claude uses the Bash tool internally
  • The /c flag is valid for Windows CMD but not for bash
  • The CALL command is Windows batch syntax, not bash
  • Git Bash is installed and functional when used directly

View original on GitHub ↗

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