Skip to content
Mastering Claude

Home / A structured installation

A structured installation10 minApplication

Installing, signing in and the first launch

The native Claude Code installer updates itself, signing in happens through a Pro, Max, Team, Enterprise or Console subscription rather than an API key forgotten in the environment, and claude doctor returns a read only diagnosis before any fix.

Four commands install Claude Code depending on the operating system, but only one updates itself. On macOS, Linux and WSL, the native command is curl -fsSL https://claude.ai/install.sh | bash. On PowerShell, it is irm https://claude.ai/install.ps1 | iex. Anthropic's documentation, checked on 2 September 2026, states that native installations update themselves automatically in the background to stay on the latest version.

Three other methods, without automatic updates

Homebrew installs Claude Code through brew install --cask claude-code, with two possible channels depending on the chosen cask, the stable version or the latest one, but neither updates itself. WinGet, on Windows, offers winget install Anthropic.ClaudeCode, the same applies. npm installs the global version through npm install -g @anthropic-ai/claude-code, and since Claude Code version 2.1.198 the package requires Node.js 22 or newer, without this being a hard block on an older version: npm shows an EBADENGINE warning during installation, but it still completes and claude works anyway, since the package downloads a native binary that does not use Node.js at runtime. These three methods suit a situation where a package manager already exists on the machine and must stay the single source of truth for what is installed there, at the cost of a manually relaunched update.

Signing in through the subscription, not through a forgotten key

Claude Code requires a Pro, Max, Team, Enterprise or Console account, the free Claude.ai plan does not open this access, according to the same documentation, which adds an alternative distinct from the subscription, a third party API provider such as Amazon Bedrock, Google Cloud Agent Platform or Microsoft Foundry. An ANTHROPIC_API_KEY already present in the machine's environment is neither ignored nor used silently: Claude Code asks once to approve it, instead of opening a browser for subscription based sign in. Launch the first call from the project folder you want Claude to read, the sign in prompt appears at that moment, before the first reply.

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

# Windows, PowerShell
irm https://claude.ai/install.ps1 | iex

# Diagnostic en lecture seule, sans ouvrir de session
claude doctor

The first reflex after installation

The claude doctor command, or its alias /checkup from inside a conversation, checks the state of the installation, duplicates, PATH problems, unreadable settings files, and offers a fix only after reporting what it found. From the terminal, it stays read only and does not start any session. It is the most reliable starting point for judging a setup before building anything on top of it, rather than guessing from an isolated error message. The module map places this first element, the engine installed and connected, before the other six.

Figure 1

Four installation methods, side by side

Installation methodUpdateScopePrerequisite
Native installer (curl / irm)Automatic, in the backgroundCurrent user account on the machineNo package manager required
Homebrew (macOS)Manual, through brew upgradeDepends on the chosen cask, stable or latestHomebrew already installed on the machine
WinGet (Windows)Manual, through winget upgradeCurrent Windows accountWinGet already installed on the machine
npm globalManual, through npm update -gScope of the machine's Node package managerNode.js 22 or newer since version 2.1.198, not a hard block, EBADENGINE warning otherwise
The table crosses each installation method with its update behaviour, its scope and its prerequisite, to show that only the native method updates itself without a command relaunched by hand.
Calibrate it yourself

An administrator installs Claude Code on a machine with the curl command given by the documentation, then launches claude for the first time from his project folder. The sign in prompt offers several options, and he chooses his existing Pro account.

Write in one sentence what this situation establishes, and in one sentence what it does not establish.

What to remember
  • The native installer updates itself automatically in the background, while Homebrew, WinGet and npm each require an update command relaunched by hand.
  • A Claude Code account requires a Pro, Max, Team, Enterprise or Console subscription, the free Claude.ai plan does not open this access.
  • An ANTHROPIC_API_KEY already present in the environment is neither ignored nor used silently, it triggers a single approval request instead of opening the browser.
  • The claude doctor command returns a read only diagnosis without starting a session, and its alias /checkup triggers the same check from inside a conversation.
  • Since version 2.1.198, npm asks for Node.js 22 or newer without this being a hard block: on an older version, installation still completes behind an EBADENGINE warning.
Do this now

Run claude doctor in your terminal right now and note the first three lines it displays, before fixing anything: this is your measured starting point for the rest of the map.

Check the source

Every datable claim in this lesson links here to the public text behind it. A source that does not open proves nothing.