plugin install fails on Windows when git is installed under user home directory (false "git not on PATH" error)
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?
/plugin install throws git-subdir plugin source requires git to be
installed and on PATH even when git is correctly installed and visible
via where.exe git, Get-Command git, and PowerShell.
What Should Happen?
Root Cause
In claude.exe (v2.1.114), the which('git') implementation (function
ox7) runs where.exe git to locate git, then passes results through a
filter (KD6) that removes any path located under the current working
directory:
function KD6(H) {
let $ = process.cwd().toLowerCase();
return H.filter((q) => {
let K = path.resolve(q).toLowerCase();
return path.dirname(K).toLowerCase() !== $ && !K.startsWith($ +
path.sep)
})
}
When the user's working directory is their home folder
(C:\Users\<name>) and git is installed at the default user-local
location (C:\Users\<name>\AppData\Local\Programs\Git), all paths
returned by where.exe git are under the home directory and get
filtered out, making git appear not found.
Error Messages/Logs
Steps to Reproduce
- Install Git for Windows using the per-user installer (default on
many machines) → installs to
C:\Users\<name>\AppData\Local\Programs\Git
- Launch Claude Code CLI from or with cwd set to C:\Users\<name> (the
home directory)
- Run /plugin install <any-git-subdir-plugin>
- Error: git-subdir plugin source requires git to be installed and on
PATH
Note: where.exe git, Get-Command git, and git --version all succeed —
git is genuinely on PATH.
Claude Model
None
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
- Install Git for Windows using the per-user installer (default on many machines) → installs to C:\Users\<name>\AppData\Local\Programs\Git 2. Launch Claude Code CLI from or with cwd set to C:\Users\<name> (the home directory) 3. Run /plugin install <any-git-subdir-plugin> 4. Error: git-subdir plugin source requires git to be installed and on PATH Note: where.exe git, Get-Command git, and git --version all succeed — git is genuinely on PATH.
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗