Goal of this guide
By the end of this guide you will have Claude Code — Anthropic’s terminal-based AI coding agent — installed on macOS, Linux, or Windows, signed in, verified with claude doctor, and you will know how to update it and remove it cleanly.
The installation landscape changed since this guide was first published: the official setup docs now recommend a native installer that does not require Node.js at all. That is the method this guide leads with. npm is still supported, but as an advanced option.
Time-sensitive details in this guide are marked “As of the last test date (2026-07-26)”. Commands and requirements can change; the official setup page is the source of truth.
Requirements before you install
System requirements (Official requirement)
Per the official setup docs, Claude Code needs:
- macOS 13 or later
- Windows 10 version 1809 or later — natively, or inside WSL
- Ubuntu 20.04+, Debian 10+, or Alpine 3.19+ (or a comparable Linux distribution)
- 4 GB of RAM or more
Account requirement (Official requirement)
Claude Code is not part of the free Claude tier. You need one of:
- A paid Claude plan: Pro, Max, Team, or Enterprise, or
- A Claude Console account with API billing.
The first time you run claude, it opens a browser sign-in flow where you connect one of these accounts. If you only have a free Claude account, sign-in will not unlock Claude Code.
Which install method should you pick?
| Your situation | Recommended method |
|---|---|
| macOS, Linux, or WSL, no strong preference | Native installer (curl) |
| Windows 10 1809+ (native, not WSL) | Native installer (PowerShell) or WinGet |
| You already manage tools with Homebrew | brew install --cask claude-code |
| You already manage tools with WinGet | winget install Anthropic.ClaudeCode |
| You need npm-based management (e.g. scripted environments) | npm (requires Node.js 22+) |
The native installer avoids Node version issues and npm global-permission problems entirely, which is why the official docs recommend it.
Recommended: install with the native installer
macOS, Linux, or WSL
Run in your terminal:
curl -fsSL https://claude.ai/install.sh | bash
Windows (PowerShell)
Run in PowerShell:
irm https://claude.ai/install.ps1 | iex
Both commands download and run Anthropic’s native install script. After it finishes, open a new terminal window (or restart your terminal) so the claude command is picked up on your PATH, then skip ahead to Verify the installation.
Alternative install methods
Homebrew (macOS/Linux)
If you already use Homebrew:
brew install --cask claude-code
Note the --cask flag: Claude Code is distributed as a Homebrew cask, not a formula. Running brew install claude-code without --cask will not find it.
WinGet (Windows)
winget install Anthropic.ClaudeCode
npm (advanced option)
The npm package @anthropic-ai/claude-code is still published, but treat it as the advanced path:
- It requires Node.js 22 or later (per the package’s
enginesfield). Check withnode -v. - The package downloads the native binary — it is not a pure JavaScript install.
- The official docs warn against updating with
npm update -g; use the explicit@latestinstall command shown in the update section instead.
npm install -g @anthropic-ai/claude-code
If you hit an EACCES permission error here, do not reach for sudo — see Common errors below.
As of the last test date (2026-07-26), the latest version on npm was 2.1.220 (npm package page).
Verify the installation
Two checks, whichever method you used:
claude --version
This prints the installed version number. Then run the built-in environment check:
claude doctor
claude doctor inspects your installation and environment — install method, auto-update configuration, network reachability — and prints specific hints when something is wrong. Run it first whenever you hit sign-in, command, or network problems.
First run and sign-in
Enter a project folder and start a session:
cd my-first-website
claude
On first run, Claude Code prompts you to sign in. It opens a browser where you authorize the tool with your paid Claude plan or Console account, then returns you to the terminal session.
For your first prompt, ask it to look before it touches anything:
Read this project first. Tell me what framework it uses and where the main pages are. Do not modify any files yet.
Then give it one small, well-scoped task and review the diff it produces. If you want a full learning path after setup, continue with the local AI coding agents guide or build something small with the personal website tutorial.
How to update Claude Code
-
Native installer: updates automatically in the background. To force a check:
claude update -
Homebrew:
brew upgrade claude-code -
WinGet:
winget upgrade Anthropic.ClaudeCode -
npm: the docs warn against
npm update -gfor this package. Instead:npm install -g @anthropic-ai/claude-code@latest
How to uninstall Claude Code
Match the uninstall command to how you installed it.
Native installer (macOS/Linux/WSL):
rm -f ~/.local/bin/claude && rm -rf ~/.local/share/claude
Homebrew:
brew uninstall --cask claude-code
WinGet:
winget uninstall Anthropic.ClaudeCode
npm:
npm uninstall -g @anthropic-ai/claude-code
Optional — remove local configuration and history:
rm -rf ~/.claude ~/.claude.json
Risk note: this second step is destructive. It deletes your local Claude Code settings, sign-in state, and conversation history, and there is no undo. Only run it if you want a completely clean removal.
Common errors
EACCES or permission denied during npm install (npm method only)
This is npm’s global-directory permission problem, not a Claude Code bug. Do not fix it with sudo npm install -g — that installs packages as root and tends to create worse permission tangles later. The official npm docs recommend reinstalling Node.js via a version manager (such as nvm) or changing npm’s default global directory. Better still: switch to the native installer and skip npm entirely.
npm install fails with a Node version error
The npm package requires Node.js 22 or later. Check with node -v; if you are on an older major version, install a newer Node.js release, reopen the terminal, and retry. Or use the native installer, which has no Node dependency.
claude: command not found after installing
Two likely causes:
- Stale shell. The installer updated your
PATH, but your current terminal loaded before that. Open a new terminal window and retry. PATHis missing the install location. The native installer placesclaudein~/.local/bin. Confirm it exists withls ~/.local/bin/claude; if it does, add~/.local/binto your shell’sPATH(for example in~/.zshrcor~/.bashrc). For npm installs, check that npm’s global bin directory (npm bin -gon older npm,npm prefix -gplus/bin) is on yourPATH.
Run claude doctor after fixing either case.
Sign-in fails or the free plan does not work
Claude Code requires a paid plan (Pro, Max, Team, Enterprise) or a Console account — a free Claude account cannot activate it. If you have a paid plan and sign-in still fails, confirm your network can reach Claude’s services and run claude doctor for specific diagnostics.
Installed on Windows but claude does not run
Make sure you install and run in the same environment. If you installed via PowerShell/WinGet, run claude in PowerShell. If you installed inside WSL with the curl script, run it in the WSL terminal — the two environments do not share commands.
Safety notes: what Claude Code can do to your files
Claude Code is an agent, not a chat box. It can read, create, edit, and delete files in the folder where you run it, and it can execute shell commands. That is what makes it useful — and what makes permissions matter:
- Review before approving. Claude Code asks for approval before edits and commands by default. Read what it is about to do, especially destructive operations like
rmor large rewrites. - Scope it to a project folder. Run
claudeinside the project you are working on, not your home directory. - Use version control. Commit before letting an agent loose on a repo, so every change is reversible with
git diffandgit checkout. - Be careful with auto-accept modes. Loosening permission prompts speeds things up but removes your review step. Keep the default confirmations until you trust the workflow.
This read-then-act behavior is also why agent tooling connects to the broader Web4 picture: an agent that can act on your behalf needs clear permissions, confirmations, and auditability — the same properties that make a website safe for agents to act on in the three levels of an agent-ready website, a Learn Web4 framework. If you are weighing Claude Code against OpenAI’s terminal tool, see the Codex CLI installation guide.
Further reading
- Claude Code setup - Anthropic
- @anthropic-ai/claude-code - npm
- claude-code cask - Homebrew Formulae
- Resolving EACCES permissions errors when installing packages globally - npm Docs
FAQ
Is Claude Code free to use?
No. Claude Code requires a paid Claude plan (Pro, Max, Team, or Enterprise) or a Claude Console account with API billing. The free Claude plan does not include Claude Code.
Do I need Node.js to install Claude Code?
Not for the recommended native installer, which is a single curl or PowerShell command. You only need Node.js 22 or later if you choose the advanced npm installation method.
How do I update Claude Code?
Native installs update automatically, and you can force a check with claude update. Homebrew users run brew upgrade claude-code, WinGet users run winget upgrade Anthropic.ClaudeCode, and npm users should run npm install -g @anthropic-ai/claude-code@latest instead of npm update -g.
Changelog
- : Major update: the native installer is now the recommended method (no Node.js required); added paid-plan requirement, WinGet/Homebrew commands, update and uninstall steps, and version 2.1.220 test data.
- : Initial publication.