Install guide · as of 2026-10-07

Claude Code One-Click Install: macOS, Linux and Windows

As of 2026-10-07, the install method Anthropic marks as recommended for Claude Code is Native Install: on macOS, Linux or WSL run curl -fsSL https://claude.ai/install.sh | bash, and in Windows PowerShell run irm https://claude.ai/install.ps1 | iex; Homebrew, WinGet and npm also work. To connect to QCode, the QCode one-click setup script does it in a single command: it picks an endpoint by latency, writes the configuration, installs Node.js and the CLI if needed, and verifies connectivity. This page lists the commands for both paths, how to verify the install and the common install errors.

Updated 2026-10-08

#Native Install#Windows PowerShell#One-click setup script#claude --version

Four things to know first

3 commands

The official installer, one per shell

install.sh for macOS, Linux and WSL, install.ps1 for Windows PowerShell, install.cmd for Windows CMD. Anthropic marks this as the recommended method, and it updates itself in the background.

Node.js 22+

Required by the npm package

The official docs say the npm package requires Node.js 22 or later; on an older version npm only prints an EBADENGINE warning and the install still completes. npm installs the same native binary as the official installer.

1 command

QCode one-click setup script

On macOS or Linux run curl -fsSL https://qcode.cc/install/claude-code.sh | bash; in Windows PowerShell run irm https://qcode.cc/install/claude-code.ps1 | iex. No sudo and no administrator rights needed.

claude --version

The first check after installing

A working install prints a version number such as 2.1.211 (Claude Code). For a deeper check run claude doctor; inside a session, /status confirms which authentication method is active.

Which install methods are official

As of 2026-10-07, the Claude Code setup page lists the official installer (Native Install, marked recommended), Homebrew (brew install --cask claude-code), WinGet (winget install Anthropic.ClaudeCode) and npm (npm install -g @anthropic-ai/claude-code); Debian, Fedora, RHEL and Alpine can also use Anthropic's signed apt, dnf and apk repositories. The main difference is updates: the official installer updates in the background, while Homebrew and WinGet installs do not auto-update. Homebrew has two casks: claude-code tracks the stable channel, typically about a week behind and skipping releases with major regressions, and claude-code@latest tracks the latest channel. System requirements: macOS 13.0+, Windows 10 1809+ or Windows Server 2019+, Ubuntu 20.04+, Debian 10+, Alpine Linux 3.19+, 4 GB+ RAM and an x64 or ARM64 processor.

Versions and docs as of 2026-10-07

As of 2026-10-07, the latest Claude Code release on GitHub Releases is v2.1.292, published 2026-10-06 (UTC); the latest tag of @anthropic-ai/claude-code on npm is also 2.1.292, and its package metadata lists node >=22.0.0. The QCode docs pages for the one-click setup script and the installation guide are both marked as updated on 2026-09-25; the installation guide opens by recommending the one-click script and says it completes every step on that page in one command. The public claude-code.sh script on qcode.cc carries the version string 2026.10.07.1 in its source.

Timeline

2026-09-25

The QCode docs pages for the one-click setup script and the installation guide are updated; as of 2026-10-07, the installation guide recommends the one-click script.

2026-10-06

Claude Code v2.1.292 is published on GitHub Releases (UTC), the latest release as of 2026-10-07; the npm latest tag is also 2.1.292.

2026-10-07

The public claude-code.sh script source carries version 2026.10.07.1; the commands, error messages and script behavior on this page were checked against the official pages and the script source on this date.

Confirmed vs not documented

Confirmed (verbatim in the docs)

All of the following can be found word for word in the Claude Code docs, GitHub Releases, the npm package metadata, or the QCode docs and public script source: the three official install commands and the Native Install recommendation; background auto-updates for the official installer and none for Homebrew and WinGet; the npm package requires Node.js 22 or later and installs the same native binary; Anthropic says not to use sudo npm install -g; installing on Windows does not require running as Administrator; what claude --version, claude doctor and /status are for; the QCode one-click script commands, its four steps (endpoint selection, writing config, installing Node.js and the CLI if needed, connectivity check), backups and rollback; and that the variables the script source writes include ANTHROPIC_BASE_URL, ANTHROPIC_AUTH_TOKEN and CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1.

Not documented or not verified here

Three things this page does not conclude: first, the npm package asks for Node.js 22 or later, but Anthropic also says an older Node.js only triggers an EBADENGINE warning and the install still completes; the QCode script installs an LTS release when Node.js is missing, and this page does not speculate about behavior on any specific Node.js version. Second, the install was not tested step by step on every operating system; the commands follow the official and QCode docs fetched on 2026-10-07, and your own system and version take precedence. Third, 2.1.211 in the official docs is only an example of the output format, not the current latest version.

Official installer, npm or the QCode script

Official installer vs npm

Anthropic marks Native Install as recommended, and it updates itself in the background; for npm-specific permission errors, the official fix is to switch to it. The npm method needs Node.js 22 or later and installs the same native binary; upgrade with npm install -g @anthropic-ai/claude-code@latest, and the docs warn against npm update -g and against sudo npm install -g. Homebrew and WinGet suit people who already use those package managers, but they do not auto-update.

Claude Code alone vs the QCode script

The official installer only installs Claude Code; on the official path you then sign in with a Pro, Max, Team, Enterprise or Console account. The QCode one-click script also sets up the connection: it picks an endpoint by latency, writes ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN, installs an LTS Node.js via nvm or winget when it is missing and then the CLI via npm, and finally sends a minimal request with your key to verify. If Claude Code is already installed and you only want the QCode config, add --no-install.

Step by step, both paths

Official path: (1) Open a terminal and run the command for your system: on macOS, Linux or WSL, curl -fsSL https://claude.ai/install.sh | bash; in Windows PowerShell, irm https://claude.ai/install.ps1 | iex; in Windows CMD, curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd. (2) Open a new terminal window and run claude --version to confirm a version number prints. (3) Run claude in your project folder. QCode path: (1) Get an API key starting with cr_ from the QCode dashboard. (2) On macOS or Linux run curl -fsSL https://qcode.cc/install/claude-code.sh | bash; on Windows run irm https://qcode.cc/install/claude-code.ps1 | iex in PowerShell, and paste the key when prompted (input is not echoed). (3) Open a new terminal so the config takes effect (on Windows, also restart editors such as VS Code once), run claude --version, then start claude and use /status to confirm the authentication method. To configure by hand, the QCode installation guide sets two variables: ANTHROPIC_BASE_URL=https://api.qcode.cc/api and ANTHROPIC_AUTH_TOKEN set to your key. If the install command fails with syntax error near unexpected token '<' or a 403, the docs say the install URL returned a web page or an error status instead of the script: install with Homebrew on macOS or WinGet on Windows, or retry after a few minutes.

On QCode

On QCode, Claude Code uses the Anthropic-protocol endpoint: set ANTHROPIC_BASE_URL to https://api.qcode.cc/api (stop at /api, no trailing slash) and ANTHROPIC_AUTH_TOKEN to a cr_ key created in the dashboard; Claude Code sends it in the Authorization header with a Bearer prefix. On macOS and Linux, the variables the script writes into the managed shell block also include CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1, which the QCode installation guide describes as disabling non-essential network requests such as telemetry. By default the one-click script does not write ANTHROPIC_MODEL, so Claude Code keeps its built-in default model and follows its upgrades; to pin one, pass --model, for example claude-sonnet-5-5 or claude-opus-5-5. Other Claude models such as claude-sonnet-5 can be called the same way. Billing is per token, per-model prices are on /models, and Claude models have no separate long-context tier.

Frequently asked questions

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. You do not need to run as Administrator, and winget install Anthropic.ClaudeCode also works. Anthropic supports Windows 10 1809+ or Windows Server 2019+. Git for Windows is optional: with it, Claude Code uses Git Bash; without it, Claude Code uses PowerShell as the shell tool. For WSL, run the Linux install command inside the WSL terminal and launch claude there. To connect to QCode, run irm https://qcode.cc/install/claude-code.ps1 | iex in PowerShell.

Getting command not found: claude or 'claude' is not recognized after installing?

Usually the install directory is not on your PATH yet, so first open a new terminal window and retry: the docs note that the session you installed from keeps its old PATH. The official installer puts claude at ~/.local/bin/claude on macOS and Linux and at %USERPROFILE%\.local\bin\claude.exe on Windows; Zsh users can run echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc, and Bash on Linux takes the same line in ~/.bashrc. If the command is missing after the QCode script on Windows, the QCode docs give the same fix: open a new PowerShell window.

irm is not recognized, or The token '&&' is not a valid statement separator?

The command does not match your shell. The docs say 'irm' is not recognized means you are in CMD, so use the CMD command or open PowerShell; The token '&&' is not a valid statement separator means you ran the CMD command in PowerShell. Running curl -fsSL ... | bash in PowerShell fails on the fsSL parameter because PowerShell's curl is an alias for Invoke-WebRequest. For the QCode script in CMD, run powershell -NoProfile -ExecutionPolicy Bypass -Command "irm https://qcode.cc/install/claude-code.ps1 | iex".

PowerShell says running scripts is disabled on this system?

The execution policy is blocking the .ps1 launcher scripts that npm creates. The docs give three fixes: run Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser and retry; call npm.cmd and claude.cmd instead; or skip npm and use the PowerShell installer, which installs a binary rather than a .ps1 script. The QCode one-click script relaxes the execution policy for its own run only and leaves your user-level and machine-level settings alone; to keep future PowerShell sessions unblocked, the QCode docs give Set-ExecutionPolicy -Scope CurrentUser RemoteSigned.

npm install fails with EACCES. Should I use sudo?

No. Anthropic says not to use sudo npm install -g because it can lead to permission issues and security risks; if you installed with npm before and hit npm-specific permission errors, the docs recommend switching to the official installer, curl -fsSL https://claude.ai/install.sh | bash. The QCode script does not need sudo either: running it with sudo writes the config into root's home directory, where your own shell never reads it, so rerun it without sudo.

The QCode script's check failed with 401, 404 or a timeout. What now?

Go by the status code. The QCode docs say 401 means the key is invalid or expired: check in the dashboard that the full cr_ prefix was copied, then rerun; 404 means a wrong endpoint URL: for Claude Code, ANTHROPIC_BASE_URL should look like https://api.qcode.cc/api, with no trailing slash; on a timeout, rerun with the --domain flag to pick another endpoint. If the script says the config was written but verification did not pass, the configuration is already in place, so fix the cause and rerun. Rerunning is always safe: the managed block is updated in place and files are backed up before being overwritten.

Sources

Install methods, requirements and updates: the Advanced setup and Quickstart pages of the Claude Code docs (code.claude.com). Errors and fixes: the official Troubleshoot installation and login page. Variable meanings: the official environment variables and authentication pages. Versions: GitHub Releases and the CHANGELOG of anthropics/claude-code, and the npm metadata for @anthropic-ai/claude-code. QCode side: the QCode docs pages for the one-click setup script and the installation guide (both updated 2026-09-25), plus the public claude-code.sh script on qcode.cc (read only, not executed). All fetched on 2026-10-07.

Install it and connect to QCode in one command

Have your cr_ key ready and run the one-click setup script. Billed per token; per-model prices are on /models.

Related reading

Commands and quotes on this page were checked on 2026-10-07; the official Claude Code docs and the QCode docs take precedence, and upstream changes may happen without notice. Install commands and error text change between versions, so go by the version you have; model availability is as listed on /models.

Try first, then decide

Not sure which tier? Start with Starter ($8.57/mo) and upgrade when you're happy — the unused value of the old plan goes back to your balance.