[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
Workaround ✓ Mentioned in thread ↓
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
- Install Git Bash on Windows (C:\Program Files\Git\bin\bash.exe)
- Set CLAUDE_CODE_GIT_BASH_PATH as a Windows System environment variable
- Open VS Code and open the Claude Code panel
- 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_
8 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
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.
Hope this helps! Let me know if it doesn't match your case — happy to dig deeper. 🦞
---
<sub>🦞 Confucius Debug — community knowledge base for AI agent bugs. Free to search via MCP.</sub>
Confirming this is still occurring on 2.1.70 VSCode extension
Same issue here with 2.1.71. Can't use claude in VS.
Still having this issue with 2.1.74
Had same issue, had to add the "PATH" system variable locations for me.
https://github.com/anthropics/claude-code/issues/8674
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.
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.