Lesson 2Basics

Installation & Setup

Getting started

Requirements
  • Node.js 18+To run the CLI
  • GitFor repository operations
  • Anthropic accountFor authentication
Installation

Universal method for all OS:

$ npm install -g @anthropic-ai/claude-code

Or using npx (without installation):

$ npx @anthropic-ai/claude-code
Authentication

On first launch, Claude Code will open a browser for Anthropic account login:

$ claude
Opening browser for authentication...
Successfully authenticated!

Method 1: OAuth (recommended)

Automatic login via browser. Token is saved locally.

Method 2: API Key

export ANTHROPIC_API_KEY=sk-ant-...
First Run

After installation, navigate to your project folder and run Claude:

# Navigate to your project
$ cd my-project
$ claude
╭─────────────────────────────────────╮
│ Claude Code v1.x.x │
Ready to help!
╰─────────────────────────────────────╯

>

IDE Integration

VS Code
  1. 1Open terminal in VS Code
  2. 2Run claude
  3. 3Use @ mentions for files
JetBrains
  1. 1Open built-in terminal
  2. 2Run claude
  3. 3Integrates with project automatically
Neovim
  1. 1Use :terminal
  2. 2Run claude
  3. 3Supports vim-mode navigation
Basic Configuration

Settings are stored in ~/.claude/settings.json:

{
  "model": "claude-sonnet-4-20250514",
  "theme": "dark",
  "permissions": {
    "allow_bash": true,
    "allow_write": true
  }
}

Common Issues

"command not found: claude"

Check that npm global path is in PATH

Authentication error

Run claude --logout and authenticate again

Slow startup

First run caches dependencies, subsequent runs will be faster