anthropics / anthropics/claude-quickstarts
Claude Code for VS Code fails to read CLAUDE_CODE_GIT_BASH_PATH on Windows"
- 主要言語
- TypeScript
- スター
- 17.6k
- フォーク
- 3k
- 平均マージ
- 5時間 13分
- マージ済み PR(30日)
- 3
説明
## Bug Description
The Claude Code extension for VS Code fails to launch on Windows with the error "Claude Code on Windows requires git-bash", even though Git Bash is correctly installed, in PATH, and the CLAUDE_CODE_GIT_BASH_PATH environment variable is properly configured.
## Environment
- **OS**: Windows 11 (25H2) compilation SO 26200.8037
- **VS Code Version**: 1.114.0
- **Claude Code Extension Version**: (check in VS Code extensions panel) Version 2.1.96
- **Git Version**: 2.53.0.windows.2
## Steps to Reproduce
1. Install Git for Windows with Git Bash
2. Set environment variable: CLAUDE_CODE_GIT_BASH_PATH=C:\Program Files\Git\bin\bash.exe (both Machine and User level)
3. Add Git Bash to system PATH
4. Install Claude Code extension in VS Code
5. Attempt to launch Claude Code
## Evidence That Configuration is Correct
### `where bash` output:
C:\Program Files\Git\bin\bash.exe
### Environment variable (Machine level):
[Environment]::GetEnvironmentVariable("CLAUDE_CODE_GIT_BASH_PATH", "Machine")
C:\Program Files\Git\bin\bash.exe
### Environment variable (User level):
[Environment]::GetEnvironmentVariable("CLAUDE_CODE_GIT_BASH_PATH", "User")
C:\Program Files\Git\bin\bash.exe
### Git Bash works correctly in VS Code terminal:
$ echo $BASH_VERSION
5.2.37(1)-release
## Extension Logs
2026-04-08 01:26:46.077 [info] AuthManager initialized
2026-04-08 01:26:46.077 [info] Claude code extension is now active?
2026-04-08 01:26:46.077 [info] MCP Server running on port 27394 (localhost only)
2026-04-08 01:26:50.865 [info] Getting authentication status
2026-04-08 01:26:50.865 [info] OAuth tokens found in secure storage
2026-04-08 01:26:50.865 [info] AuthManager initialized
2026-04-08 01:26:51.337 [info] Received message from webview: {"type":"request","requestId":"bosq32hxpvc","request":{"type":"init"}}
2026-04-08 01:26:51.346 [info] Getting authentication status
2026-04-08 01:26:51.346 [info] OAuth tokens found in secure storage
2026-04-08 01:26:51.396 [info] Getting authentication status
2026-04-08 01:26:51.396 [info] OAuth tokens found in secure storage
2026-04-08 01:26:51.398 [info] Received message from webview: {"type":"request","requestId":"czckf41cut","request":{"type":"get_claude_state"}}
2026-04-08 01:26:51.399 [info] Received message from webview: {"type":"request","requestId":"9clk2qz6w8d","request":{"type":"get_current_selection"}}
2026-04-08 01:26:51.400 [info] Received message from webview: {"type":"request","requestId":"earejcphzsd","request":{"type":"get_asset_uris"}}
2026-04-08 01:26:51.401 [info] Received message from webview: {"type":"request","requestId":"rwackl4f09","request":{"type":"list_sessions_request"}}
2026-04-08 01:26:51.427 [info] Received message from webview: {"type":"launch_claude","channelId":"xbhcbex4fj","cwd":"c:\\Users\\winutil10\\Documents\\NEGO EMPRE","permissionMode":"default","thinkingLevel":"default_on"}
2026-04-08 01:26:51.492 [info] Launching Claude on channel: xbhcbex4fj
2026-04-08 01:26:51.492 [info] Closing Claude on channel: xbhcbex4fj
2026-04-08 01:26:51.492 [error] Error spawning Claude (on channel xbhcbex4fj): 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
2026-04-08 01:26:51.492 [error] Failed to load config cache: 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
2026-04-08 01:26:51.492 [error] Error processing client request: 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
2026-04-08 01:26:51.496 [info] Received message from webview: {"type":"interrupt_claude","channelId":"czckf41cut"}
2026-04-08 01:26:51.496 [warning] Channel not found: czckf41cut
2026-04-08 01:26:57.221 [info] Received message from webview: {"type":"request","requestId":"k9pzq1geu4b","request":{"type":"open_output_panel"}}
## Expected Behavior
The extension should detect Git Bash from either:
1. The system PATH (where it exists), or
2. The CLAUDE_CODE_GIT_BASH_PATH environment variable (which is correctly set)
## Actual Behavior
The extension fails to detect Git Bash and throws an error asking to set the same environment variable that is already configured.
## Additional Notes
- The extension worked on another Windows PC with identical Git Bash installation
- Git Bash terminal works perfectly within VS Code itself
- The issue appears to be with how the extension reads environment variables on Windows
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
評価
この issue はまだ評価されていません。