How to Install Claude Code the Right Way in 2026
Compare Claude Code installation methods, identify package ownership, and migrate to the native installer with verification.
I've installed Claude Code three different ways in the past month. Homebrew first, then npm, now the native installer. Each time I thought I had the right answer. Here's what I learned.
Homebrew: Where I Started
I was running Claude Code v2.1.81 via Homebrew. The new /buddy command — the terminal pet everyone was talking about — needed v2.1.89+. I ran brew upgrade. Nothing happened. Homebrew was 9 versions behind.
Package-managed installations follow their configured package and release channel. Check package metadata and the installed version before assuming their release cadence matches the native latest channel.
npm: Better, but Not the Answer
I switched to npm. Updates landed faster because @anthropic-ai/claude-code is the actual package Anthropic publishes. No middleman. I even added a quick-update alias:
alias cu="npm update -g @anthropic-ai/claude-code"That npm installation displayed a deprecation warning at the time. Current documentation also describes an npm installation path, so check the current guidance rather than treating the old warning as a permanent policy.
The Native Installer: The Right Way
Anthropic now ships a native binary — no separately installed Node.js runtime or npm required. It's code-signed by Anthropic (notarized by Apple on macOS), and it auto-updates in the background.
Install it with one command:
curl -fsSL https://claude.ai/install.sh | bashThat's it. The binary lands at ~/.local/bin/claude. Make sure it's in your PATH:
export PATH="$HOME/.local/bin:$PATH"If you're coming from npm or Homebrew, uninstall the old version:
# From npm
npm uninstall -g @anthropic-ai/claude-code
# From Homebrew
brew uninstall claude-codeConfiguration, sessions and credentials are distinct. Credential storage depends on the platform and authentication method; do not assume everything lives under ~/.claude/. Preserve the relevant configuration and use the documented login flow when changing installations.
Why Native Wins
Auto-updates. Native installations check for updates in the background within the selected release channel, unless updating has been disabled. A downloaded update takes effect when Claude Code restarts. Use claude update to request an update, then confirm the installed version with claude --version.
The native installation does not require a separate Node.js runtime or npm. Older executables and version-manager shims can still take precedence in PATH; verify which command the shell selects.
The native distribution publishes SHA-256 checksums and GPG-signed manifests. Verify the applicable release using the official installation documentation; a checksum detects a mismatch, while signature verification depends on trusting the correct signing key.
Release channels. Choose latest (the default) for newly released versions, or stable for delayed adoption, typically about a week behind. The stable channel is intended to avoid releases with known major regressions; it does not guarantee that a release has no regressions.
The Alias
My update alias is now just:
alias cu="claude update"Though honestly, with auto-updates you barely need it.
The Gotcha: Ghost npm Still in PATH
If you previously installed via npm and then installed the native binary, you might still see this warning:
Claude Code has switched from npm to native installer. Run `claude install` or see https://docs.anthropic.com/en/docs/claude-code/getting-started for more options.First identify the executable and the package manager that owns it. A path under /opt/homebrew/bin does not by itself prove whether npm or Homebrew installed the command.
command -v claude
ls -l "$(command -v claude)"
npm list -g --depth=0
brew list --caskInspect the resolved executable and the installed package records before removing anything. The preceding inventory commands do not remove any installation.
# Only after confirming npm owns the obsolete installation:
npm uninstall -g @anthropic-ai/claude-code
# Re-check the command selected by the shell:
command -v claude
claude --versionIf npm owns the obsolete installation, remove that package with npm. If Homebrew owns it, use Homebrew’s documented uninstall procedure. Then confirm that command resolution selects the intended native installation.
The installation methods have different update and package-management trade-offs. The native installer supports background updates without a separate Node.js/npm toolchain. Choose the intended release channel, verify command resolution, and confirm the installed version after migration.
Reference: Claude Code setup and installation verification (documentation checked 20 September 2026).