System Requirements
Claude Code runs as a Node.js CLI tool. It works on macOS 12+, Ubuntu 20.04+ (and most Linux distros), and Windows 10/11 via WSL 2.
Quick Install (30 Seconds)
If you already have Node.js 18+ installed, Claude Code is a single command:
Then start it:
That's it. Claude Code will walk you through authentication on first run.
Prefer not to install globally? Use npx @anthropic-ai/claude-code to run without installing. This always uses the latest version.
Platform-Specific Setup
macOS Setup
-
Install Node.js with Homebrew (recommended)
If you don't have Homebrew:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"$ brew install node
$ node --version
v22.x.x -
Install Claude Code
$ npm install -g @anthropic-ai/claude-code
-
Launch & authenticate
$ cd your-project
$ claude
Use nvm install --lts if you need to manage multiple Node.js versions. Install nvm first.
Linux Setup (Ubuntu/Debian)
-
Install Node.js via nvm
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
$ source ~/.bashrc
$ nvm install --lts
$ node --version
v22.x.x -
Install Claude Code
$ npm install -g @anthropic-ai/claude-code
-
Launch & authenticate
$ cd your-project
$ claude
If npm install -g asks for sudo, use nvm instead. Installing with sudo can cause permission issues later.
Windows Setup (WSL 2)
Claude Code requires WSL (Windows Subsystem for Linux). Native Windows is not yet supported.
-
Install WSL 2
Open PowerShell as Administrator:
PS> wsl --installRestart your computer when prompted. Ubuntu will be installed by default.
-
Set up Ubuntu & Node.js
Open the Ubuntu terminal from Start menu:
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
$ source ~/.bashrc
$ nvm install --lts -
Install Claude Code
$ npm install -g @anthropic-ai/claude-code
-
Launch & authenticate
$ cd /mnt/c/Users/YourName/projects/your-project
$ claude
Install the WSL extension in VS Code to seamlessly develop in your WSL environment. Claude Code's VS Code extension works through WSL too.
Authentication & API Keys
Claude Code supports three authentication methods:
| Method | Best For | Setup |
|---|---|---|
| Browser login | Claude Pro/Team users | Run claude and follow the browser prompt |
| API key | Direct API usage | Set ANTHROPIC_API_KEY environment variable |
| Claude for Enterprise | Enterprise/SSO | Configured by your admin |
Option 1: Browser Login (Recommended)
Just run claude and it will open your browser. Log in with your Anthropic account. Your session persists across terminal restarts.
Option 2: API Key
Get an API key from console.anthropic.com and set it as an environment variable:
export ANTHROPIC_API_KEY="sk-ant-api03-..."
Never commit API keys to git. Add .env to your .gitignore. Use environment variables or a secrets manager.
First Run & Verification
Verify everything works:
1.0.x (claude-opus-4-6)
$ claude "what files are in this directory?"
I can see the following files in the current directory...
Claude Code features to try on your first run:
- Ask a question:
claude "explain this codebase" - Fix a bug:
claude "fix the failing test in src/auth.test.ts" - Interactive mode: Just type
claudeto start a conversation - Pipe input:
git diff | claude "review these changes"
IDE Integration
VS Code
Install the official Claude Code extension from the VS Code marketplace:
Or search "Claude Code" in the Extensions panel (Cmd+Shift+X). The extension provides:
- Inline code suggestions
- Chat panel for conversations
- Terminal integration
- Status bar showing model and token usage
JetBrains IDEs
Claude Code works in all JetBrains IDEs (IntelliJ, WebStorm, PyCharm, etc.) through the integrated terminal. A dedicated plugin is also available in the JetBrains Marketplace.
Terminal-Only Usage
Claude Code works great as a standalone CLI. No IDE required:
$ claude
# One-shot command
$ claude "add error handling to src/api.ts"
# Pipe files for review
$ cat src/auth.ts | claude "find security issues"
Essential Configuration
CLAUDE.md (Project Instructions)
Create a CLAUDE.md file in your project root to give Claude persistent context about your project:
## Project
This is a Next.js 15 app with TypeScript and Tailwind.
## Conventions
- Use functional components with hooks
- Tests go in __tests__ directories
- Use pnpm, not npm
## Commands
- Build: pnpm build
- Test: pnpm test
- Lint: pnpm lint
See the Claude Code Memory Guide for the complete CLAUDE.md reference.
Permission Modes
Control what Claude Code can do without asking:
$ claude --dangerously-skip-permissions
# Plan mode: Claude proposes changes, you approve
$ claude --plan
Model Selection
$ claude --model claude-opus-4-6
$ claude --model claude-sonnet-4-6
$ claude --model claude-haiku-4-5
| Model | Speed | Best For |
|---|---|---|
| Opus 4.6 | Slower | Complex architecture, multi-file refactors |
| Sonnet 4.6 | Fast | Everyday coding, default choice |
| Haiku 4.5 | Fastest | Quick questions, simple edits |
Updating Claude Code
$ npm update -g @anthropic-ai/claude-code
# Check current version
$ claude --version
Claude Code updates frequently with new features and model improvements. We recommend updating weekly or when you notice new features announced.
Using npx @anthropic-ai/claude-code always runs the latest version without manual updates.
Troubleshooting
Common Issues
| Issue | Solution |
|---|---|
command not found: claude |
Ensure npm global bin is in your PATH. Run npm config get prefix and add /bin to your PATH. |
EACCES permission denied |
Don't use sudo. Fix npm permissions with npm config set prefix ~/.npm-global or use nvm. |
Node.js version too old |
Upgrade with nvm install --lts or brew upgrade node. |
| Authentication failed | Run claude logout then claude to re-authenticate. Check your API key if using one. |
| Slow responses | Check your internet connection. Try a faster model: claude --model claude-sonnet-4-6 |
| WSL: browser won't open | Set BROWSER=wslview in your WSL shell, or copy the auth URL manually. |
Reset Configuration
$ rm -rf ~/.claude
$ claude
Check Installation Health
$ node --version # Should be v18+
$ npm --version # Should be v9+
$ which claude # Should show install path
Frequently Asked Questions
How much does Claude Code cost?
Claude Code itself is free to install. You need either a Claude Pro subscription ($20/month, includes Claude Code access) or an Anthropic API key (billed per token). API pricing: Sonnet 4.6 is $3/$15 per million input/output tokens. Most coding sessions cost $0.05-$0.50.
Can I use Claude Code offline?
No. Claude Code requires an internet connection to communicate with Anthropic's API. All processing happens in the cloud. Your code is sent to the API for analysis but is not stored or used for training.
Is my code safe?
Anthropic does not use API inputs for model training. Your code is processed in memory and not retained after the session. Enterprise plans offer additional data handling guarantees. See Anthropic's privacy policy for details.
Can I use Claude Code with other AI providers?
Claude Code is designed for Anthropic's Claude models. However, it supports configuring third-party API providers that offer Claude-compatible APIs through the --api-base-url flag or ANTHROPIC_BASE_URL environment variable.
Does Claude Code work with monorepos?
Yes. Claude Code handles monorepos well. Place a CLAUDE.md at the root and optionally in each package directory. Claude will read the relevant instructions based on your working directory.
What languages does Claude Code support?
Claude Code works with every programming language. It's particularly strong with TypeScript, Python, Rust, Go, Java, C++, Ruby, PHP, Swift, and Kotlin. It can also work with config files, documentation, and any text-based format.
Next Steps
Now that Claude Code is installed, explore these resources: