[BUG] Self-Update Uninstalls Claude Code / Ignores Disabled Updates

Status Fixed / completed
Maintainer reply ✓ Yes — ant-kurt
Activity 5 comments · opened Oct 10, 2025 · closed Oct 18, 2025
💡 Likely answer: A maintainer (ant-kurt, collaborator) responded on this thread — see the highlighted reply below.

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

View original on GitHub ↗

5 Comments

github-actions[bot] · 1 year ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/7547
  2. https://github.com/anthropics/claude-code/issues/9116
  3. https://github.com/anthropics/claude-code/issues/996

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

ant-kurt collaborator · 1 year ago

DISABLE_AUTOUPDATER env var is the correct way to disable autoupdates. You can set this in the "env" block of settings.json. See https://docs.claude.com/en/docs/claude-code/setup#auto-updates

I can repro this on Ubuntu, thanks for the detailed steps.

sstelfox · 1 year ago

Thanks for pointing to the documentation I missed that!

ant-kurt collaborator · 12 months ago

This should be working better in the next release - this was due to use of --prefix=~/.local.

github-actions[bot] · 11 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.