Back to guides
Installation·September 11, 2026·Updated October 3, 2026·10 min read

How to install Claude Code on Windows, macOS, and Linux—and how to use it without a subscription

Installation is one command. What gets stuck is Windows—which terminal, the PATH—and the next step: how to use it without a Pro or Max subscription.

Installing Claude Code takes one command: on macOS, Linux, or WSL, run curl -fsSL https://claude.ai/install.sh | bash; on Windows, run irm https://claude.ai/install.ps1 | iex in PowerShell (in Command Prompt, CMD, use the install.cmd line shown below). Then open a new terminal, check with claude --version, go to your project folder, and run claude; the first useful command is /init. You have two ways to connect: sign in with a Pro, Max, Team, Enterprise, or Console account (Claude.ai's free plan does not include Claude Code), or set the two environment variables ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN and use a pay-as-you-go API key, with no subscription.

Commands verified on September 11, 2026 against Anthropic's official installation documentation.

Requirements

RequirementSupported options
Operating systemmacOS 13.0+, Windows 10 1809+ or Windows Server 2019+, Ubuntu 20.04+, Debian 10+, Alpine Linux 3.19+
Hardware4 GB RAM or more, x64 or ARM64 processor
ShellBash, Zsh, PowerShell, or CMD
NetworkInternet connection from a country where Anthropic offers the service
AccountPro, Max, Team, Enterprise, or Console, or an API key (see below)

Install on macOS and Linux

Open Terminal and paste:

Terminal
# macOS, Linux, WSL
curl -fsSL https://claude.ai/install.sh | bash

This is the recommended method: it installs a standalone binary that updates itself in the background. The executable is placed in ~/.local/bin/claude, and a terminal that was already open will not see the new PATH, so open another window before testing. The command is the same in WSL.

Install Claude Code on Windows

Windows has two different command lines; the only difference is the terminal. If the prompt starts with PS C:\Users\TuNombre>, you are in PowerShell; if it has no PS, just C:\Users\TuNombre>, you are in Command Prompt (CMD). You do not need to run it as an administrator.

PowerShell
# Windows PowerShell
irm https://claude.ai/install.ps1 | iex
cmd.exe
:: Windows Símbolo del sistema (CMD)
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd

Pasting the command into the wrong terminal is the most common mistake. The CMD command in PowerShell returns The token '&&' is not a valid statement separator; the PowerShell command in CMD returns 'irm' is not recognized as an internal or external command (on a Spanish-language Windows system, “is not recognized as an internal or external command”); and pasting the macOS curl … | bash command into PowerShell returns A parameter cannot be found that matches parameter name 'fsSL'. In all three cases, just use the command for the right terminal.

Installing Git for Windows is optional but recommended: Claude Code uses its Git Bash to run commands and uses PowerShell if it is not installed. If Git is installed but Git Bash still cannot be found, set CLAUDE_CODE_GIT_BASH_PATH in the env block of the settings, using the path to bash.exe.

OptionRequiresSandboxWhen to choose it
Native WindowsNothing; Git for Windows is optionalNoNative Windows projects and tools
WSL 2WSL 2 enabledYesLinux tools or sandboxed commands
WSL 1WSL 1 enabledNoIf WSL 2 is unavailable

With WSL, run the macOS/Linux command inside the WSL terminal and launch claude there, not from PowerShell or CMD.

Using a package manager

This also works, with one important difference: none of them update automatically by default (you will need to run brew upgrade claude-code or winget upgrade Anthropic.ClaudeCode). Signed apt, dnf, and apk repositories are also available for Debian/Ubuntu, Fedora/RHEL, and Alpine.

# Homebrew (macOS, Linux) — canal stable
brew install --cask claude-code

# WinGet (Windows)
winget install Anthropic.ClaudeCode

# npm — requiere Node.js 22 o posterior; nunca con sudo
npm install -g @anthropic-ai/claude-code

With npm, starting with version 2.1.198 the package requires Node.js 22 or later; with an older Node.js version, npm only displays a EBADENGINE warning and the installation completes. It installs the same native binary, which does not use Node.js to run. Never use sudo npm install -g: it causes permission issues and is a security risk.

Check the installation

claude --version   # imprime la versión, por ejemplo 2.1.211 (Claude Code)
claude doctor      # diagnóstico de la instalación y la configuración, sin abrir sesión

Use claude doctor: without signing in, it shows the installation status, configuration file errors, and suggested fixes. It is the fastest way to tell whether the issue is with the installation or the configuration.

If you see command not found: claude (or, on Windows, claude is not recognized), the installation folder is not in PATH. On macOS and Linux, open a new terminal and, if the issue persists, add ~/.local/bin to PATH in ~/.zshrc or ~/.bashrc. On Windows, the folder is %USERPROFILE%\.local\bin; check it and add it from PowerShell:

PowerShell
# 1. Comprueba si la carpeta de instalación ya está en el PATH
$env:PATH -split ';' | Select-String '\.local\\bin'

# 2. ¿Sin salida? Añádela al PATH de usuario y abre una terminal nueva
$currentPath = [Environment]::GetEnvironmentVariable('PATH', 'User')
[Environment]::SetEnvironmentVariable('PATH', "$currentPath;$env:USERPROFILE\.local\bin", 'User')

# 3. En la terminal nueva: si hay dos instalaciones, verás dos rutas
where.exe claude

First connection: subscription or API key

Option A — sign in with your subscription

In the project folder, run claude and follow the browser sign-in flow with a Pro, Max, Team, Enterprise, or Console account. One detail can be confusing: if the ANTHROPIC_API_KEY variable is already set, Claude Code asks once whether you want to use that key. If you say no, it ignores it from then on without asking again, making it seem as though the variable is not being read. To re-enable it: /config → Use custom API key.

Option B — no subscription, with a pay-as-you-go key

Claude Code natively reads ANTHROPIC_BASE_URL, so pointing it to any Anthropic Messages API endpoint is a supported configuration: no plugins, no proxy, and no modified binaries. The steps: create an account, add funds (minimum $10), generate a sk-kn- key in the key dashboard (it is shown only once), and add this env block to your user settings, ~/.claude/settings.json (on Windows, %USERPROFILE%\.claude\settings.json). This makes it available to all terminals, the editor extension, and background processes:

~/.claude/settings.json
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.kunavo.com",
    "ANTHROPIC_AUTH_TOKEN": "sk-kn-...",
    "ANTHROPIC_MODEL": "claude-sonnet-5",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-5-5",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-5",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-4-5"
  }
}

To try it first in a single PowerShell window:

PowerShell
# Solo para esta ventana de PowerShell (en macOS/Linux: export VARIABLE=valor)
$env:ANTHROPIC_BASE_URL = "https://api.kunavo.com"
$env:ANTHROPIC_AUTH_TOKEN = "sk-kn-..."
$env:ANTHROPIC_MODEL = "claude-sonnet-5"
$env:ANTHROPIC_DEFAULT_OPUS_MODEL = "claude-opus-5-5"
$env:ANTHROPIC_DEFAULT_SONNET_MODEL = "claude-sonnet-5"
$env:ANTHROPIC_DEFAULT_HAIKU_MODEL = "claude-haiku-4-5"
claude
  • ANTHROPIC_BASE_URL should contain only the domain. Claude Code adds /v1/messages; with /v1 at the end, the request goes to /v1/v1/messages and returns 404.
  • Use ANTHROPIC_AUTH_TOKEN, not ANTHROPIC_API_KEY. They go in different HTTP headers: the first sends Authorization: Bearer and works immediately; the second sends x-api-key and also triggers the one-time approval above.
  • Enter the exact model name in ANTHROPIC_MODEL. Kunavo recognizes only an exact match and does not translate older date-stamped names.
  • Also pin ANTHROPIC_DEFAULT_OPUS_MODEL. Claude Code's default model and its opus alias point to the latest Opus and, if Kunavo does not offer it yet, the first request returns a 404. Here, the opus alias is pinned to Claude Opus 5.5 (claude-opus-5-5), which requires Claude Code v2.1.280 or later; with an older version, run claude update.
  • And also ANTHROPIC_DEFAULT_SONNET_MODEL. The sonnet alias requests Sonnet 5.5, which Kunavo does not offer: without this variable, /model sonnet, the execution phase of opusplan, and subagents configured with sonnet return a 404. Setting it to claude-sonnet-5 avoids this.
  • Same goes for ANTHROPIC_DEFAULT_HAIKU_MODEL. The haiku alias requests an ID that Kunavo does not offer (Haiku 5.5 from v2.1.293 onward): without this variable, /model haiku and subagents configured with haiku return 404s. Setting it to claude-haiku-4-5 prevents this and also routes background calls Claude Code makes on its own (summaries, titles) away from the main model.

Never put the key in the project .claude/settings.json: that file is committed to the repository. In the VS Code extension, put the variables in claudeCode.environmentVariables, in VS Code's user settings, because the extension checks credentials before starting.

Rates per 1M tokens, read from the catalog:

ModelKunavo (input / output)Anthropic official rateDifferenceUse case
claude-haiku-4-5$0.70 / $3.50$1.00 / $5.00~30% lessSimple tasks and Claude Code background calls
claude-sonnet-5$1.40 / $7.00$2.00 / $10.00~30% lessThe default model for everyday use
claude-opus-5$3.50 / $17.50$5.00 / $25.00~30% lessLarge refactors and planning
claude-opus-5-5$2.80 / $14.00$4.00 / $20.00~30% lessThe latest Opus; the opus alias in this configuration
claude-fable-5$7.00 / $35.00$10.00 / $50.00~30% lessThe hardest problems

How to tell which option is active

In Claude Code, run /status. A line showing Auth token means the key is in use; a line showing Login method and a claude.ai account means the variable was not read. They are not combined: while the variable exists, the subscription is set aside; remove it and Claude Code returns to the subscription without reinstalling.

Three things change behind a gateway: Remote Control and voice dictation are unavailable (they require a claude.ai identity); /fast may say that fast mode is unavailable because that check goes directly to Anthropic, although normal requests are unaffected; and the figures in /context become local estimates. Code, tools, subagents, MCP, hooks, and prompt caching work the same way. Full details are in the integration documentation and the Claude Code API key guide (both in English).

How to use Claude Code: getting started

# 1. Arranca siempre dentro de la carpeta del proyecto
cd ~/proyectos/mi-app
claude

# 2. Primer comando: lee el repositorio y genera CLAUDE.md
> /init

# 3. Pide las tareas en español y con la ruta del archivo
> cambia la validación de src/api/user.ts a zod y arregla los tests

# 4. Para tareas que tocan muchos archivos: Shift+Tab activa el modo plan

Claude Code asks permission before editing a file or running a command; if it goes in the wrong direction, press Esc to stop it and /rewind to return to an earlier point. The CLAUDE.md generated by /init is a draft: keep it to what you would repeat in every session (test commands, conventions, folders to leave untouched). It is loaded in every session and included in every request, and Anthropic recommends keeping it under 200 lines.

  • Change models: /model followed by the full name, for example /model claude-opus-5, or start with claude --model claude-opus-5. Do this between tasks: each model has its own cache, and switching in the middle of a task requires rereading the entire conversation without cache.
  • /clear between unrelated tasks. Starting a new conversation is free; recover the previous one with /resume.
  • /compact when a task runs long: summarize the history and continue. With an API key, the cache lasts five minutes by default, so compact before a long pause, not after.
  • What a session costs: /usage shows the tokens, but its cost calculation is a local estimate based on Anthropic's list prices; with Kunavo, the actual charge is shown on your usage page.

Payment and choosing honestly

The balance is prepaid through Stripe: card (Visa, Mastercard, American Express, JCB, UnionPay), Apple Pay, Google Pay, or Link; SEPA direct debit is not available. The minimum top-up is $10, the balance does not expire, failed requests are not charged, and each key supports a monthly spending limit. All rates are on the pricing page.

If you use Claude Code for many hours a day, a fixed subscription usually costs less; pay-as-you-go makes sense when usage is irregular or you do not want to depend on the 5-hour window, and a month with no activity costs zero. The full comparison, in English, is at Claude Code pricing. Through Kunavo, you use shared capacity, with no dedicated quota or contractual SLA: if you need those guarantees, subscribe directly with Anthropic.

Frequently asked questions

How do I install Claude Code?

On macOS, Linux, or WSL, run curl -fsSL https://claude.ai/install.sh | bash. On Windows, run irm https://claude.ai/install.ps1 | iex in PowerShell or, in Command Prompt (CMD), curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd. This is Anthropic's recommended native installer and updates itself in the background. Then open a new terminal and check with claude --version.

How do I install Claude Code on Windows? Do I need WSL?

No. Run the PowerShell or CMD installer without administrator privileges, then launch claude from any terminal. Git for Windows is optional but recommended: Claude Code uses its Git Bash to run commands and uses PowerShell if it is not installed. Choose WSL 2 only if you need Linux tools or sandboxed execution; in that case, install and launch claude inside the WSL terminal.

Do I need Node.js to install Claude Code?

No, unless you install it with npm. The native installer, Homebrew, WinGet, and Linux repositories install a native binary that does not use Node.js. With npm, starting with version 2.1.198 the package requires Node.js 22 or later, and you should never use sudo npm install -g.

Can I use Claude Code without a subscription?

Yes. Signing in requires a Pro, Max, Team, Enterprise, or Console account, and Claude.ai's free plan does not include Claude Code. The alternative is a pay-as-you-go API key: with the ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN variables set, Claude Code authenticates with that endpoint and you pay only for the tokens you use, with no monthly fee.

How do I use Claude Code after installing it?

Open a terminal in the project folder and run claude. The first command is /init, which reads the repository and generates a CLAUDE.md with the test commands and project conventions. Then describe tasks in natural language and include the file path, for example, “change the validation in src/api/user.ts to zod.” Claude Code reads, edits, and runs tests, and asks for permission before each change or command.

Why do I see “claude: command not found” or “not recognized” after installing?

The installation folder is not in your terminal's PATH. Close the terminal and open a new one. On macOS and Linux, the folder is ~/.local/bin; on Windows, it is %USERPROFILE%\.local\bin, which you can add to your user PATH from PowerShell. Then run claude doctor and, if an old npm installation remains, keep only one.

Should ANTHROPIC_BASE_URL end with /v1?

No. Claude Code adds /v1/messages itself, so the variable should contain only the domain, for example https://api.kunavo.com. A value ending in /v1 sends requests to /v1/v1/messages and returns a 404, the most common configuration error.