[BUG] Windows: marketplace refresh fails with 'git is not recognized' when VSCode default terminal is Git Bash

Resolved 💬 2 comments Opened Mar 18, 2026 by cbini Closed Apr 15, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report
  • [x] I am using the latest version of Claude Code

What's Wrong?

On Windows, Claude Code fails to refresh marketplaces at startup with a \"git is not recognized\" error — even when git is correctly installed, present in both system and user PATH, and works fine in a fresh cmd.exe window.

The failure occurs specifically because VSCode resolves the extension host shell environment by running the default terminal profile. When that profile is Git Bash, the resulting PATH is in Unix/POSIX format (colon-delimited, e.g. /mingw64/bin:/usr/bin:/cmd:...). The Claude CLI inherits this as process.env.PATH. When the CLI shells out to git via cmd.exe for marketplace refresh, cmd.exe cannot parse Unix-format PATH entries and reports the error.

What Should Happen?

Marketplace refresh should succeed. Claude Code should find git regardless of whether the extension host inherited a Windows-format or Unix-format PATH.

Error Messages/Logs

Claude CLI exited with code 1: × Failed to update marketplace(s): Failed to refresh marketplace 'claude-plugins-official': Failed to clone marketplace repository: 'git' is not recognized as an internal or external command, operable program or batch file.

Steps to Reproduce

  1. Install Git for Windows (git is present in PATH and works in cmd.exe)
  2. In VSCode user settings.json, set "terminal.integrated.defaultProfile.windows": "Git Bash"
  3. Restart VSCode fully
  4. Observe Claude Code startup error: 'git' is not recognized as an internal or external command

Note: Adding git to system/user PATH in the Windows registry does NOT fix it — VSCode overwrites process.env.PATH with the Git Bash Unix-format version during shell environment resolution. Full Windows restarts also do not fix it.

Workaround: Change the VSCode default terminal to PowerShell:

"terminal.integrated.defaultProfile.windows": "PowerShell"

This causes VSCode to resolve shell environment from PowerShell, which preserves the Windows-format semicolon-delimited PATH.

Claude Model

Not applicable (startup issue, not model-related)

Is this a regression?

I don't know

Claude Code Version

2.1.78 (VSCode extension)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

VS Code integrated terminal (Git Bash profile)

Additional Information

Root cause: The extension spawns the Claude CLI with env: {...process.env, ...j.env} (from runClaudeCommandRaw in extension.js). When VSCode's shell environment resolution runs Git Bash, Git Bash outputs PATH in POSIX format. This propagates to the CLI's process.env.PATH. When the CLI internally runs git clone for marketplace refresh, it passes this POSIX-format PATH to a cmd.exe subprocess, which cannot find git because it only understands semicolon-delimited Windows-format PATH entries.

Suggested fix: Before spawning git subprocesses on Windows, normalize process.env.PATH by detecting POSIX-format entries and either converting them to Windows format or falling back to the Windows registry PATH via [HKCU\Environment] + [HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment].

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗