Skip to content

plugin install fails on Windows when git is installed under user home directory (false "git not on PATH" error) #50320

Description

@Keson74

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • 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

  1. 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
  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.

Claude Model

None

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

  1. 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 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:pluginsbugSomething isn't workinghas reproHas detailed reproduction stepsplatform:windowsIssue specifically occurs on WindowsstaleIssue is inactive

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions