Claude Code & Terminal AI

How to Install Claude Code: Step-by-Step Guide for Every Platform (2026)

Install Claude Code on macOS, Windows or Linux with Anthropic's official commands: the native installer, Homebrew, WinGet, Linux package managers and npm, plus sign-in, first steps and fixes for common errors.

By Published Updated

Claude Code installs with one command from Anthropic's native installer: curl -fsSL https://claude.ai/install.sh | bash on macOS, Linux and WSL, or irm https://claude.ai/install.ps1 | iex in Windows PowerShell. Homebrew, WinGet and npm also work, though Homebrew and WinGet installs do not update themselves. You need Claude Pro or a higher plan, or a Console account.

Claude Code is Anthropic's coding tool for the terminal. It reads a project, edits files, runs commands and works with git, all from a chat in your terminal. On most machines it installs with one command. Every command below is copied from Anthropic's own docs as they stood on November 1, 2026. Install commands do change, so if one fails, check the pages listed under Sources.

Before you install

You need three things.

  • A Claude plan that includes Claude Code. Anthropic lists Pro, Max, Ultra, Team, Enterprise and Console accounts. The free Claude plan does not include Claude Code. Pro costs $20 a month billed monthly, or $17 a month with annual billing ($200 up front).
  • A supported computer: macOS 13.0 or later, Windows 10 1809 or later (or Windows Server 2019 or later), Ubuntu 20.04+, Debian 10+ or Alpine Linux 3.19+. Anthropic asks for 4 GB of RAM or more and an x64 or ARM64 processor.
  • An internet connection and a shell. Bash, Zsh, PowerShell and CMD all work.

Node.js is not on Anthropic's list of requirements. It only matters if you install through npm, which needs Node.js 22 or later.

If the terminal is new to you, Anthropic also makes a desktop app for macOS, Windows and Linux. It includes Claude Code, so you sign in, open the Code tab and skip the command line. It also needs a paid plan.

Install on macOS, Linux or WSL

Open Terminal and run:

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

The command shows no progress while it downloads. When it finishes, open a new terminal window and check the install:

claude --version

A working install prints a version number followed by "(Claude Code)". Installs from this native installer update themselves in the background.

Install on Windows

Windows has two command shells, and each one has its own install command. Your prompt starts with PS C:\ in PowerShell and C:\ in CMD.

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

You do not need to run either one as Administrator. Anthropic recommends installing Git for Windows as well, so Claude Code can use Git Bash for shell commands. Without it, Claude Code runs commands through PowerShell.

You can also install inside WSL. Open your WSL distribution and run the macOS and Linux command there, then launch claude from the WSL terminal. Sandboxed command execution works in WSL 2 and is not supported on native Windows.

Other ways to install

Homebrew

brew install --cask claude-code

The claude-code cask follows the stable channel, which usually runs about a week behind and skips releases with major regressions. The claude-code@latest cask gets each release as soon as it is out. Homebrew installs do not update themselves, so run brew upgrade claude-code from time to time.

WinGet (Windows)

winget install Anthropic.ClaudeCode

WinGet installs do not update themselves either. Run winget upgrade Anthropic.ClaudeCode periodically.

Linux package managers

Anthropic publishes signed apt, dnf and apk repositories for Debian, Ubuntu, Fedora, RHEL and Alpine. Setup means adding a signing key and a repository line, so copy those steps from the setup page instead of retyping them. Updates then arrive with your normal system upgrades.

npm

npm install -g @anthropic-ai/claude-code

This route needs Node.js 22 or later. Do not run it with sudo. To upgrade later, run npm install -g @anthropic-ai/claude-code@latest. Anthropic advises against npm update -g, which may leave you short of the newest release.

Sign in and run your first session

  1. Open a terminal in the folder of a project you want to work on, for example cd /path/to/your/project.
  2. Type claude and press Enter.
  3. On first use, Claude Code asks you to log in. Follow the prompts to finish in your browser. Your credentials are stored, so you only do this once.
  4. Ask a question about the project, such as "what does this project do?" or "explain the folder structure".
  5. Ask for one small change and read the diff it shows you before you approve it.

If an ANTHROPIC_API_KEY environment variable is set on your machine, Claude Code asks whether to use that key, and if you approve it, Claude Code uses the key instead of your subscription. Anthropic's troubleshooting page names an old key from a previous job or project, left in a shell profile, as a common cause of the error "This organization has been disabled". Remove the variable if you meant to use your plan.

A few commands to know inside a session: /help lists commands, /clear clears the conversation, /exit quits, and Shift+Tab switches the permission mode, which sets what Claude Code may do without asking you first.

First steps that pay off

Run /init inside your project. It analyzes the codebase and writes a starting CLAUDE.md file with the build commands, test instructions and conventions it finds. If a CLAUDE.md already exists, /init suggests improvements instead of overwriting it.

CLAUDE.md is a markdown file at the project root that Claude Code reads at the start of every session. Put in it what a new team member would need: how to build and test, coding standards, naming rules, and anything Claude Code would not work out from the code itself. Anthropic's docs note that the more specific and concise the instructions, the more consistently Claude follows them.

Claude Code works with git directly. Once you are happy with a change, ask it to commit, and it stages the files and writes the commit message.

Fix common install problems

If you see command not found: claude or 'claude' is not recognized, open a new terminal window first. If it still fails, the install folder is not on your PATH. The installer puts claude in ~/.local/bin on macOS and Linux and in %USERPROFILE%\.local\bin on Windows. For Zsh, the macOS default, add the folder with:

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

For Bash on Linux, use ~/.bashrc in place of ~/.zshrc in both lines.

A syntax error near unexpected token '<', or a 403 during install, means the command downloaded a web page instead of the install script. Anthropic's troubleshooting page matches each of these errors to a fix and lists other ways to install.

'irm' is not recognized or The token '&&' is not a valid statement separator means you ran the command meant for the other Windows shell. irm belongs in PowerShell, and the curl ... install.cmd line belongs in CMD.

For a 403 error after logging in on Pro, Max or Ultra, check that your subscription is active at claude.ai/settings. On a Console account, an admin has to give you the Claude Code or Developer role.

If login fails for no clear reason, run /logout, close Claude Code, start it again with claude and sign in again. If the browser does not open, press c to copy the login link and paste it into a browser yourself.

For a fuller check, run claude doctor from your shell. It prints install health, settings errors and warnings with suggested fixes, without starting a session.

Keep it updated

Native installs check for updates on startup and while running, download them in the background and apply them the next time you start Claude Code. To update right away, run claude update. Homebrew, WinGet and Linux package manager installs need the manual commands above. If you would rather run a version that is about a week old and skips releases with major regressions, open /config and set the auto-update channel to stable.

To see how it compares with an editor-based tool, read Claude Code vs Cursor.

Sources

  1. Advanced setup: system requirements, install methods and updates (Claude Code docs, Anthropic) (checked 2026-11-01)
  2. Quickstart (Claude Code docs, Anthropic) (checked 2026-11-01)
  3. Troubleshoot installation and login (Claude Code docs, Anthropic) (checked 2026-11-01)
  4. How Claude remembers your project: CLAUDE.md and /init (Claude Code docs, Anthropic) (checked 2026-11-01)
  5. Claude Code overview (Claude Code docs, Anthropic) (checked 2026-11-01)
  6. Claude plans and pricing (Anthropic) (checked 2026-11-01)
the list

Get the next one.

Field notes from real deployments, written the way this one was. No schedule promised and nothing sold to you. Unsubscribe whenever.

Frequently asked questions

How do I install Claude Code on Mac?

Open Terminal and run curl -fsSL https://claude.ai/install.sh | bash. That is Anthropic's native installer, and it updates itself in the background. Homebrew works too, with brew install --cask claude-code, but Homebrew installs need manual updates. Claude Code needs macOS 13.0 or later. Open a new terminal window and run claude --version to confirm the install.

How do I install Claude Code on Windows?

In PowerShell, run irm https://claude.ai/install.ps1 | iex. In CMD, run curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd. WinGet also works: winget install Anthropic.ClaudeCode. You can install inside WSL with the Linux command instead. Anthropic recommends Git for Windows so Claude Code can use Git Bash.

Do I need Node.js to install Claude Code?

Not for the native installer, Homebrew or WinGet. Node.js is not on Anthropic's list of requirements. Only the npm install needs it, and that route asks for Node.js 22 or later.

Is Claude Code free?

No. The free Claude plan does not include Claude Code. You need Pro, Max, Ultra, Team or Enterprise, or a Claude Console account with prepaid API credits. Pro costs $20 a month billed monthly, or $17 a month on an annual plan.

How do I update Claude Code?

Native installs update automatically, and claude update applies an update right away. For Homebrew, run brew upgrade claude-code. For WinGet, run winget upgrade Anthropic.ClaudeCode. For npm, run npm install -g @anthropic-ai/claude-code@latest.

Need help implementing this?

Prometheus does AI consulting and implementation, remote, with onsite days available in Milwaukee. We set it up, train your team, and make sure it works.

let's talk