Plugin bin/ PATH injection not extended to PowerShell tool subprocess (only Bash tool gets it)

Resolved 💬 1 comment Opened Jun 16, 2026 by DuaneNielsen Closed Jun 16, 2026

Summary

v2.1.91 added plugin/bin/ to the Bash tool subprocess's PATH, letting plugins ship executables invokable as bare commands. The PowerShell tool subprocess (a separate spawn path) never received the same injection, so bare plugin commands fail when the PowerShell tool is the active shell.

How the injection currently works

When Claude Code spawns the persistent Git Bash subprocess it appends the plugin bin/ directory in POSIX colon-separated format:

PATH=...;C:\Program Files\Git\mingw64\bin:/c/Users/<user>/.claude/plugins/cache/<plugin>/<ver>/bin

The PowerShell subprocess is spawned separately with a clean Windows-style PATH. The plugin bin/ append never happens for it.

This is documented — the plugins-reference table says explicitly:

Executables | bin/ | Executables added to the Bash tool's PATH. Files here are invokable as bare commands in any Bash tool call while the plugin is enabled.

The PowerShell tool is not mentioned anywhere in this context.

Reproduction

  1. Install a plugin that ships an executable in bin/ (e.g. claude-dx-done ships bin/dx-done)
  2. On Windows, either set CLAUDE_CODE_USE_POWERSHELL_TOOL=1 or remove Git Bash from PATH so the PowerShell tool is the active shell
  3. In a skill, run the bare command dx-done --version
  4. Expected: resolves from plugin bin/, prints version
  5. Actual: dx-done: command not found (PowerShell has no knowledge of plugin bin/)

The same bare command works fine in a Bash tool call (Git Bash present) because the Bash subprocess gets the POSIX-format append.

Why .cmd/.ps1 launchers don't save you

Plugins can ship dx-done.cmd and dx-done.ps1 alongside dx-done in bin/, and Windows PATHEXT would resolve them as bare dx-doneif bin/ were on PowerShell's PATH. But since the injection never happens for the PowerShell subprocess, PATHEXT never gets a chance to fire.

Proposed fix

When spawning the PowerShell tool subprocess, also prepend <plugin>/bin to PATH using Windows-style semicolon-separated format:

// pseudocode — mirrors the existing Bash spawn injection
const pluginBin = path.join(pluginRoot, 'bin');
const env = {
  ...process.env,
  PATH: pluginBin + ';' + process.env.PATH,
};
spawn('pwsh.exe', args, { env });

With this change, dx-done.cmd in bin/ resolves as bare dx-done via PATHEXT (.CMD is in PATHEXT by default on Windows), matching the Bash tool behavior.

Related

  • #65883 — reveals the exact POSIX-format PATH append mechanism used for the Bash subprocess respawn
  • #68396 — related: uv_spawn can't execute .cmd wrappers (MCP/LSP spawn path, separate issue)
  • #62537 — PowerShell tool absent from schema when Git Bash present (detection issue, separate)
  • Docs: plugins-reference § File locations — explicitly scopes bin/ to Bash tool only

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗