Skip to content

Windows: CLAUDE_CODE_GIT_BASH_PATH not recognized even when file exists #10152

Description

Description

Claude Code native installation fails to recognize the CLAUDE_CODE_GIT_BASH_PATH environment variable on Windows, even though the bash.exe file exists at the specified path and the environment variable is correctly set.

Environment

  • OS: Windows 11 24H2 (64-bit)
  • Language: Japanese (ja-JP)
  • Git Bash version: GNU bash, version 5.2.37(1)-release (x86_64-pc-msys)
  • Bash location: C:\Program Files\Git\bin\bash.exe

Steps to Reproduce

  1. Install Git for Windows from https://git-scm.com/downloads/win
  2. Set environment variable: CLAUDE_CODE_GIT_BASH_PATH=C:\Program Files\Git\bin\bash.exe
  3. Close all terminals and open a new one (tried CMD, PowerShell, and Administrator PowerShell)
  4. Attempt to install Claude Code

Attempted Solutions

All of the following approaches failed with the same error:

  • C:\Program Files\Git\bin\bash.exe (with spaces)
  • C:\PROGRA~1\Git\bin\bash.exe (8.3 short path format)
  • C:\Program Files\Git\usr\bin\bash.exe (alternative location)
  • ✗ Set as User environment variable
  • ✗ Attempted to set as System environment variable (with admin rights)
  • ✗ Tested in CMD, PowerShell, and Administrator PowerShell
  • ✗ PC restart

Verification

The bash.exe file exists and is executable:

PS> Test-Path "C:\Program Files\Git\bin\bash.exe"
True

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

PS> [System.Environment]::GetEnvironmentVariable('CLAUDE_CODE_GIT_BASH_PATH', 'User')
C:\Program Files\Git\bin\bash.exe

Error Message

Claude Code was unable to find CLAUDE_CODE_GIT_BASH_PATH path "C:\Program Files\Git\bin\bash.exe"

Expected Behavior

Claude Code should recognize the CLAUDE_CODE_GIT_BASH_PATH environment variable when it points to a valid bash.exe file.

Additional Context

  • The environment variable is visible in PowerShell after terminal restart
  • The file exists and is executable from PowerShell
  • Multiple path formats have been tested without success
  • This appears to be specific to how Claude Code validates or reads the environment variable on Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions