Skip to main content

Installation

Get Claude Code up and running on your system in just a few steps.

Note: For the most up-to-date installation instructions, visit the official Claude Code documentation.

System Requirements

Claude Code supports the following operating systems:

  • macOS 10.15 (Catalina) or later
  • Windows 10 or later
  • Linux (Ubuntu 18.04+, CentOS 7+, or equivalent)

Hardware Requirements:

  • 4GB RAM minimum (16GB is my recommendation)
  • 500MB available disk space
  • Internet connection for API communication

Prerequisites

Before installing Claude Code, make sure you have:

  • Node.js version 18.0 or higher
  • An Anthropic API key (get one from console.anthropic.com)
  • A terminal or command prompt

Installation Methods

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

Option 2: Direct Download

Download the latest binary from the GitHub releases page.

Setup

API Key Configuration

After installation, configure Claude Code with your API key:

claude config

You'll complete a one-time OAuth process with your Claude Max or Anthropic Console account.

Alternative: Environment Variable

You can also set your API key using an environment variable:

export ANTHROPIC_API_KEY="your-api-key-here"

Add this to your shell profile (.bashrc, .zshrc, etc.) to make it persistent.


Claude Max Subscription

Important: The Anthropic API is pay-per-use and can become expensive with frequent usage. For regular Claude Code users, a Claude Max subscription is likely the more economical option. Claude Max provides higher usage limits at a fixed monthly cost, making it ideal for developers using Claude Code extensively.

Consider Claude Max if you plan to:

  • Use Claude Code for multiple hours per day
  • Work on large codebases
  • Perform complex multi-file operations regularly

Getting Started: If you're unsure about your usage patterns, consider starting with ~$20 in API credits to test Claude Code with your typical workflows. This will help you determine whether the Claude Max subscription is worth the investment for your specific use case.

Disclaimer: The author uses Claude Max 5x.


Model Selection

Claude Code supports multiple models. You can specify which model to use:

Claude 4 Sonnet: Latest balanced performance and speed

export ANTHROPIC_MODEL="claude-sonnet-4-20250514"

Claude 4 Opus: Maximum capability for complex tasks

export ANTHROPIC_MODEL="claude-opus-4-20250514"

Claude 3.5 Haiku: Fastest and most cost-effective

export ANTHROPIC_MODEL="claude-3-5-haiku-20241022"
Important limitations: Claude 3.5 Haiku

While Haiku is cost-effective, it has significant limitations for Claude Code usage:

  • Reduced reasoning capabilities - Struggles with complex multi-step planning and architectural decisions
  • Limited context understanding - Less effective at analyzing large codebases and maintaining context across multiple files
  • Simplified code analysis - May miss subtle bugs, dependencies, or complex patterns that modern models catch
  • Basic refactoring only - Not suitable for sophisticated restructuring or feature implementations
  • Limited framework knowledge - Less effective with complex frameworks or novel coding patterns

Recommended use cases for Haiku:

  • Simple single-file edits
  • Basic syntax corrections
  • Quick code questions
  • Learning Claude Code basics before upgrading

For serious development work, Claude 4 Sonnet or Opus provide substantially better results and are worth the additional cost.

Alternative Method: You can also specify the model directly when starting Claude Code:

claude --model claude-sonnet-4-20250514
claude --model claude-opus-4-20250514
claude --model claude-3-5-haiku-20241022

Verification

Verify your installation by running:

claude --version

You should see the current version of Claude Code printed to the terminal.

Next: Head to the Getting Started section to learn about project setup and how to optimize Claude Code for your workflow.