DEV Community

Cover image for How to Install Claude Code the Right Way in 2026
Vanja Petreski
Vanja Petreski

Posted on • Originally published at vanja.io

How to Install Claude Code the Right Way in 2026

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.

The problem: Homebrew wraps Claude Code as a cask. Someone has to update the formula after each release, then it goes through review. There's always a delay — sometimes hours, sometimes days.


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"
Enter fullscreen mode Exit fullscreen mode

This worked well — until I noticed a yellow banner in my terminal telling me npm installation is deprecated.


The Native Installer: The Right Way

Anthropic now ships a native binary — no Node.js required, no npm, no dependency chain. 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 | bash
Enter fullscreen mode Exit fullscreen mode

That's it. The binary lands at ~/.local/bin/claude. Make sure it's in your PATH:

export PATH="$HOME/.local/bin:$PATH"
Enter fullscreen mode Exit fullscreen mode

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-code
Enter fullscreen mode Exit fullscreen mode

Auth tokens live in ~/.claude/, completely independent of the install method. No re-authentication. You pick up right where you left off.


Why Native Wins

Auto-updates. Claude Code updates itself in the background. No manual brew upgrade or npm update. You always have the latest version. If you want to trigger an update manually: claude update.

Zero dependencies. No Node.js. No npm. No version manager conflicts with nvm, asdf, or fnm intercepting your PATH.

Code-signed. The binary is signed by Anthropic and notarized by Apple. Integrity verification via GPG-signed manifests with SHA256 checksums.

Release channels. Choose latest (default, immediate updates) or stable (roughly one week behind, skips regressions).


The Alias

My update alias is now just:

alias cu="claude update"
Enter fullscreen mode Exit fullscreen mode

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.
Enter fullscreen mode Exit fullscreen mode

This means the old npm binary is still in your PATH and taking precedence over the native one. Check with:

which -a claude
Enter fullscreen mode Exit fullscreen mode

If you see /opt/homebrew/bin/claude (npm) above ~/.local/bin/claude (native), the stale npm version is winning. The fix:

npm uninstall -g @anthropic-ai/claude-code
Enter fullscreen mode Exit fullscreen mode

After that, which claude should resolve to ~/.local/bin/claude and the warning disappears.


Three install methods, three different trade-offs. Homebrew lags behind. npm works but is deprecated. The native installer auto-updates, has zero dependencies, and is the only one Anthropic actively recommends. Switch once, stop thinking about it.


Originally published at vanja.io

Top comments (0)