How to Update Claude Code (and Check Your Version)

Run claude update. Native installs also update themselves. If you installed with npm, run npm install -g @anthropic-ai/claude-code@latest, then check with claude --version.

Gary · Published · Updated · 10 min read

Isometric illustration of a glowing terminal window with an upward arrow and a refreshed package box on a dark slate background.
On this page
  1. How to update Claude Code (quick answer)
  2. How do you check which Claude Code version you have?
  3. How do you update Claude Code installed with npm?
  4. What does claude update do on an npm install?
  5. Does Claude Code update automatically?
  6. Can you choose a slower, steadier update channel?
  7. How do you turn off Claude Code auto-updates?
  8. Why is my Claude Code update failing?
  9. Why updating matters for security
  10. After you update: a 2-minute pre-launch check
  11. FAQ
  12. Updated? Scan your app before launch.

How to update Claude Code: run claude update. If you used Anthropic's native installer, Claude Code also updates itself in the background, so you may already be current. If you installed with npm, run npm install -g @anthropic-ai/claude-code@latest instead. Either way, confirm it worked with claude --version.

By Gary, Greenlight My App · Updated Oct 22, 2026 · How we checked this: commands and settings come from Anthropic's setup docs (external) and install troubleshooting docs (external), read on Oct 22, 2026. We ran an npm install of an older release, then npm install @anthropic-ai/claude-code@latest, claude update and claude doctor ourselves on a Linux test machine, in a throwaway folder and without signing in. We tested the install and update commands only, not Claude Code's coding features. Drafted with AI tools and reviewed by a person before publishing.

How to update Claude Code (quick answer)

Pick the line that matches how you installed it. The Claude Code update command differs by install type (setup docs (external)):

How you installedUpdates itself?Update command
Native installer (macOS, Linux, WSL, Windows)Yes, in the backgroundclaude update
npm (npm install -g)Tries to (see below)npm install -g @anthropic-ai/claude-code@latest
HomebrewNo, by defaultbrew upgrade claude-code or brew upgrade claude-code@latest (match your cask)
WinGet (Windows)No, by defaultwinget upgrade Anthropic.ClaudeCode
apt (Debian, Ubuntu)Nosudo apt update && sudo apt upgrade claude-code
dnf (Fedora, RHEL)Nosudo dnf upgrade claude-code
apk (Alpine)Noapk update && apk upgrade claude-code
VS Code extensionThrough the editorUpdate the extension in the Extensions view

Then run:

Bash

claude --version

When claude update installs something, Anthropic's docs say it prints Successfully updated from <old version> to version <new version>. If you're already current, it prints Claude Code is up to date (<version>).

Flowchart: how did you install Claude Code? Native means auto-updates or claude update; npm means npm install -g @anthropic-ai/claude-code@latest; other means brew upgrade or an IDE extension update; then verify with claude --version and claude doctor Which update command do I use? Original diagram by Greenlight My App.

How do you check which Claude Code version you have?

Run claude --version in your terminal. It prints the version number followed by "(Claude Code)". For example, on our test machine before updating:

Text

$ claude --version
2.1.293 (Claude Code)

Terminal: claude --version prints 2.1.293 (Claude Code) for the old install Our starting point on Oct 22, 2026: an older release installed with npm on purpose.

To see whether that's the latest version, compare it with the newest entry on the Claude Code releases page (external), or let claude update tell you. If you use the VS Code extension, Anthropic's VS Code docs (external) say "the extension's version number is the Claude Code version it bundles," so the Extensions view shows it.

For a fuller picture, claude doctor shows how Claude Code was installed, whether auto-updates are on, and the result of the last update attempt (more on that below).

How do you update Claude Code installed with npm?

Use npm install -g @anthropic-ai/claude-code@latest. Anthropic's setup docs say: "Avoid npm update -g, which respects the semver range from the original install and may not move you to the newest release." They also warn: "Do NOT use sudo npm install -g," because it can cause permission problems and security risks.

Here's what happened when we did it. On Oct 22, 2026, we installed an older release, 2.1.293, into a throwaway folder (not a global install, so nothing else on the machine changed), then updated it with npm:

Bash

npm install --prefix /tmp/cc-proof @anthropic-ai/claude-code@latest
BeforeAfter
claude --version2.1.293 (Claude Code)2.1.308 (Claude Code)
npm output"changed 2 packages … found 0 vulnerabilities"

Terminal: npm install of @anthropic-ai/claude-code@latest, then claude --version shows 2.1.308 where it showed 2.1.293 before Old → new with npm: 2.1.293 to 2.1.308, the npm "latest" release on Oct 22, 2026.

On your own machine, the global version of that command is the one from the docs: npm install -g @anthropic-ai/claude-code@latest.

Our test machine had Node 20, and npm printed an EBADENGINE warning because the package asks for Node 22 or later. Anthropic's docs say that on an older Node, npm "prints an EBADENGINE warning during install rather than failing; the install completes and claude still runs." That's what we saw.

What does claude update do on an npm install?

We also tried claude update on the old 2.1.293 copy, without signing in. It worked without sign-in and printed:

Text

New version available: 2.1.308 (current: 2.1.293)
Installing update...
Using global installation update method...
Successfully updated from 2.1.293 to version 2.1.308

Terminal: claude update reports Successfully updated from 2.1.293 to version 2.1.308 claude update said it succeeded.

But when we checked, the copy we had run was still 2.1.293. The update had gone into a separate, global npm install instead. (We removed that extra copy right away.)

Terminal: the folder copy still reports 2.1.293 while a new global npm install of 2.1.308 appeared The update landed in a different place than the copy we ran.

The lesson for anyone with a non-standard npm setup: after claude update, run claude --version again and which -a claude to make sure the claude on your PATH is the one that changed.

Does Claude Code update automatically?

Native installs do; Homebrew, WinGet and Linux package-manager installs don't by default. Per the setup docs (external), Claude Code "checks for updates on startup and periodically while running," downloads in the background, and the update "take[s] effect the next time you start Claude Code."

Claude Code setup docs, Update Claude Code section, explaining that native installations update automatically in the background Anthropic's docs on updates, as published on Oct 22, 2026.

Claude Code setup docs, Auto-updates section, explaining that Claude Code checks for updates on startup and while running The auto-update behavior, per the docs.

Can you choose a slower, steadier update channel?

Yes. The autoUpdatesChannel setting picks between "latest" (the default, new features right away) and "stable" ("typically about one week old, skipping releases with major regressions"). Set it in /config or in settings.json:

JSON

{
  "autoUpdatesChannel": "stable"
}

How do you turn off Claude Code auto-updates?

Set DISABLE_AUTOUPDATER to "1" in the env block of your settings.json:

JSON

{
  "env": {
    "DISABLE_AUTOUPDATER": "1"
  }
}

Then run claude doctor; the Auto-updates line should read disabled (set by env: DISABLE_AUTOUPDATER). The docs note this "only stops the background check; claude update and claude install still work." To block every update path, the setting is DISABLE_UPDATES.

Claude Code setup docs, Disable auto-updates section, showing the DISABLE_AUTOUPDATER setting Turning off auto-updates, per the docs.

If you turn auto-updates off, put a reminder on your calendar to run claude update yourself. Staying current is how security fixes reach you (see below).

Claude Code setup docs, Update manually section, showing the claude update command Updating manually, per the docs.

Why is my Claude Code update failing?

Most failed updates come down to a handful of causes covered in Anthropic's install troubleshooting docs (external). Start with claude doctor, which reports the install method, auto-update status and "Last update attempt."

Terminal: claude doctor output showing npm-global 2.1.308, Auto-updates enabled, channel latest, last update attempt success, and No installation issues found claude doctor on our test machine after updating, not signed in. The sign-in-only parts were skipped.

SymptomLikely cause (per the docs)What to try
Version doesn't change after updatingMore than one install (native, npm, old local npm)which -a claude; check ~/.local/bin/claude, ~/.claude/local/ and npm -g ls @anthropic-ai/claude-code; keep one
"Auto-update failed · Run claude doctor" in the footerA background update didn't installRun claude update in your shell to see the actual error
Permission errors on an npm installnpm's global folder isn't writableDon't use sudo; the docs suggest switching to the native installer
"The connection dropped while downloading the update"A proxy or network cut the downloadRun claude update again; set HTTPS_PROXY if you need a proxy
"Release verification failed"Claude Code couldn't confirm the release is genuine, so it installed nothingRun the same command again later; your current version keeps working
claude update or claude doctor hangsA folder where a shell config file should be (fixed in v2.1.214)Move the folder aside, or rerun the install script
command not found: claudeThe install folder isn't on your PATHFollow "Fix your PATH" in the docs
EBADENGINE warning on npmNode older than 22Usually just a warning; upgrade Node when you can

If none of these match, the docs' troubleshooting page has a "Find your error" index with the exact messages.

Why updating matters for security

Updates are how security fixes reach you. Anthropic's setup docs tell Homebrew and WinGet users to upgrade "to get the latest features and security fixes." The security advisories page (external) for the anthropics/claude-code GitHub repository listed 35 advisories when we checked on Oct 22, 2026, with severity labels such as High, Moderate and Low.

GitHub security advisories page for anthropics/claude-code listing published advisories with severity labels The public advisories list for the repository on Oct 22, 2026.

We won't summarize individual advisories here; read each one on GitHub for which versions it affects and what changed. The practical takeaway is simple: a coding agent that can run commands and edit files on your machine is worth keeping current. Pair that with sensible permission and sandbox settings, so an agent can't do more than you meant it to.

After you update: a 2-minute pre-launch check

Updating your tools protects your machine. Before real users arrive, check what you're about to ship, too:

  1. Keys out of the frontend. API keys for Claude or OpenAI belong on a server, never in browser code. See Claude API key security.
  2. No .env or .git files served publicly. Ask your host to block them, then check from a browser.
  3. No public source maps unless you meant to publish your source code.
  4. Know what you're paying for. If Claude Code is on your plan, our Claude Code pricing guide explains the limits.
  5. Compare tools if you're choosing one. See Codex vs Claude Code and Cursor vs Claude Code.
  6. Run a scan of your live app (below).

FAQ

How do I check my Claude Code version? Run claude --version in your terminal. It prints something like 2.1.308 (Claude Code). In VS Code, the extension's version in the Extensions view is the Claude Code version it bundles.

Does Claude Code update automatically? Native installs do, in the background, and the new version takes effect the next time you start Claude Code. Homebrew, WinGet, apt, dnf and apk installs don't auto-update by default.

Why is my Claude Code update failing? The most common causes are more than one install on your machine, npm permission errors, a network or proxy cutting the download, or a PATH problem. Run claude doctor, then claude update to see the actual error.

Can I turn off auto-updates? Yes. Set DISABLE_AUTOUPDATER to "1" in the env block of settings.json. claude update still works when you want to update by hand.

Do I need to update to get security fixes? Yes. Fixes ship in new releases, and Anthropic's docs tell package-manager users to upgrade to get them. The repository's public security advisories page lists what was fixed.

Updated? Scan your app before launch.

Updated your tools and ready to ship what you built? Scan your app before launch with Greenlight My App's free scan to check for exposed keys and files. It's automated, read-only and educational, not a security audit: it checks HTTPS, common security headers, exposed .env or .git files, public source maps and common secret key patterns in the scripts your homepage loads. "Nothing found" isn't a guarantee that nothing is exposed. Run a free scan (external).

Sources

On this site

Related posts

Greenlight My App is independent and not affiliated with or endorsed by Anthropic. Claude and Claude Code are trademarks of Anthropic; npm, Homebrew, WinGet, VS Code and GitHub are trademarks of their owners; not affiliated with Greenlight My App. We tested the install and update commands only, not Claude Code's coding features. This page is general information, not professional security advice, legal advice, a security audit or a guarantee. Check your own setup against the vendor's current docs.