claude-code - 💡(How to fix) Fix [BUG] Claude Code constructs invalid bash.exe path on Windows: usr\bin\..\usr\bin\bash.exe [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#54246Fetched 2026-04-29 06:32:26
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Timeline (top)
labeled ×3commented ×1

Error Message

Error Messages/Logs

Fix Action

Workaround

Running deploy.ps1 manually in PowerShell works correctly. Setting CLAUDE_CODE_GIT_BASH_PATH environment variable does NOT fix the issue. The settings.json env variable is also ignored.

Code Example

## Environment
- OS: Windows 10/11
- Git version: 2.54.0.windows.1
- Claude Code version: 2.1.89
- bash.exe locations:
  C:\Program Files\Git\bin\bash.exe
  C:\Program Files\Git\usr\bin\bash.exe

## Problem
Claude Code constructs an invalid bash path:
C:\Program Files\Git\usr\bin\..\usr\bin\bash.exe

This path does not exist and causes all Bash tool calls to fail.

## Expected
Claude Code should use:
C:\Program Files\Git\usr\bin\bash.exe
OR
C:\Program Files\Git\bin\bash.exe

## Workaround
Running deploy.ps1 manually in PowerShell works correctly.
Setting CLAUDE_CODE_GIT_BASH_PATH environment variable does NOT fix the issue.
The settings.json env variable is also ignored.

## Impact
All Bash tool commands fail. Claude Code cannot automate deployments on Windows.
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Environment

  • OS: Windows 10/11
  • Git version: 2.54.0.windows.1
  • Claude Code version: 2.1.89
  • bash.exe locations: C:\Program Files\Git\bin\bash.exe C:\Program Files\Git\usr\bin\bash.exe

Problem

Claude Code constructs an invalid bash path: C:\Program Files\Git\usr\bin..\usr\bin\bash.exe

This path does not exist and causes all Bash tool calls to fail.

Expected

Claude Code should use: C:\Program Files\Git\usr\bin\bash.exe OR C:\Program Files\Git\bin\bash.exe

Workaround

Running deploy.ps1 manually in PowerShell works correctly. Setting CLAUDE_CODE_GIT_BASH_PATH environment variable does NOT fix the issue. The settings.json env variable is also ignored.

Impact

All Bash tool commands fail. Claude Code cannot automate deployments on Windows.

What Should Happen?

Environment

  • OS: Windows 10/11
  • Git version: 2.54.0.windows.1
  • Claude Code version: 2.1.89
  • bash.exe locations: C:\Program Files\Git\bin\bash.exe C:\Program Files\Git\usr\bin\bash.exe

Problem

Claude Code constructs an invalid bash path: C:\Program Files\Git\usr\bin..\usr\bin\bash.exe

This path does not exist and causes all Bash tool calls to fail.

Expected

Claude Code should use: C:\Program Files\Git\usr\bin\bash.exe OR C:\Program Files\Git\bin\bash.exe

Workaround

Running deploy.ps1 manually in PowerShell works correctly. Setting CLAUDE_CODE_GIT_BASH_PATH environment variable does NOT fix the issue. The settings.json env variable is also ignored.

Impact

All Bash tool commands fail. Claude Code cannot automate deployments on Windows.

Error Messages/Logs

## Environment
- OS: Windows 10/11
- Git version: 2.54.0.windows.1
- Claude Code version: 2.1.89
- bash.exe locations:
  C:\Program Files\Git\bin\bash.exe
  C:\Program Files\Git\usr\bin\bash.exe

## Problem
Claude Code constructs an invalid bash path:
C:\Program Files\Git\usr\bin\..\usr\bin\bash.exe

This path does not exist and causes all Bash tool calls to fail.

## Expected
Claude Code should use:
C:\Program Files\Git\usr\bin\bash.exe
OR
C:\Program Files\Git\bin\bash.exe

## Workaround
Running deploy.ps1 manually in PowerShell works correctly.
Setting CLAUDE_CODE_GIT_BASH_PATH environment variable does NOT fix the issue.
The settings.json env variable is also ignored.

## Impact
All Bash tool commands fail. Claude Code cannot automate deployments on Windows.

Steps to Reproduce

Environment

  • OS: Windows 10/11
  • Git version: 2.54.0.windows.1
  • Claude Code version: 2.1.89
  • bash.exe locations: C:\Program Files\Git\bin\bash.exe C:\Program Files\Git\usr\bin\bash.exe

Problem

Claude Code constructs an invalid bash path: C:\Program Files\Git\usr\bin..\usr\bin\bash.exe

This path does not exist and causes all Bash tool calls to fail.

Expected

Claude Code should use: C:\Program Files\Git\usr\bin\bash.exe OR C:\Program Files\Git\bin\bash.exe

Workaround

Running deploy.ps1 manually in PowerShell works correctly. Setting CLAUDE_CODE_GIT_BASH_PATH environment variable does NOT fix the issue. The settings.json env variable is also ignored.

Impact

All Bash tool commands fail. Claude Code cannot automate deployments on Windows.

Claude Model

Sonnet (default)

Is this a regression?

Yes, this worked in a previous version

Last Working Version

  • Model: Claude Sonnet 4.6 - Model ID: claude-sonnet-4-6 - Platform: Claude Code CLI (desktop app, Windows 10 Pro 10.0.19045)

Claude Code Version

  • Model: Claude Sonnet 4.6 - Model ID: claude-sonnet-4-6 - Platform: Claude Code CLI (desktop app, Windows 10 Pro 10.0.19045)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

  • Model: Claude Sonnet 4.6
  • Model ID: claude-sonnet-4-6
  • Platform: Claude Code CLI (desktop app, Windows 10 Pro 10.0.19045)

extent analysis

TL;DR

The issue can be fixed by modifying the code to correctly construct the bash path, using either C:\Program Files\Git\usr\bin\bash.exe or C:\Program Files\Git\bin\bash.exe.

Guidance

  • Verify that the bash.exe locations are correctly configured in the system environment variables.
  • Check the Claude Code configuration files to ensure that the bash path is not being overridden.
  • Consider modifying the Claude Code code to handle the bash path construction more robustly, such as by using the Path.Combine method to join the directory paths.
  • Test the fix by running the deploy script and verifying that the bash tool calls are successful.

Example

No code example is provided as the issue does not specify the exact code that is constructing the invalid bash path.

Notes

The issue is specific to Windows 10/11 and Claude Code version 2.1.89. The fact that running deploy.ps1 manually in PowerShell works correctly suggests that the issue is related to how Claude Code is constructing the bash path.

Recommendation

Apply a workaround by modifying the Claude Code configuration to use the correct bash path, or wait for a fix in a future version of Claude Code.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING