Setup
Overview
This lesson covers the installation, authentication, and initial configuration of Claude Code. The CLI is the primary interface; desktop, web, and IDE environments are also available.
Prerequisites
The following are required prior to installation:
- Node.js 18 or later (verify with
node --version) - A terminal environment (macOS Terminal, iTerm2, Windows Terminal, etc.)
- An Anthropic account (API or subscription-based)
Installation
Install the CLI globally via npm:
npm install -g @anthropic-ai/claude-code
Verify the installation:
claude --version
Available Environments
Claude Code is accessible through multiple interfaces:
- CLI — Terminal-based interactive session (
claudecommand) - Desktop App — Native application for macOS and Windows
- Web — Browser-based interface at claude.ai/code
- IDE Extensions — Integrated support for VS Code and JetBrains IDEs
Authentication
Two authentication methods are supported:
Method 1: Anthropic API Key
Obtain an API key from console.anthropic.com and configure it:
claude config set api_key YOUR_API_KEY
Method 2: Claude Max / Code Subscription
Subscription holders authenticate via browser-based login:
claude auth login
Selection criteria: Subscription-based authentication is suitable for individual use. API keys provide finer-grained access control and are recommended for team environments.
Initial Session
Navigate to the project root directory and launch Claude Code:
cd your-project
claude
An interactive prompt is presented. The following is a representative first command:
> What files are in this directory?
Claude Code reads the directory structure and responds with a summary of the project contents.
Note: Claude Code uses the current working directory as the project root. All file paths and CLAUDE.md configuration are resolved relative to this directory. Launching from the correct location is essential.
Key Takeaways
- Install via
npm install -g @anthropic-ai/claude-code - Claude Code is available as CLI, desktop app, web app, and IDE extension
- Authenticate with an API key (teams) or subscription login (individuals)
- Always launch from the project root directory