Skip to content

fix(cli): detect npm-global Claude .cmd shims under Program Files on Windows - #12565

Open
drmikecrypto wants to merge 1 commit into
diegosouzapw:release/v3.8.51from
drmikecrypto:fix/12563-windows-npm-cmd-shim
Open

fix(cli): detect npm-global Claude .cmd shims under Program Files on Windows#12565
drmikecrypto wants to merge 1 commit into
diegosouzapw:release/v3.8.51from
drmikecrypto:fix/12563-windows-npm-cmd-shim

Conversation

@drmikecrypto

Copy link
Copy Markdown

Summary

Fixes #12563.

On a stock Windows Node MSI, npm-global Claude lands as C:\Program Files\nodejs\claude.cmd. That directory was already trusted for containment, but getKnownToolPaths never looked there. Electron often inherits a PATH without it, so where.exe misses the shim and the dashboard reports settings_found_binary_unresolved.

Different hole than #7831 / #7774 (.ps1 / known-path short-circuit).

What changed

  • Enumerate %ProgramFiles%\nodejs*.cmd as known install paths
  • Put that directory on the lookup PATH when it exists
  • Extract helpers so cliRuntime.ts stays under its frozen file-size cap

Test plan

  • tests/unit/cli-runtime-windows-node-12563.test.ts (5/5)
  • tests/unit/cli-runtime-npm-cmd-shim-12563.test.ts (win32 tsx runner)
  • Dashboard Claude CLI shows runnable with a Program Files npm shim

diegosouzapw#12563)

Stock Node MSI installs drop claude.cmd there, but detection never listed that directory and Electron's PATH often omits it, so the dashboard reported settings_found_binary_unresolved while a normal shell could run the CLI.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(startup): Claude CLI installed via npm shows settings_found_binary_unresolved despite valid .cmd shim (Windows)

1 participant