CC
0 XP
0

Chapter 0: Getting Started

Installing Claude Code

setup5 min

Installing Claude Code

Let's get Claude Code installed on your machine.

Prerequisites

You'll need:

  • Node.js 18+ installed
  • A terminal (Terminal.app, iTerm2, Warp, VS Code terminal, etc.)
  • An Anthropic API key or Claude Pro/Max subscription
⚠️Warning

Claude Code requires Node.js 18 or later. Run node --version to check yours.

Install via npm

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

That's it! Claude Code is now available as the claude command in your terminal.

Verify the installation

Terminal
$claude --version

You should see the version number printed. If you get "command not found", close your terminal completely, open a new one, and try again. If it still doesn't work, use this alternative:

Terminal
$npx @anthropic-ai/claude-code

This runs Claude Code without a global install. You can use npx @anthropic-ai/claude-code anywhere this course says claude.

Authentication

The first time you run Claude Code, it will ask you to authenticate:

Terminal
$claude
  1. Claude Code opens your browser to authenticate
  2. Sign in with your Anthropic account
  3. Approve the connection
  4. Return to your terminal — you're ready to go!
💡Info

What account do you need? Claude Code works with either a Claude Pro/Max subscription ($20+/month at claude.ai) or an Anthropic API key with credits. If you have a free Claude account, you'll need to upgrade to Pro or add API credits. The authentication screen will guide you through the options.

⚠️Warning

Expected cost: Completing this entire course (Chapters 0-4) typically uses $5-$15 in API credits if you're using an API key, depending on how much you experiment. With a Claude Pro subscription ($20/month) or Max subscription ($100/month), usage is included. You can check your current usage at console.anthropic.com under the Usage tab.

Tip

If you have an Anthropic API key, you can set it as an environment variable instead: export ANTHROPIC_API_KEY=your-key-here

You're all set! In the next section, we'll have our first conversation with Claude Code.