[BUG] NPM auto-update deletes user-created symlinks in ~/.local/bin

Resolved 💬 3 comments Opened Jul 5, 2025 by mikluko Closed Jul 11, 2025

Environment

  • Platform (select one):
  • [x] Anthropic API
  • [ ] AWS Bedrock
  • [ ] Google Vertex AI
  • [ ] Other: <!-- specify -->
  • Claude CLI version: <!-- output of claude --version -->
  • Operating System: macOS
  • Terminal: <!-- e.g. iTerm2, Terminal App -->

Bug Description

Claude Code's automatic NPM updates are deleting manually created symlinks that point to the claude executable. This is unexpected behavior as NPM packages should not modify files outside their installation directory.

Steps to Reproduce

  1. Install claude globally via npm
  2. Create a symlink manually: ln -s /path/to/npm/global/bin/claude ~/.local/bin/claude
  3. Wait for an automatic update to occur (or trigger one)
  4. The symlink in ~/.local/bin/claude gets deleted

Expected Behavior

  • NPM updates should only modify files within the package's installation directory
  • User-created symlinks outside the NPM scope should remain untouched
  • Package updates should respect the user's filesystem customizations

Actual Behavior

The symlink in ~/.local/bin/ is deleted during each automatic update, requiring manual recreation.

Additional Context

I prefer symlinking individual commands to ~/.local/bin rather than adding the entire NPM bin directory to PATH to avoid cluttering my command namespace with unwanted executables from other packages.

View original on GitHub ↗

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