[BUG] `claude doctor` reports issue with installMethod, proposes subpar fix
Environment
- Platform (select one):
- [ ] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [x] Other: Claude Code
- Claude CLI version: 1.0.59
- Operating System: macos 15.5
- Terminal: iterm + vscode terminal
Bug Description
Prior (as recently as yesterday) I had created a script in my bin folder that intercepts claude for the purpose of starting a trace with otel-cli and using hooks to create spans for tool calls. This was working great as seen below
<img width="1373" height="338" alt="Image" src="https://github.com/user-attachments/assets/e78e09d3-2bf9-4686-88ea-e13fccbb3031" />
On a whim I decide to run /doctor from within claude, and it said that I should run claude migrate-installer to move to a local installation. I gave this a shot and noticed that it created an alias in my .zshrc. I do use multiple shells on my computer, and the addition of the alias will always trump the use of a script, which makes it impossible to intercept.
I can only assume that this is from a statsig feature considering the docs say it will only suggest that some users update it.
I was literally one day away from rolling out the feature across my org for better cost and usage tracking, especially between personal account usage for claude-code's pro and max plan. The only way around this is to force a native install for the user (perhaps install using npm -g, then claude install), even if they've chosen a local install. I have also never seen the permission issues described in the docs.
My proposed fix is to not use an alias and instead add a path modification to the rc files (all of them if present) so the binary can be found, but path mutations after the rc loads will still be able to intercept it
Steps to Reproduce
- Have
$PATHwith earlier folder containing a script calledclaude - run
claude migrate-installeras suggestion - Note that calling
claudeandwhich claude(on zsh/osx) say that its the alias rather than expected script.
Expected Behavior
Local installs do not prevent path mutations from running another application with the same name
Actual Behavior
The alias replaces the ability to call the binary unless you call \claude which is not reasonable to propagate across an organization
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗