Interrupted auto-update leaves claude broken (missing bin symlink, placeholder stub, truncated native binary) with no self-healing
Status Open
Reported on v2.1.220
Maintainer reply None cached
Activity 2 comments · opened Aug 5, 2026
Bug Report: Interrupted auto-update leaves claude broken and unrecoverable without manual intervention
Summary
Killing the Claude Code CLI (Ctrl-C / force quit) during an auto-update leaves the install in a broken state:
- the
claudecommand disappears fromPATH(the npm bin symlink is missing), - the leftover
~/.claude/.update.lockholds the PID of the dead process, which can block future updates, - the native binary can be left truncated/corrupt (
bin/claude.exewas a 500-byte placeholder stub, and a partially-extracted native package crashed withSIGBUS).
There is no self-healing: Claude Code does not detect that the update was interrupted, and the only reliable fix is a manual full reinstall.
Environment
- OS: Linux (WSL2), x86_64
- Install method: global npm package
@anthropic-ai/claude-code(npm prefix~/.npm-global) - Version transition:
2.1.220->2.1.221->2.1.222(interrupted during update) - Node: v24.18.0
Steps to reproduce
- Start
claude(auto-update triggers). - Force-quit the process while the update is in progress (before it finishes).
- On next shell:
claude->command not found.
What was found (diagnosis)
~/.npm-global/bin/claudesymlink was absent (only a stale hidden.claude-XXXXXXsymlink pointing at the package stub remained).@anthropic-ai/claude-code/bin/claude.exewas the 500-byte placeholder stub ("Error: claude native binary not installed"), i.e. thepostinstall(install.cjs) had not completed.- The optional native package
@anthropic-ai/claude-code-linux-x64was partially extracted: theclaudebinary existed butpackage.jsonwas missing, sorequire.resolveininstall.cjsfailed and the postinstall could not repair itself. - Manually copying that partially-downloaded ~42 MB binary into
bin/claude.exeproducedSIGBUS(Bus error, exit 135) on every run — evenlddcrashed on the file. The binary was truncated/corrupt. ~/.claude/.update.lockcontained the PID of the force-quit process (dead), potentially blocking the autoupdater.
Fix that worked
npm install -g @anthropic-ai/claude-code@latest
A full reinstall re-downloaded the complete ~289 MB native binary, ran postinstall, and recreated the claude bin symlink. After that claude --version -> 2.1.222.
Suggested improvements
- Validate postinstall completion. The autoupdater should verify
bin/claude.exeis the real native binary (not the placeholder stub) and that the native package is fully extracted before considering the update successful. - Recover stale
.update.lock. A lock whose PID is no longer alive should be treated as stale and cleared automatically. - Self-heal on launch. If the binary is the placeholder stub or crashes with
SIGBUS(corrupt/truncated file), Claude Code should detect this and re-runinstall.cjs(or trigger a repair) instead of silently disappearing fromPATH. - Atomic symlink/bin placement. The
claudebin symlink and the native binary copy should be committed atomically so an interrupted update cannot leave a partially-linked install.
Impact
Any user who force-quits during an update is left without a working claude command and no in-tool recovery path. Recovery requires shell-level knowledge of npm and manual reinstall.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗