doyouknow.ai
Sign in

One Command Installs Claude Code

By , AI Implementation Coach · · 12 min read

Banner: One command installs Claude Code. Skip the stranger's script. Use Anthropic's own installer, then fix 'command not found' in a minute.

One command installs Claude Code.

You want to try Claude Code, and the first search result is a stranger's script. Skip it. Anthropic gives one command for Mac and Linux and one for Windows; run it, open a new terminal, type claude --version, and you're done.

If you only read this

  • To install Claude Code, use the command from Anthropic's docs, never a script from a forum.
  • Open a new terminal, then run claude --version.
  • "Command not found" means one folder is missing from your PATH.
  • The free Claude plan doesn't include Claude Code.

Below: the command for each system, how to check it worked, the one-line fix for "command not found", and why a whole team should pick one install method, not one each. Every command here is copied from Anthropic's setup page as of November 2026.

Setting up Claude Code for a whole team? Chat on WhatsApp and tell me what you use today. I'll tell you where I'd start.

Before you start: a paid plan and a terminal

Claude Code needs a paid Claude plan or a Claude Console account, which bills by use. Anthropic's setup page says it plainly: the free plan doesn't include Claude Code. The pricing page says it's in every paid plan and shows what each one costs today.

It runs on a recent macOS, Windows, or a common Linux like Ubuntu, Debian or Alpine, on Intel, AMD or ARM chips. You need an internet connection and a country where Anthropic offers its service. The exact versions are listed under system requirements.

You also need a terminal. On a Mac that's the Terminal app. On Windows it's PowerShell or CMD. If you'd rather not use a terminal at all, the desktop app runs Claude Code without one.

Install on Mac: one line in Terminal

Open Terminal and paste this:

curl -fsSL https://claude.ai/install.sh | bash

This is the native installer, and it's the one Anthropic recommends. It updates itself in the background, so you stay on the latest version without doing anything. The command shows no progress while it downloads, so give it a moment.

If your company installs everything through Homebrew, there's a cask for that:

brew install --cask claude-code

The catch: a Homebrew install doesn't update itself. You run brew upgrade claude-code yourself, or you fall behind on fixes. The claude-code cask also follows a slower, steadier release channel than the native installer.

Install on Windows: no admin rights, no WSL needed

Claude Code runs natively on Windows. You don't need to run as Administrator, and you don't need WSL.

First, check which shell you're in. In PowerShell your prompt starts with PS C:\. In CMD it starts with C:\ and no PS.

In PowerShell:

irm https://claude.ai/install.ps1 | iex

In CMD:

curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd

Ran the wrong one? The error tells you. 'irm' is not recognized means you're in CMD. The token '&&' is not a valid statement separator means you're in PowerShell.

Anthropic also suggests Git for Windows. It's optional: with it, Claude Code uses Git Bash to run commands; without it, it uses PowerShell.

If your IT team manages software centrally, WinGet is the managed option:

winget install Anthropic.ClaudeCode

Like Homebrew, it doesn't update itself. Run winget upgrade Anthropic.ClaudeCode from time to time.

Install on Linux and WSL: the same line

On Linux, it's the same command as on a Mac:

curl -fsSL https://claude.ai/install.sh | bash

On Windows with WSL, run that line inside your WSL terminal, not in PowerShell or CMD. You install and start claude inside WSL. Pick WSL if your projects use Linux tools, or if you want Claude Code's sandbox, which native Windows doesn't support.

Alpine is the one exception: it doesn't ship with bash or curl, so install those first. The Alpine section lists the packages.

If your servers get software through apt, dnf or apk, Anthropic publishes signed repositories for each. The setup takes a few lines and a key check, so follow Anthropic's package manager steps rather than a copy here. These installs update with your normal system upgrades, not by themselves.

Check it worked, then sign in

Close the terminal and open a new one. A window that was open during the install still has the old settings. Then run:

claude --version

A working install prints a version number. That's it.

Now go to a project and start Claude Code:

cd /path/to/your/project
claude

The first time, Claude Code asks you to log in. Follow the prompts in your browser, and you won't have to log in again on that machine. The quickstart walks through your first session from there.

Want to see the whole thing in action first? I covered what a coding agent costs to run, and where the money goes, in how to cut coding agent costs.

Installed it, and now you're wondering how to roll it out to the team? Chat on WhatsApp. That's the part I help with.

The fix for 'command not found'

Got "command not found"? One folder is missing from your PATH.

The installer puts claude in ~/.local/bin on Mac and Linux, or %USERPROFILE%\.local\bin on Windows. If your shell doesn't look in that folder, it can't find claude, even though the install worked. The installer even says so in its output, but it doesn't change your PATH for you. You fix it once, and it stays fixed.

On a Mac (Zsh, the default):

echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc

On Linux (Bash, the default on most systems):

echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc

In Windows PowerShell:

$currentPath = [Environment]::GetEnvironmentVariable('PATH', 'User')
[Environment]::SetEnvironmentVariable('PATH', "$currentPath;$env:USERPROFILE\.local\bin", 'User')

Then open a new terminal and run claude --version again. Using a terminal inside your editor? Quit and reopen the editor too; it keeps the PATH it started with. In CMD, or for Bash on a Mac, Anthropic's PATH steps cover each case.

Three other errors come up often, and Anthropic's troubleshooting page has a fix for each:

  • Two installs fighting. An old npm install and a new native one can give you the wrong version. Run which -a claude (Mac and Linux) or where.exe claude (Windows) to see every copy, and keep only one.
  • The script comes back as a web page. An error like syntax error near unexpected token '<' means the download returned a page, not the script. Wait a few minutes and retry. If it keeps failing, use Homebrew or WinGet instead, or check your network: a company proxy can block it, and the page may say Claude Code isn't offered in your country.
  • npm permission errors. Never fix these with sudo. Switch to the native installer above, which doesn't need it.

Claude Code also works inside your editor. Each option has one detail that trips people up.

  • VS Code and Cursor. Use the "Install for VS Code" or "Install for Cursor" link on Anthropic's VS Code page, so you get the listing Anthropic publishes, not a lookalike. The extension carries its own copy of Claude Code for its chat panel. To run claude in the editor's terminal, you still need the install above.
  • JetBrains (IntelliJ IDEA, PyCharm, WebStorm and others). The JetBrains plugin runs the claude command in the editor's terminal, so install Claude Code first, then the plugin.
  • The desktop app. No terminal, no editor. Download it from Anthropic's desktop page.

One warning. On 29 October, Cursor posted a security notice: for part of that day, a tampered copy of the Claude Code extension sat in Cursor's extension marketplace, and it tried to open a backdoor on Mac and Windows machines. Cursor removed it the same day. Anthropic's own docs note that it doesn't maintain or audit the extension marketplaces. So install from Anthropic's link, never from a link in a forum or a video, and if you installed or updated the extension in Cursor on 29 October, run the check in Cursor's notice.

Update and uninstall

How to update Claude Code. The native install updates itself. To update right now, run:

claude update

Package-manager installs don't update themselves. Use the command for the one you chose:

  • Homebrew: brew upgrade claude-code
  • WinGet: winget upgrade Anthropic.ClaudeCode
  • npm: npm install -g @anthropic-ai/claude-code@latest
  • apt, dnf, apk: your normal system upgrade, as in Anthropic's update section

To uninstall Claude Code, use the same method you used to install it. For the native install on Mac, Linux or WSL:

rm -f ~/.local/bin/claude
rm -rf ~/.local/share/claude

On Windows, in PowerShell:

Remove-Item -Path "$env:USERPROFILE\.local\bin\claude.exe" -Force
Remove-Item -Path "$env:USERPROFILE\.local\share\claude" -Recurse -Force

For Homebrew it's brew uninstall --cask claude-code, for WinGet winget uninstall Anthropic.ClaudeCode, and for npm npm uninstall -g @anthropic-ai/claude-code.

Your settings and session history live in ~/.claude (and the file ~/.claude.json). Uninstalling the program doesn't remove them. Deleting them wipes your settings for good, and the editor extensions and desktop app create the folder again if they're still installed. Anthropic's uninstall steps cover the full clean-up.

My take: one install method for the whole team

Use the native installer, unless your company manages software centrally. It's the one Anthropic recommends, it updates itself, and it needs no admin rights. If IT installs everything through Homebrew or WinGet, use that, and put the upgrade command on someone's list.

What I'd avoid is a team where everyone did it their own way. One person on npm, one on Homebrew, one on the native installer, each on a different version. When something breaks, you spend the first hour finding out which copy is running.

So write it down: one install method, one command, one place to check when it fails. Then share one CLAUDE.md file in your project, the instructions file Claude Code reads at the start of every session, with your build and test commands in it. Everyone's Claude Code then starts from the same facts. That's the step that saves money later; I showed why in how to cut coding agent costs.

Who should install it today: anyone with a paid Claude plan who writes code. Who should wait: if you're still choosing between AI assistants, read Claude vs ChatGPT first.

In 20 years in product, development and automation, I've seen the same thing with every new tool. The install takes a minute. Getting a whole team to use it the same way is the real task.

Rolling out Claude Code to your team?

I help small software teams set up coding agents: one install method, shared instructions, and the habits that keep the bill down. Start with a consulting session, or have me set it up with your team through implementation.

Training a developer team? See AI coaching and training. Questions first? Chat on WhatsApp.

FAQ

Is Claude Code free?

No. Claude Code needs a paid Claude plan or a Claude Console account, which bills by use. The free plan doesn't include it. Plans and prices change, so check Claude's pricing page for what each includes today.

Can I install Claude Code on Windows without WSL?

Yes. Claude Code runs natively on Windows. Run irm https://claude.ai/install.ps1 | iex in PowerShell, or the CMD command above. You don't need admin rights. WSL is only worth it if your projects use Linux tools or you want Claude Code's sandbox.

Should I install Claude Code with npm?

Only if you have a reason to. npm still works (npm install -g @anthropic-ai/claude-code) and installs the same program as the native installer. But the native installer is the one Anthropic recommends, and it doesn't need Node.js. Never use sudo with npm: it causes permission errors and blocks automatic updates.

How do I update Claude Code?

The native install updates itself in the background. To update now, run claude update. Homebrew, WinGet and Linux package installs don't update themselves: run brew upgrade claude-code, winget upgrade Anthropic.ClaudeCode, or your system's normal upgrade.

How do I install Claude Code for free?

You can't use it on the free Claude plan. You need a paid plan or a Claude Console account, which bills by use. The install itself costs nothing: the command is the same whichever plan you have. See Claude's pricing page for today's plans.

Khalil Kothia, AI Implementation Coach

Written by

Khalil Kothia

AI Implementation Coach

Khalil Kothia is an AI Implementation Coach who has spent 20 years building technology and now helps businesses put AI to work.

More about Khalil · LinkedIn

← All posts