Skip to main content
Claude Code requires Node.js 18+ and is available through multiple installation methods.
Installation via npm is deprecated. Use one of the recommended methods below for the best experience.

Prerequisites

  • Node.js 18 or higher: Required for running Claude Code
  • Git: Required for repository operations and version control features
  • Terminal: Command line access (bash, zsh, PowerShell, etc.)

Installation Methods

The recommended installation method uses our installation script:
curl -fsSL https://claude.ai/install.sh | bash
This method automatically detects your system and installs the appropriate version.

Homebrew (macOS / Linux)

If you prefer package managers:
brew install --cask claude-code
For Windows, use our PowerShell installation script:
irm https://claude.ai/install.ps1 | iex

WinGet (Windows)

Alternatively, use the Windows Package Manager:
winget install Anthropic.ClaudeCode

NPM (Deprecated)

NPM installation is deprecated and will be removed in a future version. Use one of the recommended methods above.
If you still need to use npm:
npm install -g @anthropic-ai/claude-code

Verification

After installation, verify Claude Code is installed correctly:
claude --version
You should see the version number displayed.

First Run

Navigate to your project directory and run:
claude
On first run, Claude Code will:
  1. Prompt you to authenticate with your Anthropic account
  2. Initialize your project configuration
  3. Start an interactive session

Authentication

Claude Code supports multiple authentication methods:
# Claude will open your browser for authentication
claude
If the browser doesn’t open automatically during OAuth, press c to copy the URL and paste it into your browser.

Platform-Specific Notes

macOS

Permissions: You may need to grant terminal permissions in System Preferences > Security & Privacy. Gatekeeper: On first run, macOS may block the executable. Go to System Preferences > Security & Privacy and click “Allow Anyway.”

Linux

glibc Compatibility: Claude Code requires glibc 2.30 or later. For older systems (e.g., RHEL 8), use the npm installation method. Permissions: Ensure the installation directory is in your PATH:
export PATH="$HOME/.claude/bin:$PATH"
Add this to your ~/.bashrc or ~/.zshrc for persistence.

Windows

PowerShell Execution Policy: You may need to allow script execution:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Git Bash: Claude Code works with Git Bash, PowerShell, and Command Prompt. WSL2: For WSL2 users, follow the Linux installation instructions within your WSL environment.

Installation Locations

Claude Code installs to the following default locations:
PlatformInstallation Path
macOS (script)~/.claude/bin/claude
macOS (Homebrew)/usr/local/bin/claude
Linux~/.claude/bin/claude
Windows%LOCALAPPDATA%\Programs\ClaudeCode

Configuration Files

After installation, Claude Code creates configuration files:
~/.claude/
├── config.json              # Global configuration
├── settings.json            # User settings
├── managed-settings.json    # Enterprise settings
└── backups/                 # Configuration backups
Project-specific configuration lives in:
project-root/
└── .claude/
    ├── settings.json        # Project settings
    ├── settings.local.json  # Local overrides
    ├── commands/            # Custom slash commands
    ├── agents/              # Custom agents
    ├── skills/              # Custom skills
    └── hooks/               # Event hooks

Update Management

Claude Code automatically checks for updates and can update itself:
# Check for updates
claude doctor

# View update channel (stable or latest)
claude config
Update channels can be configured in settings. The stable channel receives tested releases, while latest gets new features faster.

Shell Completion

Enable shell completion for better CLI experience:
# Add to ~/.bashrc
eval "$(claude completion bash)"

Troubleshooting

Installation Fails

Issue: Installation script fails or hangs Solutions:
  • Check internet connection
  • Verify Node.js 18+ is installed: node --version
  • Try alternative installation method (Homebrew, WinGet)
  • Check firewall/proxy settings

Command Not Found

Issue: claude: command not found after installation Solutions:
  • Restart your terminal
  • Check PATH includes Claude installation directory
  • For manual installations, add to PATH:
    export PATH="$HOME/.claude/bin:$PATH"
    

Authentication Issues

Issue: OAuth redirect doesn’t work Solutions:
  • Press c to copy URL manually
  • Check browser settings allow opening localhost URLs
  • Use API key authentication instead:
    export ANTHROPIC_API_KEY=your_key
    

Performance Issues

Issue: Claude Code is slow to start Solutions:
  • Use simple mode for faster startup:
    export CLAUDE_CODE_SIMPLE=true
    
  • Check MCP server connections (may slow startup)
  • Review plugin configurations

System-Specific Issues

Run claude doctor to diagnose common issues. It checks installation method, version, configuration, and permissions.

Uninstallation

To remove Claude Code:
rm -rf ~/.claude
# Remove from PATH in ~/.bashrc or ~/.zshrc
Uninstalling removes all global configuration. Project-specific .claude/ directories in your repositories are not affected.

Next Steps

Quickstart

Get started with your first commands

Configuration

Customize settings and permissions

CLI Reference

Learn all available CLI commands

Core Concepts

Understand how Claude Code works

Build docs developers (and LLMs) love