How to update Claude Code, check its version, or downgrade
Update Claude Code on the installer, npm, Homebrew, WinGet or apt; check the latest version; switch to stable; pin or roll back; fix failed updates.
Run claude update. If you installed with Anthropic’s installer you rarely need to, because that copy updates itself in the background and the new version starts next time you open Claude Code. Homebrew, WinGet, apt, dnf and apk installs do not update themselves: use brew upgrade claude-code, winget upgrade Anthropic.ClaudeCode or your system’s upgrade. On npm, run npm install -g @anthropic-ai/claude-code@latest, not npm update -g. claude --version shows what you have; as of November 21, 2026 the newest release is 2.1.330 and the stable channel serves 2.1.323. To go back to an older version, run claude install 2.1.323 (any version number), and set DISABLE_UPDATES=1 if it should stay there.
Which version you have, and which is newest
claude --version # prints e.g. 2.1.330 (Claude Code)
claude doctor # install method, channel, auto-updates, last updateCopiedclaude doctor runs without starting a session, so it works before you sign in and when claude itself will not start. Its lines for the install method, the update channel, whether auto-updates are on and the result of the last update attempt are the ones to read here; what they look like on a fresh server is in the guide to Claude Code on Linux.
Anthropic publishes two channels. latest gets every release as it ships; stable is, in Anthropic’s setup docs, “a version that is typically about one week old, skipping releases with major regressions”. On November 21, 2026 npm’s tags for the package read latest 2.1.330 (released November 20) and stable 2.1.323 (released November 12). To see the current pair yourself:
npm view @anthropic-ai/claude-code dist-tagsCopiedWhat changed in each release is in the changelog in Anthropic’s repository and on its releases page.
Update it, by how you installed it
If you are not sure which route you used, the claude doctor install-method line says. The commands, from Anthropic’s update docs:
- Native installer (
install.sh,install.ps1,install.cmd): updates itself. For it now, runclaude update. - Homebrew:
brew upgrade claude-code, orbrew upgrade claude-code@latestif that is the cask you installed. Homebrew keeps old versions on disk;brew cleanupremoves them. - WinGet:
winget upgrade Anthropic.ClaudeCode. - apt:
sudo apt update && sudo apt upgrade claude-code. - dnf:
sudo dnf upgrade claude-code. - apk:
apk update && apk upgrade claude-code. - npm:
npm install -g @anthropic-ai/claude-code@latest. The docs warn offnpm update -g, which “respects the semver range from the original install and may not move you to the newest release.” An npm install also updates itself, provided npm’s global folder is writable withoutsudo.
claude update ends with a line finishing to version 2.1.330 when it installed something, and Claude Code is up to date (2.1.330) when there was nothing to do. On Homebrew, WinGet and apk installs it prints Claude is up to date! instead, and on Homebrew it hands the work to brew upgrade.
Two things catch people on the package managers. Claude Code may tell you about a new version before Homebrew, WinGet or the Linux repositories carry it; Anthropic lists this as a known issue, and the fix is to try again later. And if you would rather Homebrew or WinGet upgraded by themselves, set CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATE=1: Claude Code then runs the upgrade in the background and offers a restart. WinGet’s can fail while Claude Code is running, because Windows locks the file, and then you get the command to run yourself. apt, dnf and apk stay manual, since their upgrades need root.
Moving from npm to the native installer is a matter of running the installer and then npm uninstall -g @anthropic-ai/claude-code, which is also Anthropic’s fix for two of the npm errors below.
Auto-updates: how they work and how to switch them off
A native install “checks for updates on startup and periodically while running”, downloads in the background, and the new version takes effect the next time you start claude. A session that is already open keeps running the version it started with.
Two settings turn it off, either in your shell or in the env block of ~/.claude/settings.json:
{
"env": {
"DISABLE_AUTOUPDATER": "1"
}
}CopiedDISABLE_AUTOUPDATER=1stops the background check only;claude updateandclaude installstill work.claude doctorthen readsdisabled (set by env: DISABLE_AUTOUPDATER).DISABLE_UPDATES=1blocks every update, the manual commands included. Anthropic intends it for teams that hand out Claude Code themselves, and it is the one to use when you want a version to stay put.
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC also stops auto-updates, along with telemetry, error reporting and more, so an install that has stopped updating for no visible reason may have it set.
Switch between latest and stable
On a native install the channel is the autoUpdatesChannel setting, which is unset (so latest) by default. Change it in /config under Auto-update channel, with claude install stable, or in ~/.claude/settings.json. Moving to stable is a downgrade if you are ahead of it: the docs say “a native installation updates to the stable version even when that version is older than yours”. To stay where you are until stable catches up, set a floor in the same file, using the number claude --version prints:
{
"autoUpdatesChannel": "stable",
"minimumVersion": "2.1.330"
}Copied/config offers the same choice when you switch there, writes the floor for you, and clears it if you switch back to latest. Homebrew ignores the setting and picks the channel by cask name: claude-code is stable, claude-code@latest is latest. The apt, dnf and apk repositories pick it by repository address. Stable can lag a newly released model, which then refuses with “does not support this model” until you move to latest.
Install a specific version, or downgrade
With the native install, claude install takes a version number or a channel. The installer script takes the same, which also works when claude will not run:
claude install 2.1.323
curl -fsSL https://claude.ai/install.sh | bash -s 2.1.323CopiedOn Windows, from PowerShell:
& ([scriptblock]::Create((irm https://claude.ai/install.ps1))) 2.1.323Copiedclaude --version afterwards prints the version you asked for. An older version installed this way does not stay: the next background update, or the next claude update, moves it forward again. To hold it, set DISABLE_UPDATES=1 as above, and remove it when you are ready to move on. A minimumVersion will not do this job; it is a floor that stops updates going below a number, never a ceiling.
On npm, an exact version is npm’s own name@version form, npm install -g @anthropic-ai/claude-code@2.1.323; that is npm’s syntax rather than a command Anthropic’s pages give. Anthropic documents no way to install an older version through Homebrew or WinGet; the native installer is the route for that.
A team that needs every machine within a range has managed settings for it, requiredMinimumVersion and requiredMaximumVersion (Claude Code 2.1.163 or later), which stop Claude Code from starting outside the range while leaving claude update and claude install working so people can get back into it. They are read only from the managed settings file, and are ignored without a warning anywhere else.
When an update fails
Each of these is on Anthropic’s install troubleshooting page with its fix. In every case the version you already have keeps working.
Auto-update failed · Run claude doctorin red under the session. The background update did not install.claude doctorshows onlyLast update attempt: failed (install_failed)and a date, so runclaude updatein your shell to finish it or see the real error.- The download dropped or timed out. The message is below. Claude Code tries three times before giving up, and a download still running after ten minutes fails with
Download timed out: exceeded the total deadline. Runclaude updateagain; behind a proxy, setHTTPS_PROXYfirst, and a corporate proxy that keeps cutting it off needs to allow the full download fromdownloads.claude.ai.
The connection dropped while downloading the update (attempt 3/3: aborted). Check your network — proxies sometimes cut off large downloads.CopiedRelease verification failed for Claude Code. Nothing was installed. If the reason in brackets starts withsidecar_fetch_, run the same command again; otherwise try later, and report it to Anthropic if it repeats.claude updatehangs afterChecking for updates. On versions before 2.1.214 this happened when one of your shell files (~/.bashrc,~/.zshrcand similar) was a directory. Since the updater itself hangs, update by running the install script again.- npm
EACCESpermission errors. Do not rerun withsudo: Claude Code updates itself through npm withoutsudo, so a root-owned install can never update on its own. Anthropic’s fix is to switch to the native installer, which needs no root. npm error code ENOTEMPTY. An earlier run left a directory behind. Delete the one thenpm error pathline names, usuallyrm -rf "$(npm root -g)/@anthropic-ai/claude-code", plus any.claude-code-folders beside it, then install again.Error: claude native binary not installed.after an npm update. Ifnpm --versionstarts with 12, npm skipped the step that puts the binary in place. The lasting fix is the native installer, followed by uninstalling the npm package.Error: Cask 'claude-code@latest' is not installed.You are upgrading the other cask.brew list --cask | grep claude-codenames the one you have. If Homebrew offers an older version than you expected, runbrew updatefirst, and rememberclaude-codeis the stable cask.'claude' is not recognizedright after an update on Windows. The swap of the executable failed halfway. The old one is kept asclaude.exe.old.plus a timestamp in%USERPROFILE%\.local\bin; rename the newest back toclaude.exe, or run the PowerShell installer again.
The update worked but the old version still runs
This is nearly always a second copy of Claude Code earlier on your PATH, often an old npm install next to a native one, so you update one and run the other. List every claude your shell can see, and check for an npm copy:
which -a claude
npm -g ls @anthropic-ai/claude-codeCopiedOn Windows, where.exe claude does the same. Anthropic’s advice is to keep only one, preferably the native install at ~/.local/bin/claude, and remove the others with their own uninstall command. Two more causes: a claude session left open, which keeps the version it started with until you quit and start it again (on a server, check for one still running in tmux or screen), and a launcher you made yourself at ~/.local/bin/claude, which updates leave alone. For the second, remove that file and run claude update so the installer manages it again.
On a server, where Claude Code often runs from cron, a service or a long-lived session, the PATH and login-shell details are in Claude Code on Linux, and running it on a VPS covers the rest of the setup. The same questions for OpenAI’s agent are in how to update Codex.