To install Claude Code, you run one command in your terminal: a short curl line on macOS and Linux, or an irm line in Windows PowerShell. The command itself is the easy part. Most people get stuck straight after it, when typing claude returns “command not found” or “not recognized.” This guide covers every install method Anthropic supports and the first login. It then goes through the errors people hit most, with the exact message you will see and the fix for each.
We worked through this guide on a Windows 11 PC running Claude Code 2.1.314, the current release as of October 31, 2026. We ran the diagnostic commands ourselves and reproduced the common “not found” and wrong-shell errors in PowerShell, Command Prompt, and Git Bash, so the messages quoted below are copied from a real terminal. The macOS and Linux commands come from Anthropic’s setup documentation.

The quick version
Open a terminal and run the line for your system, then open a new terminal window and run claude --version.
macOS, Linux, WSL: curl -fsSL https://claude.ai/install.sh | bash
Windows PowerShell: irm https://claude.ai/install.ps1 | iex
Windows CMD: curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
What you need before you install Claude Code
Claude Code is light on requirements. You do not need Node.js for the recommended installer, and you do not need administrator rights on Windows. The one requirement that catches people out is the account: the free Claude plan does not include Claude Code.
| Requirement | Details |
|---|---|
| Operating system | macOS 13 or later, Windows 10 (1809) or later, Windows Server 2019 or later, Ubuntu 20.04+, Debian 10+, Alpine 3.19+ |
| Memory | 4 GB of RAM or more. The installer alone needs about 512 MB free. |
| Processor | x64 or ARM64. 32-bit Windows is not supported. |
| Shell | Bash, Zsh, PowerShell, or CMD |
| Node.js | Only for the npm method, which needs Node 22 or later |
| Account | Claude Pro ($20 a month, or $17 billed annually), Max, Ultra, Team, Enterprise, or an Anthropic Console account with API credit. Amazon Bedrock, Google Cloud, and Microsoft Foundry also work. |
Which install method should you use?
There are six ways to install Claude Code. They all put the same native program on your machine. The real difference is how each one handles updates.
| Method | Platforms | Updates | Best for |
|---|---|---|---|
| Native installer (recommended) | macOS, Linux, WSL, Windows | Automatic, in the background | Almost everyone |
| Homebrew | macOS | Manual: brew upgrade |
People who manage every tool through brew |
| WinGet | Windows | Manual: winget upgrade |
Managed Windows machines, or when the script is blocked |
| apt, dnf, apk | Debian/Ubuntu, Fedora/RHEL, Alpine | With your normal system upgrades | Servers and shared Linux boxes |
| npm | Any supported platform with Node 22+ | Automatic if the npm folder is writable | Teams that already pin tools through npm |
| Desktop app | macOS, Windows, Linux | Automatic | People who would rather not use a terminal at all |
Pick the native installer unless you have a specific reason not to. Auto-updates alone make it worth it, because new versions come out often.
How to install Claude Code on macOS and Linux
Open Terminal (or any terminal app) and run:
curl -fsSL https://claude.ai/install.sh | bash
The installer shows no progress bar while it downloads, so give it a minute. It puts a claude launcher in ~/.local/bin and keeps the actual versions in ~/.local/share/claude/versions/. When it finishes, close the terminal, open a new one, and check the install:
claude --version
A working install prints a version number followed by “(Claude Code).” If you get zsh: command not found: claude instead, jump to the command not found fix below. It takes about a minute.
Install Claude Code with Homebrew
Homebrew has two casks. claude-code follows the stable channel, which runs about a week behind and skips releases with major regressions. claude-code@latest gets each release the day it ships.
brew install --cask claude-code
Homebrew installs do not update themselves, so run brew upgrade claude-code every so often, followed by brew cleanup to clear out old versions.
Install with apt, dnf, or apk
Anthropic also runs signed package repositories for Debian and Ubuntu, Fedora and RHEL, and Alpine. They take a few more steps because you add a signing key and a repository first, and the exact commands are in Anthropic’s setup docs. On Alpine and other musl-based distributions, install bash, curl, libgcc, libstdc++, and ripgrep before running the normal installer, because Alpine does not ship bash or curl by default.
How to install Claude Code on Windows
Claude Code runs natively on Windows, so WSL is optional. The one thing to get right is which window you are typing in, because PowerShell and Command Prompt need different commands. Look at your prompt. If it starts with PS C:\, you are in PowerShell. If it shows C:\ with no PS, you are in CMD.
In PowerShell:
irm https://claude.ai/install.ps1 | iex
In Command Prompt:
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
Or with WinGet, from either shell:
winget install Anthropic.ClaudeCode
The native installer puts claude.exe in %USERPROFILE%\.local\bin. You do not need to run it as Administrator. When it finishes, open a fresh terminal and run claude --version.
Should you install Git for Windows?
It is optional but worth having. With Git for Windows installed, Claude Code can run commands through Git Bash, which matters because a lot of project scripts and documentation assume a Bash shell. Without it, Claude Code falls back to PowerShell. If you install Git somewhere unusual and Claude Code cannot find it, point the CLAUDE_CODE_GIT_BASH_PATH setting at your bash.exe.
Native Windows or WSL?
| Native Windows | WSL 2 | WSL 1 | |
|---|---|---|---|
| Setup | Nothing extra | WSL 2 enabled | WSL 1 enabled |
| Sandboxed commands | Not supported | Supported | Not supported |
| Use it when | Your projects and tools live on Windows | You work with Linux toolchains or want sandboxing | WSL 2 is not available to you |
To use WSL, open your Linux distribution and run the macOS and Linux command above inside it. Install and launch claude from the WSL terminal, not from PowerShell.
Install Claude Code with npm
The npm package used to be the main way to install Claude Code, and plenty of older tutorials still lead with it. It still works:
npm install -g @anthropic-ai/claude-code
Under the hood it downloads the same native binary as the installer, so performance is identical. Our test machine still runs an npm install from before the native installer existed, which made it useful for this guide. It sits in AppData\Roaming\npm rather than .local\bin, and it took 288 MB of disk. Three rules keep npm installs healthy:
- Never use
sudo npm install -g. Claude Code updates itself without sudo, so a sudo install can never auto-update. - Upgrade with
npm install -g @anthropic-ai/claude-code@latest, notnpm update -g, which can leave you on an old release. - On npm 12, the post-install step is skipped by default. The result is
Error: claude native binary not installed. Switching to the native installer is the simplest fix.
If you are already on npm and want to move to the native installer, run the native install command for your system, then remove the npm copy with npm uninstall -g @anthropic-ai/claude-code. Keeping both installed causes version confusion, which we cover further down.
Check that the install worked
Two commands tell you everything. The first is the quick check:
claude --version
The second is claude doctor, which runs read-only checks without starting a session. It took 1.5 seconds on our machine and printed this (trimmed slightly):
Claude Code doctor
Running: npm-global (2.1.314)
Platform: win32-x64
Path: C:\Users\...\npm\node_modules\@anthropic-ai\claude-code\bin\claude.exe
Search: OK (bundled)
Auto-updates: disabled (set by env: DISABLE_AUTOUPDATER)
Auto-update channel: latest
Last update attempt: success → 2.1.314 (2026-10-30)
No installation issues found.
The lines worth reading are Running, which tells you how Claude Code was installed, Path, which tells you which copy actually runs, and Auto-updates. If something is wrong, doctor lists it with a suggested fix underneath.
Log in for the first time
Go to the folder of a project you want to work on and type claude. The first launch opens your browser to sign in. Choose your Claude account for a Pro, Max, Ultra, Team, or Enterprise plan, or your Console account if you pay per token through the API. After you approve it, the terminal picks up the login and you are in.
A few things can go wrong here:
- The browser does not open. Press
cat the login prompt to copy the sign-in link, then paste it into a browser yourself. - You are on WSL, SSH, or inside a container. The browser may try to return to a
localhostaddress it cannot reach. Open the copied link on your own machine and sign in. The page then shows a code. Paste that code into the terminal at the “Paste code here” prompt. If pasting does nothing, runclaude auth logininstead, which reads the code from standard input. - “OAuth error: Invalid code.” The code expired or got cut off while copying. Press Enter to retry and paste the full code promptly.
- Login keeps expiring. Check that your system clock is correct, because token checks depend on it. Running
/logout, closing Claude Code, and signing in again clears most stubborn login problems.
How to fix “claude: command not found”
This is the most common problem after you install Claude Code, and it nearly always means the same thing. The program installed fine, but the folder it lives in is not on your PATH, the list of folders your shell searches when you type a command. Here is what the error looks like in each shell. We reproduced the Bash, PowerShell, and Command Prompt versions by starting a shell with Claude Code’s folder taken off the PATH. The Zsh wording comes from Anthropic’s docs.
| Shell | What you see |
|---|---|
| Zsh (macOS default) | zsh: command not found: claude |
| Bash (Linux, Git Bash) | bash: claude: command not found |
| PowerShell | claude : The term 'claude' is not recognized as the name of a cmdlet, function, script file, or operable program. |
| Command Prompt | 'claude' is not recognized as an internal or external command, operable program or batch file. |
Step 1: open a new terminal
Do this before anything else. A terminal window keeps the PATH it had when it opened, so the window you installed from will not see the new folder. Close it and open a fresh one. If your terminal is inside VS Code or another editor, quit the whole editor and reopen it, because the built-in terminal inherits the editor’s PATH.
Step 2: check that Claude Code is actually there
# macOS and Linux
ls -la ~/.local/bin/claude
# Windows PowerShell
Test-Path "$env:USERPROFILE\.local\bin\claude.exe"
If the file is missing (No such file or directory, or False in PowerShell), the native install did not happen or you installed some other way. Run which -a claude on macOS or Linux, or where.exe claude on Windows, to see whether a copy exists anywhere else. On our machine, Test-Path printed False while where.exe claude pointed at the npm folder, which is the expected result for an npm install.
Step 3: add the folder to your PATH
If the file exists, add its folder to your PATH once and the fix sticks. Use the block that matches your shell.
# Zsh (the default on macOS)
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
# Bash on Linux
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
# Bash on macOS (Terminal reads .bash_profile, not .bashrc)
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bash_profile
source ~/.bash_profile
On Windows, run these two lines in PowerShell, then open a new terminal:
$currentPath = [Environment]::GetEnvironmentVariable('PATH', 'User')
[Environment]::SetEnvironmentVariable('PATH', "$currentPath;$env:USERPROFILE\.local\bin", 'User')
If you prefer clicking, search the Start menu for “environment variables,” edit the Path entry under your user variables, and add %USERPROFILE%\.local\bin.
Installed the VS Code extension and still get “not found”?
The Claude Code extension for VS Code bundles its own private copy of the program for its chat panel. That copy is not added to your PATH, so claude will not work in a terminal until you also run the normal install command.
Still not found?
- The line went into the wrong file. Run
echo $0to see which shell you are really using, then repeat Step 3 for that shell. Fish and Nushell users need their own PATH syntax. - The line was never saved. Run
grep -n '.local/bin' ~/.zshrc(or your shell’s file). No output means try Step 3 again. - “permission denied” on your
.zshrcor.bashrc. Runls -l ~/.zshrc. If another user such as root owns it, runsudo chown $(whoami) ~/.zshrc. If you own it, runchmod u+w ~/.zshrc. - It broke right after an update on Windows. While updating, Claude Code renames the old
claude.exeto a backup namedclaude.exe.old.plus a timestamp. If the update stops partway, the backup is all that is left. The command below renames the newest backup back. If there is no backup, rerun the installer.
Get-ChildItem "$env:USERPROFILE\.local\bin\claude.exe.old.*" | Sort-Object Name | Select-Object -Last 1 | Rename-Item -NewName claude.exe
Other Claude Code install errors and how to fix them
The table below covers the errors people run into most often. We reproduced the first three on purpose by running each install command in the wrong shell. They are the easiest mistakes to make on Windows.
| Error | What it means | Fix |
|---|---|---|
'irm' is not recognized as an internal or external command |
You ran the PowerShell command in CMD | Open PowerShell, or use the CMD install command |
Invoke-WebRequest : A parameter cannot be found that matches parameter name 'fsSL' |
You ran the macOS/Linux command in PowerShell, where curl is an alias for a different command |
Use irm https://claude.ai/install.ps1 | iex |
The token '&&' is not a valid statement separator |
You ran the CMD command in Windows PowerShell | Use the PowerShell command |
syntax error near unexpected token '<', or a 403 |
The install link returned a web page or was blocked, often by a proxy or because you are outside a supported country | Wait and retry, check your proxy settings, or install with Homebrew or WinGet |
running scripts is disabled on this system |
PowerShell is blocking npm’s .ps1 launchers |
Run Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser, or use the native installer instead |
Claude Code does not support 32-bit Windows |
You opened “Windows PowerShell (x86)” from the Start menu | Open the entry without “(x86)” and run the install again |
The process cannot access the file ... being used by another process |
A second installer or an antivirus scan is holding the download | Close other installer windows, delete %USERPROFILE%\.claude\downloads, rerun |
Killed during install on Linux |
The server ran out of memory (the installer needs about 512 MB free) | Add a 2 GB swap file or use a bigger instance |
EACCES: permission denied |
The install folder is not writable by your user | Fix ownership of ~/.local, or move off a sudo npm install |
Error: claude native binary not installed |
npm skipped the post-install step (npm 12, --ignore-scripts, or --omit=optional) |
Switch to the native installer, or allow the script and reinstall |
npm error code ENOTEMPTY |
A half-finished npm update left a folder behind | Delete the folder the error names, then reinstall |
cannot execute binary file: Exec format error in WSL |
You are on WSL 1 | Convert the distro: wsl --set-version <DistroName> 2 |
Illegal instruction |
Wrong CPU architecture, or an older CPU (or VM) without AVX | Check uname -m. There is no workaround for missing AVX. |
Typing claude opens the desktop app |
An old Claude Desktop build registered its own claude command on Windows |
Update Claude Desktop |
Check for duplicate installs
If you have installed Claude Code more than once over the years, say with npm first and the native installer later, you can end up running an old version without realizing it. Your shell runs whichever copy it finds first on the PATH. List them all:
# macOS and Linux
which -a claude
# Windows
where.exe claude
Keep one copy. The native install is the one Anthropic recommends. Remove the extras with npm uninstall -g @anthropic-ai/claude-code, brew uninstall --cask claude-code, or winget uninstall Anthropic.ClaudeCode. Very old versions also left a local npm copy in ~/.claude/local, which you can delete.
How to update Claude Code
Native installs update themselves. Claude Code checks for a new version when it starts and while it runs, downloads it in the background, and switches over the next time you launch it. To update right now:
claude update
Homebrew, WinGet, and Linux package installs need their own upgrade command:
| Installed with | Update command |
|---|---|
| Native installer | Automatic, or claude update |
| Homebrew | brew upgrade claude-code |
| WinGet | winget upgrade Anthropic.ClaudeCode |
| apt | sudo apt update && sudo apt upgrade claude-code |
| dnf | sudo dnf upgrade claude-code |
| npm | npm install -g @anthropic-ai/claude-code@latest |
Two settings are worth knowing. Setting "autoUpdatesChannel": "stable" in your settings.json keeps you on a build that is about a week old and skips releases with known regressions, which suits anyone who would rather not be first to find a bug. Adding "DISABLE_AUTOUPDATER": "1" under env stops background updates entirely. Our test machine has it switched on, as the doctor output above shows, and gets updated by hand. If you see a red “Auto-update failed” line in the session footer, you can keep working. Run claude update in your shell to finish the update or see the actual error.
How to uninstall Claude Code
Remove it the same way you installed it. For a native install:
# macOS, Linux, WSL
rm -f ~/.local/bin/claude
rm -rf ~/.local/share/claude
# Windows PowerShell
Remove-Item -Path "$env:USERPROFILE\.local\bin\claude.exe" -Force
Remove-Item -Path "$env:USERPROFILE\.local\share\claude" -Recurse -Force
For the others, use brew uninstall --cask claude-code, winget uninstall Anthropic.ClaudeCode, or npm uninstall -g @anthropic-ai/claude-code. Your settings, MCP server configuration, and session history live separately in ~/.claude and ~/.claude.json. Leave them if you might reinstall. Delete them only if you want a clean slate, and uninstall the VS Code extension, JetBrains plugin, and desktop app first, because each of those recreates the folder.
What to do after you install Claude Code
Once claude --version works and you are logged in, three things make the biggest difference in your first week:
- Run
/initin your project. Claude Code reads your codebase and writes aCLAUDE.mdfile with the build commands and conventions it found. Edit it, because it is the context Claude Code reads at the start of every session. - Connect the tools you already use. MCP servers let Claude Code read from GitHub, databases, docs, and more. Our guide to what an MCP server is explains the idea, and our list of the best MCP servers is a good place to start.
- Compare it with what else is out there. If you are still deciding on a tool, see how it held up against the open source alternative in our OpenCode vs Claude Code test, read our Claude Code vs Cursor comparison, or browse the full list of AI coding assistants.
Frequently asked questions
Is Claude Code free to install?
Installing it is free, but using it needs a paid plan or API credit. Claude Code is included with Claude Pro, which costs $20 a month ($17 a month billed annually), and with Max, Ultra, Team, and Enterprise plans. The free Claude plan does not include it. You can also pay per token through an Anthropic Console account.
Do I need Node.js to install Claude Code?
No. The native installer, Homebrew, WinGet, and the Linux package repositories do not use Node.js at all. You only need Node 22 or later if you choose to install through npm.
Can I install Claude Code on Windows without WSL?
Yes. Run irm https://claude.ai/install.ps1 | iex in PowerShell or winget install Anthropic.ClaudeCode. Native Windows covers most work. WSL 2 adds sandboxed command execution and suits projects built around Linux toolchains.
Do I need admin rights to install Claude Code?
No. On Windows the installer writes to your user folder, and on macOS and Linux it writes to ~/.local. Avoid installing with sudo, because a sudo install cannot update itself later.
Why does the install command show nothing while it runs?
The installer does not print progress while it downloads the program, so a quiet minute is normal. If it fails, it prints an error, and the table above covers the common ones.
How do I install a specific version of Claude Code?
Pass the version number to the installer. On macOS and Linux, run curl -fsSL https://claude.ai/install.sh | bash -s 2.1.89, replacing the number with the version you want. You can pass stable the same way to follow the stable channel.
Why does “claude” work in one terminal but not another?
Each terminal has its own PATH, set when it opened. A window opened before the install, or a terminal built into an editor that has not been restarted, will not see the new folder. Close it and open a new one, or restart the editor.
The bottom line
For most people, installing Claude Code takes one command and under a minute. Use the native installer, open a new terminal, and run claude --version. If it prints a version, run claude in a project folder and sign in. If it says “command not found,” the program is almost certainly installed but not on your PATH. Open a new terminal first, then add ~/.local/bin (or %USERPROFILE%\.local\bin on Windows) to your PATH. That clears most install problems. For anything stranger, claude doctor usually names the cause.
Ben has spent years helping teams choose and roll out the right software, and started The Software Scout to share what he’s learned. He focuses on real-world usability, honest pricing breakdowns, and the details vendors gloss over, covering productivity, project management, marketing, and finance tools. His goal is simple: help you buy the right software the first time.