Install Claude Code
Claude Code can be installed quickly using the native installer.
Step 1: Download Claude Code
Mac / Linux / WSL
Open your terminal and run:
curl -fsSL https://code.claude.com/install.sh | bash
Windows
For the easiest experience on Windows, we recommend installing the Warp terminal first, which provides a modern, intuitive command line interface.
- Download and install Warp from warp.dev.
- Open your new Warp terminal and run the following command to install Claude Code:
Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://code.claude.com/install.ps1'))
Step 2: Authenticate with Claude Code
The easiest way to use Claude Code is through OAuth login with your Anthropic account.
Option A: OAuth Login (Recommended)
Simply open your terminal and run:
claude login
This will automatically open your web browser. Log in with your Claude.ai account or Anthropic Console credentials. Once authenticated, return to your terminal and you’re ready to go!
Option B: Using an API Key
If you prefer to use an API key manually:
- Go to console.anthropic.com and navigate to API Keys.
- Create and copy your key (it starts with
sk-ant-). - Set it as an environment variable:
Mac / Linux / WSL:
Add this line to your ~/.zshrc or ~/.bashrc, then restart your terminal:
export ANTHROPIC_API_KEY='sk-ant-your-key-here'
Windows (PowerShell in Warp):
Run this command to set the variable for your user:
[System.Environment]::SetEnvironmentVariable('ANTHROPIC_API_KEY', 'sk-ant-your-key-here', 'User')
Important: Keep your API key private! Never share it or commit it to version control.
Step 3: Verify Installation
Run these commands to verify everything is working:
claude --version
You should see the version number (e.g., claude 2025.1.0).
Then run the diagnostic:
claude doctor
This checks that:
- Claude Code is installed correctly
- Your API key is valid
- You have network access
Troubleshooting
”Command not found: claude”
Your shell might not have reloaded. Try:
source ~/.zshrc # or source ~/.bashrc
Or open a new terminal window.
”Invalid API key”
Double-check that:
- You copied the full key (starts with
sk-ant-) - There are no extra spaces
- You reloaded your shell after setting the variable
Still having issues?
Run claude doctor for detailed diagnostics, or check the official documentation.
Next Steps
You’ve installed Claude Code! In the next lesson, you’ll start Claude Code and clone the course materials.