Fix Claude Code "Auto-update failed · Run claude doctor"
Claude Code Auto-update failed · Run claude doctor means a background update did not install. Run claude update in your shell to see the real error.
Auto-update failed · Run claude doctorThis red line in the session footer means Claude Code tried to update itself in the background and the install failed. The current version keeps working, so you can carry on. To find the cause, running **claude update in your shell** is faster than following the hint to claude doctor.
[1] Know that claude doctor will not tell you why. Per the official docs, its Last update attempt: failed (install_failed) line has a date but no cause. What doctor is useful for is the install method (the Running: line) and the Auto-updates state.
[2] Run the update yourself from a regular terminal, outside any Claude Code session.
$ claude updateOn success it prints Successfully updated from <old version> to version <new version>; if you are current it prints Claude Code is up to date (<version>). The new version takes effect the next time you start Claude Code. If it fails, find the error in the table below.
claude update error | Fix |
|---|---|
The connection dropped while downloading the update (attempt 3/3: …) | Run it again. Behind a proxy, set HTTPS_PROXY and ask for the full download from downloads.claude.ai to be allowed |
Download timed out: exceeded the total deadline | The download did not finish in 10 minutes. Retry from a faster network (not retried automatically) |
Release verification failed for Claude Code <version> (<reason>) | Nothing was installed and your version still works. If the reason starts with sidecar_fetch_, run it again now; otherwise try later |
EACCES: permission denied | Write permission on the install directories (step 3) |
npm error code ENOTEMPTY | A leftover npm directory (step 5) |
Hangs after Checking for updates | A shell config path such as ~/.zshrc is a directory. Update to v2.1.214 or later; on affected versions, rerun the install script instead |
[3] Check that the download server is reachable and what the latest version is. Updates come from downloads.claude.ai.
$ curl -sI https://downloads.claude.ai/claude-code-releases/latestHTTP/2 200 …$ curl -s https://downloads.claude.ai/claude-code-releases/latest2.1.311A 200 on the first line means you reach it; 403 is usually a proxy or filter; no output or Could not resolve host means the network blocks it. Compare the version from the second command with claude --version to see how far behind you are. For permission errors, check that the native install directories are writable.
$ test -w ~/.local/bin && echo "writable" || echo "not writable"$ test -w ~/.claude && echo "writable" || echo "not writable"The native install writes to ~/.local/bin (the claude launcher), ~/.local/share/claude, ~/.local/state/claude, ~/.cache/claude and ~/.claude/downloads. If you get not writable, look at who owns those paths before changing anything, and save the output (you need it to undo).
$ ls -ld ~/.local/bin ~/.local/share/claude ~/.local/state/claude ~/.cache/claude ~/.claude ~/.claude/downloadsGive back to your user only the Claude Code paths that are owned by someone else (usually root, after an install with sudo). Leave out paths that do not exist.
$ sudo chown -R "$(whoami)" ~/.local/share/claude ~/.local/state/claude ~/.cache/claude ~/.claude$ sudo chown "$(whoami)" ~/.local/bin[4] Check for more than one installation. With both a native and an npm install, the copy that got updated may not be the one that runs.
$ which -a claude$ ls -la ~/.local/bin/claude$ npm -g ls @anthropic-ai/claude-code 2>/dev/nullA native install shows ~/.local/bin/claude as a symlink into ~/.local/share/claude/versions/. If you find more than one, keep one; the official docs recommend the native install (remove npm with npm uninstall -g @anthropic-ai/claude-code). If you replaced ~/.local/bin/claude with your own script, auto-update leaves that launcher alone, so new versions install but your launcher picks which one runs.
[5] For an npm install that failed with ENOTEMPTY, delete the directory named on the npm error path line and any .claude-code-* temp directories next to it, then reinstall. **From the moment you delete it until the reinstall finishes, the claude command is gone**, so first note your current version and check that the registry can serve the package.
$ claude --version$ npm view @anthropic-ai/claude-code versionIf the second command does not print a version (network or proxy block), do not delete anything yet; first make the npm registry (registry.npmjs.org, or your company mirror) reachable. If it does, delete, reinstall and check the version.
$ rm -rf "$(npm root -g)/@anthropic-ai/claude-code"$ rm -rf "$(npm root -g)/@anthropic-ai/.claude-code-"*$ npm install -g @anthropic-ai/claude-code$ claude --version[6] Homebrew, WinGet, apt, dnf and apk installs do not auto-update by default. If you turned it on with CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATE=1, the upgrade can fail because the new version is not in the package repository yet (or, on WinGet, because the running executable is locked); upgrade later yourself with brew upgrade claude-code or winget upgrade Anthropic.ClaudeCode.
[7] If you do not want automatic updates, set DISABLE_AUTOUPDATER to "1" in the env block of your settings file. When the Auto-updates line in claude doctor reads disabled (set by env: DISABLE_AUTOUPDATER), it took effect, and claude update still works. If the worry is broken releases, consider autoUpdatesChannel set to "stable" (usually a build about a week old) instead of turning updates off.
For sample doctor output and sign-in or connection errors, see Claude Code error messages and fixes.