[BUG] Claude Code fails to resolve Git Bash path with space in Windows (`Program Files`)

Resolved 💬 7 comments Opened Jul 26, 2025 by eezy0 Closed Aug 15, 2025

Environment

  • Platform:
  • Anthropic API
  • Claude CLI version: 1.0.61
  • Operating System: Windows 11
  • Terminal: PowerShell

Bug Description

I'm using playwright-mcp in both Claude Desktop and Claude Code environments.

It works perfectly in Claude Desktop, but when using Claude Code, the execution fails due to how it handles the Git Bash path that contains a space (Program Files).

Steps to Reproduce

  1. Install Git for Windows (default location: C:\Program Files\Git)
  2. Set up a project using playwright-mcp
  3. Run the task in Claude Desktop → ✅ Success
  4. Run the same task in Claude Code → ❌ Fails with path resolution error

Expected Behavior

Claude Code should correctly handle Windows paths with spaces, such as C:\Program Files\Git\bin\bash.exe.

Actual Behavior

Claude Code attempts to invoke Git Bash via a Unix-style path (/usr/bin/bash), which resolves to:


Files\Git\bin\bash.exe

This fails due to the unquoted or misparsed space in Program Files.

Error message:


"error": "Server stderr: /usr/bin/bash: Files\Git\bin\bash.exe: No such file or directory",

Stack trace:


McpError: MCP error -32000: Connection closed
at FV0.\_onclose (file:///C:/Users/xxxx/.../cli.js:1338:13174)
...

Additional Context

  • Git for Windows is installed at the default path: C:\Program Files\Git
  • bash.exe exists at: C:\Program Files\Git\bin\bash.exe
  • Claude Code seems to fail parsing or quoting paths that include spaces (i.e., Program Files)
  • This issue does not occur in Claude Desktop

Suggestion

Please ensure that paths containing spaces (e.g., "C:\Program Files\...") are correctly quoted or escaped when passed to subprocesses or shell contexts within Claude Code.

View original on GitHub ↗

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