[BUG] VS Code extension ignores CLAUDE_CODE_GIT_BASH_PATH environment variable on Windows

Status Fixed / completed
Reported on v2.1.50
Maintainer reply ✓ Yes — ashwin-ant
Activity 8 comments · opened Feb 23, 2026 · closed Apr 18, 2026
💡 Likely answer: A maintainer (ashwin-ant, collaborator) responded on this thread — see the highlighted reply below.

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?

The VS Code extension (v2.1.49) fails to launch Claude on Windows even when
CLAUDE_CODE_GIT_BASH_PATH is correctly set. Error message:

"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"

Git Bash is installed and the variable has been set via:

  • Windows System environment variables
  • VS Code settings.json via terminal.integrated.env.windows
  • VS Code settings.json via claudeCode.environmentVariables

Running "claude" directly in the VS Code integrated terminal works fine.

What Should Happen?

The extension should recognize CLAUDE_CODE_GIT_BASH_PATH and launch Claude successfully.

Error Messages/Logs

Failed to load config cache: Error: Claude Code on Windows requires git-bash
Error spawning Claude: Error: Claude Code on Windows requires git-bash

Steps to Reproduce

  1. Install Git Bash on Windows (C:\Program Files\Git\bin\bash.exe)
  2. Set CLAUDE_CODE_GIT_BASH_PATH as a Windows System environment variable
  3. Open VS Code and open the Claude Code panel
  4. Extension immediately shows the git-bash error despite variable being set correctly

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.50 (Claude Code)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

_No response_

View original on GitHub ↗

8 Comments

github-actions[bot] · 6 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/8674
  2. https://github.com/anthropics/claude-code/issues/25593
  3. https://github.com/anthropics/claude-code/issues/18936

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

sstklen · 6 months ago

Hey! I ran into a similar pattern in our bug knowledge base and thought this might help.

What's happening: VS Code extension's SD6() function calls spawnSync('where.exe', ['git'], {stdio:'pipe', encoding:'utf8'}) WITHOUT shell:true. On Windows, Node.js spawnSync without shell:true cannot resolve executables via PATH, so where.exe fails to find git even when PATH is correct. The CLAUDE_CODE_GIT_BASH_PATH env var is either never checked before this gate, or the env var reading also fails because the extension process doesn't inherit user/system env vars properly in VS Code's extension host.

What worked for us:

Three options (any one works): (1) Add shell:true to the spawnSync call so Windows PATH resolution works. (2) Use absolute path C:\\Windows\\System32\\where.exe instead of bare where.exe. (3) Best fix: remove the redundant SD6() git check entirely — the CLI already handles bash/git detection correctly. As a user workaround right now: patch extension.js by adding 'return;' at the start of SD6(), or add C:\\Windows\\System32 explicitly to your system PATH.

// In extension.js SD6() function, change:
spawnSync("where.exe", ["git"], { stdio: "pipe", encoding: "utf8" })
// To:
spawnSync("where.exe", ["git"], { stdio: "pipe", encoding: "utf8", shell: true })

// OR better — also check CLAUDE_CODE_GIT_BASH_PATH before the where.exe gate:
function SD6() {
  if (process.platform !== "win32") return;
  // Skip check if user explicitly set the path
  if (process.env.CLAUDE_CODE_GIT_BASH_PATH) return;
  // Use shell:true so PATH resolution works
  const result = spawnSync("where.exe", ["git"], { stdio: "pipe", encoding: "utf8", shell: true });
  // ... rest of detection logic
}

Hope this helps! Let me know if it doesn't match your case — happy to dig deeper. 🦞

_Disclosure: This analysis is from Confucius Debug, an AI-powered community KB for agent bugs. Please verify before applying._

---
<sub>🦞 Confucius Debug — community knowledge base for AI agent bugs. Free to search via MCP.</sub>

tsc-lc · 5 months ago

Confirming this is still occurring on 2.1.70 VSCode extension

berkum · 5 months ago

Same issue here with 2.1.71. Can't use claude in VS.

mwibbenmeyer · 5 months ago

Still having this issue with 2.1.74

fastthief · 5 months ago

Had same issue, had to add the "PATH" system variable locations for me.
https://github.com/anthropics/claude-code/issues/8674

ashwin-ant collaborator · 4 months ago

This was fixed in v2.1.98 — The VS Code extension on Windows now respects CLAUDE_CODE_GIT_BASH_PATH and checks default Git install locations before reporting Git Bash as missing. If you're still seeing this in the latest version, please comment with your version and repro and we'll reopen.

github-actions[bot] · 4 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.