Claude CLI shows incorrect invocation path in diagnostics on Windows

Resolved 💬 3 comments Opened Aug 10, 2025 by Sallvainian Closed Aug 14, 2025

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

  1. Running claude doctor shows:

``
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
``

  1. However, where claude correctly shows:

``
C:\Users\frank\.local\bin\claude.exe
``

  1. The CLI functions normally despite the incorrect diagnostic output

Root Cause

The issue occurs when:

  1. Multiple Claude installations exist (npm, Bun, native)
  2. The native executable appears to have embedded references to build-time paths
  3. The diagnostic output may be reading from compiled metadata rather than actual runtime information

Solution

  1. Remove conflicting installations:

``powershell
# Remove npm installation if present
npm uninstall -g @anthropic-ai/claude-code
``

  1. Verify only native installation remains:

``powershell
where.exe claude
# Should only show: C:\Users\frank\.local\bin\claude.exe
``

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

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗