Requirements
- Node.js 18 or higher (
node --versionto check) - Supported platforms: macOS, Linux, Windows (including WSL)
On Windows, running Claude Code natively via WSL (Windows Subsystem for Linux) is the recommended path. Ensure you use a Linux-native Node.js and npm installation inside WSL — not the Windows versions from
/mnt/c/. See the Windows note below.Install the package
Install@anthropic-ai/claude-code globally so the claude command is available anywhere on your system.
Install locally in a project
You can also install Claude Code as a local dev dependency and run it vianpx:
Verify the installation
Authentication
Claude Code supports several authentication methods. Configure one before your first session.1. OAuth via claude.ai (recommended)
Runclaude from any directory. If no credentials are found, Claude Code launches an interactive OAuth flow:
2. API key via environment variable
SetANTHROPIC_API_KEY in your shell before running claude. Claude Code reads this variable at startup and skips the OAuth flow:
~/.bashrc, ~/.zshrc, etc.) to make it permanent.
3. Amazon Bedrock
SetCLAUDE_CODE_USE_BEDROCK=1 to route all API calls through Amazon Bedrock. Standard AWS credential resolution applies (environment variables, ~/.aws/credentials, IAM instance roles, etc.):
4. Google Vertex AI
SetCLAUDE_CODE_USE_VERTEX=1 to route all API calls through Google Vertex AI. Standard Google Cloud credential resolution applies:
Auto-updater
Claude Code checks for updates automatically and installs them in the background usingnpm install -g (or bun install -g when running under Bun). The updater requires write access to your global npm prefix directory.
Disable the auto-updater
SetDISABLE_AUTOUPDATER=1 in your environment to opt out of automatic updates:
Windows and WSL
On Windows, the auto-updater requires a Linux-native npm installation. If Claude Code detects that npm is being resolved from the Windows path (e.g./mnt/c/...), the update will fail. Install Node.js inside your Linux distribution and ensure the Linux npm appears first in PATH:
System CA certificates
Claude Code uses the system’s TLS stack for all API calls. In environments with custom or corporate CA certificates (e.g. TLS-intercepting proxies), you may need to supply additional certificates.NODE_EXTRA_CA_CERTS
PointNODE_EXTRA_CA_CERTS to a PEM-format CA bundle file. Claude Code appends these certificates to the built-in Mozilla root store:
—use-system-ca
Pass--use-system-ca in NODE_OPTIONS to use the operating system’s CA store instead of the bundled Mozilla roots:
--use-system-ca selects system CAs as the base, and NODE_EXTRA_CA_CERTS appends additional certificates on top.
Configuration directory
Claude Code stores its configuration, session data, and credentials in~/.claude/ by default. Override this with the CLAUDE_CONFIG_DIR environment variable: