[BUG] Self-Update Uninstalls Claude Code / Ignores Disabled Updates
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
For a while now I've been experiencing a weird issue where the claude command becomes unavailable from my path. Inspecting the install location confirms that both the symlink normally existing within my path and the path within the NPM install directory are both missing. I have noticed that this frequently occurred if I left claude code running and returned to the message:
✗ Auto-update failed · Try claude doctor or npm i -g @anthropic-ai/claude-code
I did not want claude auto-updating and following the documentation I could find I have tried preventing claude from doing so. There seems to be inconsistent documentation on whether the setting (in ~/.claude/settings.json) should have the key "autoUpdates" or "autoUpdaterStatus" set to either "disabled" (a string) or "false" (the actual unquoted boolean value). For both settings claude code appears to continue to attempt updating.
I wanted to confirm that it was indeed claude code removing itself so put a watch on the place within my path where it lives:
$ inotifywait -m ~/.local/bin/claude
Setting up watches.
Watches established.
/home/sstelfox/.local/bin/claude OPEN
/home/sstelfox/.local/bin/claude ACCESS
/home/sstelfox/.local/bin/claude CLOSE_NOWRITE,CLOSE
/home/sstelfox/.local/bin/claude OPEN
/home/sstelfox/.local/bin/claude ACCESS
/home/sstelfox/.local/bin/claude CLOSE_NOWRITE,CLOSE
/home/sstelfox/.local/bin/claude ATTRIB
/home/sstelfox/.local/bin/claude DELETE_SELF
The last line confirmed that it was indeed claude deleting itself from my system. This has been happening with claude for months, and due to this issue I am continuously re-installing it forcing me to be on the latest version. The version I just saw this behavior on:
$ claude --version
2.0.14 (Claude Code)
What Should Happen?
Claude should respect the setting to prevent automatic updates, or at the very least be sure that it can complete successfully before it removes itself.
Error Messages/Logs
See main body for additional details
Steps to Reproduce
Most likely the way / place / permissions involved in the safe installation of claude code is part of the reason it's failing to update. To replicate how I install it use the following command:
npm install -g --prefix=~/.local @anthropic-ai/claude-code
This will install the actual claude code module into ~/.local/lib/node_modules/@anthropic-ai/claude-code/cli.js, with a symlink at ~/.local/bin/claude. You'll want to ensure that ~/.local/bin is within your PATH environment variable so it is accessible.
This issue occurs without a ~/.claude/settings.json file being present as well as valid JSON containing the four variants of the settings I described in the primary issue body (each pair of keys with each pair of values). Claude does not respect any of these values and still attempts to update.
Open up claude (optionally monitoring with the inotifywait command) and wait for the auto-updater to attempt to update in-spite of the above settings at which point it will fail with the error message previously provided. You do not need to enter any commands or make any requests of claude code to replicate this behavior.
I have experienced this on Ubuntu, Fedora, and Arch Linux but do not have a Mac that I am permitted to use claude code on to attempt to replicate the issue.
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.0.14
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
Other
Additional Information
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗