Setup
What this lesson teaches
Before using Claude Code, you need to install it and configure your API access. This lesson walks through the complete setup process.
Prerequisites
Make sure you have:
- Node.js 18+ installed (check with
node --version) - A terminal you're comfortable with
- An Anthropic account for API access
Installation
Install Claude Code globally using npm:
npm install -g @anthropic-ai/claude-code
Verify the installation:
claude --version
Authentication
Claude Code needs API access. You have two options:
Option 1: Anthropic API (Direct)
Get your API key from console.anthropic.com and run:
claude config set api_key YOUR_API_KEY
Option 2: Claude Max subscription
If you have Claude Max, authenticate via browser:
claude auth login
Which to choose? Claude Max is simpler for personal use. API keys give more control and are better for teams.
First Run
Navigate to any project folder and start Claude Code:
cd your-project
claude
You'll see an interactive prompt. Try asking something simple:
> What files are in this directory?
Claude will read your directory and respond. That's it—you're set up.
Important: Always start Claude Code from your project root. It uses the current directory as context for understanding your codebase.
Key Takeaways
- Install with
npm install -g @anthropic-ai/claude-code - Authenticate via API key or Claude Max
- Always run from your project root directory
- Type
claudeto start an interactive session