Auto-updater incorrectly detects native install as npm-global after migration from npm

Resolved 💬 2 comments Opened Apr 1, 2026 by p3nchan Closed May 7, 2026

Summary

After migrating from an npm global install to a native install of Claude Code, the AutoUpdaterWrapper still detects the installation type as npm-global, which causes auto-updates to be silently skipped. The user only discovers new versions through external channels (e.g., social media) rather than through the built-in auto-updater.

Environment

  • OS: macOS (arm64)
  • Claude Code version: 2.1.89 (latest at time of report)
  • Binary location: ~/.local/bin/claude (Mach-O arm64 executable)
  • Versions directory: ~/.local/share/claude/versions/ (exists, contains version binaries)
  • npm global packages: empty — npm list -g shows no @anthropic-ai/claude-code entry

Steps to Reproduce

  1. Install Claude Code via npm: npm install -g @anthropic-ai/claude-code
  2. Later, switch to the native install (e.g., via claude update or direct download to ~/.local/bin/claude)
  3. Remove the npm global package (or let it become stale/removed)
  4. Run Claude Code and enable debug logging
  5. Observe that auto-updates are skipped

Debug Log (relevant lines)

AutoUpdaterWrapper: Installation type: npm-global
Plugin autoupdate: skipped (auto-updater disabled)

Expected Behavior

After switching to a native install, AutoUpdaterWrapper should:

  1. Detect that the binary at ~/.local/bin/claude is a native (non-npm) install
  2. Enable auto-updates accordingly
  3. Notify the user when a new version is available

Actual Behavior

AutoUpdaterWrapper reports Installation type: npm-global even though:

  • The npm global package has been removed (npm list -g is empty)
  • The binary is a Mach-O arm64 executable located at ~/.local/bin/claude
  • The versions directory ~/.local/share/claude/versions/ exists with version binaries

As a result, auto-updates are silently disabled. The user had to run claude update manually after learning about a new version through social media.

Root Cause (hypothesis)

The installation type detection logic in AutoUpdaterWrapper likely caches or incorrectly infers the install method — possibly by checking a stale config value, inspecting the binary path in a way that matches an npm pattern, or failing to detect the native install directory structure. It does not appear to re-evaluate based on the current binary location or the presence of the native ~/.local/share/claude/versions/ directory.

Suggested Fix

The detection logic should:

  • Check whether the binary resolves to a path inside a known npm prefix (e.g., via npm prefix -g or npm root -g) at runtime, not rely on a cached/historical value
  • Fall back to native install detection if the npm global package is not found
  • Alternatively, prefer native install detection when the versions directory (~/.local/share/claude/versions/) is present

Impact

Users who migrate from npm to native install lose silent auto-update functionality without any warning. This is a silent failure — there is no UI notification that auto-updates have been disabled, and the user has no way to know they are running an outdated version until they check manually.

View original on GitHub ↗

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