update command downloads 0-byte binary when native and npm-global installs coexist
Resolved 💬 2 comments Opened Mar 22, 2026 by gmelli Closed Apr 20, 2026
Bug Report
Description
When Claude Code is installed via both the native installer (~/.local/share/claude/versions/) and npm global (npm install -g @anthropic-ai/claude-code), the claude update command exhibits three compounding failures:
- 0-byte download:
claude updatedownloads the new version as a 0-byte file to~/.local/share/claude/versions/{new_version} - Symlink not repointed: The symlink at
~/.local/bin/claudecontinues pointing to the old version directory - Misleading version report: After the failed update, running
claude updateagain reports "Current version: {new_version}" despite the binary still being the old version
Steps to Reproduce
- Install Claude Code via the native installer (creates
~/.local/bin/claudesymlink →~/.local/share/claude/versions/X.Y.Z) - Also install via npm:
npm install -g @anthropic-ai/claude-code(creates/opt/homebrew/bin/claude) - Use a shell alias that explicitly invokes
~/.local/bin/claude(native) - Run:
~/.local/bin/claude update
Expected Behavior
- Update downloads a valid binary for the new version
- Symlink is repointed to the new version
claude --versionreflects the new version
Actual Behavior
- Update detects "Configuration mismatch" (config says
global, runningnative) and fixes config - New version directory is created at
~/.local/share/claude/versions/{new}but the file is 0 bytes - Symlink at
~/.local/bin/claudestill points to old version - Subsequent
claude updatereports new version as current (reading from config, not binary)
Diagnostic Evidence
$ ls -la ~/.local/share/claude/versions/
2.1.17 2.1.42 2.1.81 # 2.1.81 is 0 bytes
$ ls -la ~/.local/bin/claude
claude -> ~/.local/share/claude/versions/2.1.42 # still old
$ ~/.local/bin/claude --version
2.1.42 (Claude Code) # old version still active
Workaround
- Run
claude updatea second time (succeeded on second attempt) - Remove the npm global installation:
npm -g uninstall @anthropic-ai/claude-code
Environment
- macOS (Darwin 24.6.0, Apple Silicon)
- Node.js via Homebrew
- Native install at
~/.local/bin/claude - npm global install at
/opt/homebrew/bin/claude - Updating from v2.1.42 to v2.1.81
Suggestions
- Validate downloaded binary size > 0 before considering update successful
- Verify symlink was actually repointed after update
- Report
--versionfrom the actual binary, not from config - Warn at startup if dual installations are detected (native + npm global)
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗