Documentation Index
Fetch the complete documentation index at: https://mintlify.com/VineeTagarwal-code/claude-code/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Before installing Claude Code, make sure you have:- Node.js 18 or later — Required for the npm installation method. Check your version with
node --version. - npm — Comes with Node.js. Check with
npm --version. - An Anthropic account — Either a claude.ai subscription (Pro or Max) or an API key from console.anthropic.com.
Install via npm
The npm global install is the fastest way to get started and works on all platforms.claude command to your npm global bin directory. After installation, verify it works:
Other package managers
Native binary install
Claude Code also distributes a self-contained native binary for each platform. The native install places the binary at~/.local/bin/claude (or %USERPROFILE%\.local\bin\claude.exe on Windows) and manages updates independently of npm.
To install or switch to the native binary, run the claude install CLI command:
- Downloads the latest native binary for your platform and architecture
- Places it at
~/.local/bin/claude - Sets up shell integration so the directory is on your
PATH - Removes old npm-based installations to avoid conflicts
- macOS
- Linux
- Windows
The native installer places the binary at
~/.local/bin/claude and creates a symlink. Supported architectures: x64 and arm64 (Apple Silicon).After running claude install, add ~/.local/bin to your PATH if it is not already there:Authentication setup
Runclaude after installing. On the first launch, Claude Code prompts you to authenticate.
Option 1: Sign in with claude.ai (recommended)
If you have a claude.ai subscription (Pro or Max), choose this option. Claude Code opens an OAuth flow in your browser. After you approve the connection, Claude Code stores a token locally and you are signed in.Option 2: Use an API key
If you use the Anthropic API directly, choose the API key option and paste your key when prompted. You can also set the key as an environment variable before launching:Setting
ANTHROPIC_API_KEY as an environment variable bypasses the authentication prompt on every launch. This is useful for CI environments and automated workflows.Switching accounts
To sign in with a different account or switch authentication methods, run/login inside any session:
Verify the installation
After installing and authenticating, confirm everything works:/help to see available commands:
Upgrading
Update to the latest version
Run theclaude update command (alias: claude upgrade) to check for and install the latest release:
claude install:
Update via npm
If you installed via npm, update with your package manager:Automatic updates
Claude Code checks for updates in the background and installs them automatically when a new version is available. You can see the current auto-update settings with/config and toggle them there.
Uninstalling
- npm install
- Native binary
Troubleshooting
command not found: claude after npm install
Your npm global bin directory is not on your PATH. Run npm bin -g to find it, then add it to your shell’s config file (~/.zshrc, ~/.bashrc, or equivalent).
Could not install — another process is currently installing Claude
Another Claude Code process is already performing an install or update. Wait a moment and try again. If the error persists, use --force:
/login inside a session to re-authenticate. If you are using an API key, check that ANTHROPIC_API_KEY is set correctly in your environment.
Checking your installation status
Use the /doctor command inside a session to run a diagnostic check: