Skip to content

[BUG]Claude Code VS Code Extension Fails to Detect Git Bash on Windows Despite Correct Configuration #8674

Description

@GoldKingai

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?

[BUG] Claude Code VS Code Extension Fails to Detect Git Bash on Windows Despite Correct Configuration

Environment

  • Platform: Anthropic API
  • Claude Code Extension Version: 2.0.2 (released 2025-10-01)
  • Operating System: Windows 11
  • VS Code Version: [Please fill in your version from Help → About]
  • Terminal: PowerShell 5.x with Python virtual environment
  • Git Version: 2.50.0.windows.2

Bug Description

The Claude Code VS Code extension consistently fails to detect Git Bash installation on Windows, displaying the error:

Error: 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

This occurs despite:

  1. Git Bash being properly installed and functional
  2. Correct environment variable configuration
  3. Bash executable being accessible and working
  4. Multiple troubleshooting attempts including path modifications

Steps to Reproduce

  1. Install Git for Windows with Git Bash
  2. Install Claude Code VS Code extension (version 2.0.2)
  3. Verify Git Bash works: & "C:\Program Files\Git\bin\bash.exe" --version
  4. Set environment variable: $env:CLAUDE_CODE_GIT_BASH_PATH = "C:\Program Files\Git\bin\bash.exe"
  5. Attempt to use Claude Code extension in VS Code
  6. Observe the git-bash error despite correct configuration

Expected Behavior

The extension should detect Git Bash either through:

  • Automatic detection from system PATH
  • Environment variable CLAUDE_CODE_GIT_BASH_PATH
  • VS Code terminal environment settings

Actual Behavior

Extension displays git-bash error and refuses to function, blocking all productivity workflows.

Troubleshooting Attempts Made

Environment Variable Configuration

  • Set both user and system environment variables
  • Tried both C:\Program Files\Git\bin\bash.exe and space-free symbolic link C:\GitBash\bin\bash.exe
  • Verified variables are visible in VS Code terminal sessions
  • Added to VS Code settings.json terminal.integrated.env.windows

PATH Configuration

  • Added C:\Program Files\Git\bin to system PATH
  • Added C:\Program Files\Git\cmd to system PATH
  • Verified git --version works (showing PATH is functional)
  • Created symbolic link without spaces: C:\GitBashC:\Program Files\Git

Extension Troubleshooting

  • Downgraded from version 2.0.2 to 2.0.1 (same error)
  • Completely uninstalled and reinstalled extension
  • Reloaded VS Code window multiple times
  • Restarted VS Code completely
  • Cleared VS Code settings and reconfigured

Terminal Configuration

  • Tested with PowerShell, Command Prompt, and Git Bash terminals
  • Changed VS Code default terminal profile
  • Verified bash works in all terminal types

Verification Commands That Work

All of these commands execute successfully, proving the installation is correct:

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

# Environment variable execution  
& $env:CLAUDE_CODE_GIT_BASH_PATH --version
# Output: GNU bash, version 5.2.37(1)-release (x86_64-pc-msys)

# Git command works
git --version
# Output: git version 2.50.0.windows.2

# Environment variable is set
echo $env:CLAUDE_CODE_GIT_BASH_PATH  
# Output: C:\Program Files\Git\bin\bash.exe

Related Issues

This appears related to known issues with Git Bash path detection:

Impact

This bug completely blocks the use of Claude Code VS Code extension, preventing:

  • Integrated AI-assisted coding workflows
  • Real-time code editing and suggestions
  • File management through the extension
  • All productivity features that require the extension

The CLI version works but lacks the integrated VS Code experience needed for effective development workflow.

System Configuration Details

# Working Git installation
PS> git --version
git version 2.50.0.windows.2

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

# Correct environment variable
PS> $env:CLAUDE_CODE_GIT_BASH_PATH
C:\Program Files\Git\bin\bash.exe

# PATH includes Git
PS> $env:PATH -split ';' | Where-Object { $_ -like "*Git*" }
C:\Program Files\Git\cmd

Request

This issue is blocking productive use of Claude Code for software development. Please prioritize fixing the VS Code extension's Git Bash detection mechanism on Windows, particularly:

  1. Proper handling of paths with spaces (Program Files)
  2. Reliable environment variable detection
  3. Fallback detection methods when automatic detection fails

Additional Information

Available for testing any proposed fixes or providing additional diagnostic information as needed.

What Should Happen?

Error: 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

Error Messages/Logs

Error: 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

Error: 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

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

2.0.2

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:idebugSomething isn't workinghas reproHas detailed reproduction stepsoncallplatform:windowsIssue specifically occurs on Windows

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions