Claude CLI shows incorrect invocation path in diagnostics on Windows
Claude CLI shows incorrect invocation path in diagnostics despite correct installation
Problem Description
After installing Claude CLI natively on Windows, the claude doctor diagnostics command shows an incorrect invocation path pointing to a Bun symlink location (B:/~BUN/root/claude.exe) even though the CLI is correctly installed and running from the native location (C:\Users\frank\.local\bin\claude.exe).
Environment
- OS: Windows 11
- Claude CLI Version: 1.0.72
- Installation Method: Native Windows installation
- Shell: PowerShell
Symptoms
- Running
claude doctorshows:
````
Diagnostics
└ Currently running: native (1.0.72)
└ Path: native
└ Invoked: B:/~BUN/root/claude.exe # <-- Incorrect path
└ Config install method: native
└ Auto-updates enabled: true
- However,
where claudecorrectly shows:
````
C:\Users\frank\.local\bin\claude.exe
- The CLI functions normally despite the incorrect diagnostic output
Root Cause
The issue occurs when:
- Multiple Claude installations exist (npm, Bun, native)
- The native executable appears to have embedded references to build-time paths
- The diagnostic output may be reading from compiled metadata rather than actual runtime information
Solution
- Remove conflicting installations:
``powershell``
# Remove npm installation if present
npm uninstall -g @anthropic-ai/claude-code
- Verify only native installation remains:
``powershell``
where.exe claude
# Should only show: C:\Users\frank\.local\bin\claude.exe
- Confirm Claude is working:
``powershell``
claude --version # Should show version
claude update # Should check for updates successfully
Workaround
The incorrect path in diagnostics appears to be cosmetic - the CLI functions correctly despite this display issue. The path shown (B:/~BUN/root/claude.exe) seems to be embedded in the compiled executable from the build process but doesn't affect actual functionality.
Expected Behavior
The claude doctor command should show the actual invocation path that matches the output of where claude or Get-Command claude.
Additional Notes
- When running
claude doctorthrough automation tools (like Desktop Commander MCP), it may fail with a "Raw mode is not supported" error due to terminal limitations - The issue doesn't affect CLI functionality - all commands work as expected
- This appears to be a diagnostic display issue rather than an actual path problem
Suggested Fix
The diagnostic output should read the actual executable path at runtime rather than using compiled/embedded path information. Consider using process.argv[0] or equivalent to get the real invocation path.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗