[BUG] Git Bash detection regression in versions after 2.1.69 (and native binary) and latest

Resolved 💬 3 comments Opened Apr 4, 2026 by johnjeffs-lzywlth Closed May 26, 2026

Preflight Checklist

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

What's Wrong?

What's Wrong?
Git Bash detection is broken on Windows for versions after v2.1.69. This is NOT a duplicate of #8674, #10152, #13184, or #31060 — those report the symptom but attribute it to PATH/config issues. This report provides version bisection data proving it is a code regression:

v2.1.69 (npm): ✅ works
v2.1.78 (npm): ❌ fails — same machine, same config
v2.1.84 (native binary): ❌ fails
v2.1.87 (npm): ❌ fails

claude --version succeeds on all versions, but claude (full launch) fails on v2.1.78+ with:
Claude Code was unable to find CLAUDE_CODE_GIT_BASH_PATH path "C:\Git\bin\bash.exe"
The path exists, bash runs, where.exe bash finds it — the CLI's internal validation rejects it anyway.
I exhaustively tried every fix suggested in #8674 (20+ attempts including PATH fixes, env vars at User/Machine level, settings.json, reinstalling Git to a path without spaces, etc.). Full list in Steps to Reproduce below.

What Should Happen?

What Should Happen?
Claude Code should detect and use bash.exe when it exists at the configured CLAUDE_CODE_GIT_BASH_PATH path, or auto-detect it via where.exe bash when the env var is not set. This works correctly on v2.1.69 and earlier.

Error Messages/Logs

Error Messages/Logs
PS> Test-Path "C:\Git\bin\bash.exe"
True

PS> & "C:\Git\bin\bash.exe" --version
GNU bash, version 5.2.37(1)-release (x86_64-pc-msys)

PS> where.exe bash
C:\Git\bin\bash.exe

PS> claude --version
2.1.84 (Claude Code)

PS> claude
Claude Code was unable to find CLAUDE_CODE_GIT_BASH_PATH path "C:\Git\bin\bash.exe"
Without the env var set:
PS> claude
Claude Code on Windows requires git-bash (https://git-scm.com/downloads/win). If installed but not in PATH, set environment variable pointing to your bash.exe, similar to: CLAUDE_CODE_GIT_BASH_PATH=C:\Program Files\Git\bin\bash.exe

Steps to Reproduce

<html>
<body>
<!--StartFragment--><h2 class="text-text-100 mt-3 -mb-1 text-[1.125rem] font-bold">Steps to Reproduce</h2>
<ol class="[li_&amp;]:mb-0 [li_&amp;]:mt-1 [li_&amp;]:gap-1 [&amp;:not(:last-child)_ul]:pb-1 [&amp;:not(:last-child)_ol]:pb-1 list-decimal flex flex-col gap-1 pl-8 mb-3">
<li class="whitespace-normal break-words pl-2">Install Git for Windows (tested at both <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">C:\Program Files\Git</code> and <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">C:\Git</code>)</li>
<li class="whitespace-normal break-words pl-2">Install Claude Code via any method:
<ul class="[li_&amp;]:mb-0 [li_&amp;]:mt-1 [li_&amp;]:gap-1 [&amp;:not(:last-child)_ul]:pb-1 [&amp;:not(:last-child)_ol]:pb-1 list-disc flex flex-col gap-1 pl-8 mb-3">
<li class="whitespace-normal break-words pl-2"><code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">irm https://claude.ai/install.ps1 | iex</code> (reported success but never created claude.exe — had to manually download binary from GCS bucket)</li>
<li class="whitespace-normal break-words pl-2"><code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">winget install Anthropic.ClaudeCode</code> (same Git Bash detection failure)</li>
<li class="whitespace-normal break-words pl-2"><code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">npm install -g @anthropic-ai/claude-code</code> (fails on v2.1.78+)</li>
</ul>
</li>
<li class="whitespace-normal break-words pl-2">Set <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">CLAUDE_CODE_GIT_BASH_PATH=C:\Git\bin\bash.exe</code></li>
<li class="whitespace-normal break-words pl-2">Run <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">claude</code></li>
<li class="whitespace-normal break-words pl-2">Observe error despite bash.exe existing and being executable</li>
</ol>
<p class="font-claude-response-body break-words whitespace-normal leading-[1.7]"><strong>Version bisection results (npm install):</strong></p>
<div class="overflow-x-auto w-full px-2 mb-6">
Version | Result
-- | --
1.0.126 | ✅ Works
2.0.25 | ✅ Works
2.0.30 | ✅ Works
2.1.47 | ✅ Works
2.1.58 | ✅ Works
2.1.69 | ✅ Works
2.1.78 | ❌ Fails
2.1.80 | ❌ Fails
2.1.84 | ❌ Fails
2.1.87 | ❌ Fails

</div>
<p class="font-claude-response-body break-words whitespace-normal leading-[1.7]"><strong>All of the following were attempted on failing versions (none helped):</strong></p>
<ul class="[li_&amp;]:mb-0 [li_&amp;]:mt-1 [li_&amp;]:gap-1 [&amp;:not(:last-child)_ul]:pb-1 [&amp;:not(:last-child)_ol]:pb-1 list-disc flex flex-col gap-1 pl-8 mb-3">
<li class="whitespace-normal break-words pl-2">Set <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">CLAUDE_CODE_GIT_BASH_PATH</code> in <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">~\.claude\settings.json</code> (with full path, with 8.3 short path)</li>
<li class="whitespace-normal break-words pl-2">Set as PowerShell session variable (<code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">claude --version</code> works, <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">claude</code> fails)</li>
<li class="whitespace-normal break-words pl-2">Set as User environment variable</li>
<li class="whitespace-normal break-words pl-2">Set as Machine/System environment variable (admin PowerShell)</li>
<li class="whitespace-normal break-words pl-2">Removed env var entirely, relying on auto-detection</li>
<li class="whitespace-normal break-words pl-2">Added <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">C:\Windows\System32</code> to User PATH</li>
<li class="whitespace-normal break-words pl-2">Added Git\bin and Git\cmd to System PATH</li>
<li class="whitespace-normal break-words pl-2">Verified <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">where.exe bash</code> returns correct path</li>
<li class="whitespace-normal break-words pl-2">Verified PATHEXT contains <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">.EXE</code></li>
<li class="whitespace-normal break-words pl-2">Checked for recursive <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">%PATH%</code> in System PATH (not present)</li>
<li class="whitespace-normal break-words pl-2">Full PC restart after each change</li>
<li class="whitespace-normal break-words pl-2">Uninstalled Git, reinstalled to <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">C:\Git</code> (no spaces in path)</li>
<li class="whitespace-normal break-words pl-2">Updated all PATH entries to <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">C:\Git\bin</code> and <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">C:\Git\cmd</code></li>
<li class="whitespace-normal break-words pl-2">Launched from PowerShell, Git Bash terminal</li></ul><!--EndFragment-->
</body>
</html>

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.1.69

Claude Code Version

2.1.84 (native) / 2.1.87 (npm) — both fail. Tested range: 1.0.126 through 2.1.87.

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

Additional Information
Current workaround: npm install -g @anthropic-ai/claude-code@2.1.47 — the newest version confirmed working on this system.
The regression is between v2.1.69 and v2.1.78. Narrowing further (v2.1.70–v2.1.77) would identify the offending commit.
Related issues: #10152, #8674, #13184, #31060, #25593, #14902, #14942

View original on GitHub ↗

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