claude-code - 💡(How to fix) Fix [BUG] Windows: "unable to find CLAUDE_CODE_GIT_BASH_PATH" despite Git Bash being installed and accessible [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#47923Fetched 2026-04-15 06:38:30
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Author
Timeline (top)
labeled ×3commented ×1

Error Message

Error Messages/Logs

  1. Error: "Claude Code was unable to find CLAUDE_CODE_GIT_BASH_PATH path C:\Program Files\Git\bin\bash.exe"
  2. Run claude again — same error
  3. Uninstall, clean cache, delete ~/.claude, reinstall — error changes to:
  4. Set env var again — back to original error from step 6
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?

After losing access to my previous Windows user account ("pearc"), I created a new account ("Sardinha") on the same PC. Git is freshly installed and fully functional, but Claude Code refuses to start, showing:

Claude Code on Windows requires git-bash. 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

Everything checks out on my system:

  • Test-Path "C:\Program Files\Git\bin\bash.exe" → True
  • & "C:\Program Files\Git\bin\bash.exe" -c "echo ok" → ok
  • node -e "console.log(require('fs').existsSync('C:\\Program Files\\Git\\bin\\bash.exe'))" → true
  • icacls confirms full read/execute permissions for all users
  • C:\Program Files\Git\bin is in PATH, where.exe bash finds it
  • CLAUDE_CODE_GIT_BASH_PATH env var set at both User and Machine level

What I've tried (none worked):

  • Setting CLAUDE_CODE_GIT_BASH_PATH to the bash.exe path (User + Machine level)
  • Setting it to the directory (C:\Program Files\Git\bin)
  • Setting it inline in the session ($env:CLAUDE_CODE_GIT_BASH_PATH = ...)
  • Adding C:\Program Files\Git\bin to PATH permanently
  • Full uninstall (npm uninstall -g) + cache clean + removing ~/.claude + reinstall
  • Deleting .claude.json (which had repo paths referencing old user "pearc")

Environment:

  • Windows 11 (new local user account)
  • Git 2.47.1.1
  • Node.js (via npm global install)
  • Claude Code: latest from npm
  • PowerShell 5.x

What Should Happen?

Claude Code should detect the Git Bash installation at C:\Program Files\Git\bin\bash.exe and start normally, either automatically or when CLAUDE_CODE_GIT_BASH_PATH is set.

Error Messages/Logs

Steps to Reproduce

  1. Have a Windows PC with a previous user account that had Claude Code installed
  2. Create a new Windows user account on the same machine
  3. Install Git fresh on the new account (confirmed at C:\Program Files\Git)
  4. Install Claude Code via npm install -g @anthropic-ai/claude-code
  5. Run claude in PowerShell
  6. Error: "Claude Code was unable to find CLAUDE_CODE_GIT_BASH_PATH path C:\Program Files\Git\bin\bash.exe"
  7. Set env var: CLAUDE_CODE_GIT_BASH_PATH=C:\Program Files\Git\bin\bash.exe
  8. Run claude again — same error
  9. Uninstall, clean cache, delete ~/.claude, reinstall — error changes to: "Claude Code on Windows requires git-bash. If installed but not in PATH, set environment variable..."
  10. Set env var again — back to original error from step 6

Claude Model

None

Is this a regression?

No, this never worked

Last Working Version

No response

Claude Code Version

2.1.107 (Claude Code)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

No response

extent analysis

TL;DR

The issue might be resolved by ensuring the CLAUDE_CODE_GIT_BASH_PATH environment variable is correctly set and accessible to the Claude Code application, potentially requiring a reboot or logging off and on after setting the variable.

Guidance

  • Verify that the CLAUDE_CODE_GIT_BASH_PATH environment variable is set at the system level and that the path is correctly pointing to C:\Program Files\Git\bin\bash.exe.
  • Try setting the CLAUDE_CODE_GIT_BASH_PATH variable through the System Properties -> Environment Variables dialog, ensuring it's set for the system, not just the user.
  • After setting the environment variable, log off and then log back on to ensure the change is applied to all processes, including those started from PowerShell.
  • If the issue persists, consider checking for any permissions issues related to the bash.exe file or its directory, despite icacls confirming full read/execute permissions.

Example

No specific code example is applicable in this scenario, as the issue appears to be related to environment variable settings and system configuration rather than code.

Notes

The problem seems to stem from the application's inability to detect the Git Bash installation despite the environment variable being set. This could be due to how the variable is being set or how the application is accessing it. Ensuring the variable is set at the correct level (system vs. user) and that the system is fully updated with the new variable (through a reboot or log off/on) might resolve the issue.

Recommendation

Apply the workaround by setting the CLAUDE_CODE_GIT_BASH_PATH environment variable through the System Properties and then log off and on to ensure the change takes effect, as this directly addresses the error message and the application's requirement for the Git Bash path.

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