[BUG] Windows: "unable to find CLAUDE_CODE_GIT_BASH_PATH" despite Git Bash being installed and accessible
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?
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"→ oknode -e "console.log(require('fs').existsSync('C:\\Program Files\\Git\\bin\\bash.exe'))"→ trueicaclsconfirms full read/execute permissions for all usersC:\Program Files\Git\binis in PATH,where.exe bashfinds itCLAUDE_CODE_GIT_BASH_PATHenv 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\binto 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
- Have a Windows PC with a previous user account that had Claude Code installed
- Create a new Windows user account on the same machine
- Install Git fresh on the new account (confirmed at C:\Program Files\Git\)
- Install Claude Code via
npm install -g @anthropic-ai/claude-code - Run
claudein PowerShell - Error: "Claude Code was unable to find CLAUDE_CODE_GIT_BASH_PATH path C:\Program Files\Git\bin\bash.exe"
- Set env var:
CLAUDE_CODE_GIT_BASH_PATH=C:\Program Files\Git\bin\bash.exe - Run
claudeagain — same error - 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..."
- 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_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗