Repository navigation
fix(windows): probe native-install paths in Find-ClaudeExe - #4
Merged
Merged
Conversation
Observed 2026-06-11: two consecutive `claude` launches failed with "claude not found" because an npm update of @anthropic-ai/claude-code was mid-reinstall -- npm deletes the bin shims (claude/.cmd/.ps1) before recreating them (shims re-stamped 13:53:17), so the resolver's PATH probe and npm candidates both legitimately missed. The surprise: the Windows resolver only knew npm-era locations, while the POSIX find-claude.sh resolvers carry 9 probes including native installs. A migration off npm (claude.exe at ~\.local\bin or ~\.claude\local) would have bricked the wrapper permanently, not transiently. Added both native-install candidates ahead of the npm shims (real PE binary needs no cmd.exe host-routing) and taught the error message about the transient mid-update window. Tests: all 4 Windows suites pass (job-object kill-on-close 7ms, orphan-detect, config-loader, spawn-plan); end-to-end `claude --version` green under PS 5.1 profile wrapper. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Two consecutive
claudelaunches on 2026-06-11 failed withclaude not found in PATH or common install locationsbecause an npm update of@anthropic-ai/claude-codewas mid-reinstall: npm deletes the bin shims (claude/claude.cmd/claude.ps1) before recreating them, soFind-ClaudeExelegitimately found nothing during that window.Diagnosing it exposed a worse latent gap: the Windows resolver only knew npm-era locations (4 candidates), while the POSIX
find-claude.shresolvers carry 9 probes including native installs. Migrating off npm (claude.exeat~\.local\binor~\.claude\local) would have bricked the wrapper permanently, not transiently.What
Find-ClaudeExe— a real PE binary needs no cmd.exe host-routing, so it is strictly preferable when present.Verification
claude --version→2.1.173 (Claude Code)through the PS 5.1-ShadowClaudeprofile function with this change live.🤖 Generated with Claude Code