← Back to all guides

Installing Claude Code

─────────────────────────────────────────

What is Claude Code?

Claude Code is Anthropic’s official CLI and terminal interface for Claude. It runs directly in your terminal, can read and modify files, execute commands, and work through multi-step software engineering tasks. Think of it as having a capable pair programmer living in your shell.

This guide covers getting it installed and authenticated. If you’re already set up and want to learn how to actually use it, skip ahead to Using the Claude Code TUI.

Prerequisites

Before installing, make sure your system meets the requirements:

  • macOS 13.0 (Ventura) or later
  • Ubuntu 20.04 or later (other Linux distros with glibc 2.31+)
  • Windows 10 build 1809 or later
  • RAM: 4GB minimum
You'll need one of these to use Claude Code
  • Anthropic subscription — Claude Pro, Claude Max, or a Teams/Enterprise plan. Usage resets every 5 hours, with a weekly limit.
  • Anthropic API key — Pay-per-token billing through the Anthropic API. Good for CI/CD and automation.
  • Third-party provider — Claude Code supports other Anthropic-compatible APIs (e.g. AWS Bedrock, Google Vertex, GLM, OpenRouter, Ollama). We’ll cover this in a later guide in this series.

The simplest way to install Claude Code is the native installer. It downloads a standalone binary with no runtime dependencies.

On macOS and Linux:

bash
×
curl -fsSL https://claude.ai/install.sh | bash

On Windows (PowerShell):

pwsh
×
irm https://claude.ai/install.ps1 | iex

The binary gets installed to ~/.local/bin/claude (or %LOCALAPPDATA%\Programs\claude on Windows).

Windows users: consider WSL
If you run into issues with the native Windows install, Claude Code also works great under WSL (Windows Subsystem for Linux). Just use the Linux install command from within your WSL terminal.
What about npm or bun install?
You can also install Claude Code via bun install -g @anthropic-ai/claude-code or npm, but I don’t recommend either. The npm method is being deprecated, and the bun method doesn’t support auto-updates. The native installer uses a bun-built binary under the hood anyway, so you’re not missing out on anything — you just get auto-updates on top.
PATH and shell restart
The installer adds the binary location to your PATH automatically, but you may need to restart your shell or open a new terminal for the change to take effect. If claude isn’t found after installing, try source ~/.bashrc (or your shell’s equivalent) or just open a new terminal.

Verifying the Installation

Once installed, confirm everything is working:

bash
×
claude --version

You should see the version number printed. You can also run the built-in diagnostic tool:

bash
×
claude doctor

This checks your environment for common issues — missing dependencies, PATH problems, authentication status, and more.

Authentication

The first time you run claude, it will walk you through authentication interactively. You’ll be prompted to log in via your browser with your Anthropic account. This covers the subscription and API key options mentioned in the prerequisites above.

For CI or non-interactive environments, export your API key before running Claude:

bash
×
export ANTHROPIC_API_KEY="sk-ant-..." claude -p "run the test suite and report results"

Updates and Release Channels

Claude Code checks for updates automatically and will notify you when a new version is available. You can also update manually:

bash
×
claude update

There are two release channels:

  • latest — The default. Gets new features and improvements as they ship.
  • stable — Lags behind latest, prioritises stability over new features.

You can switch channels with claude update --channel stable or claude update --channel latest.

Stick with latest
I’d recommend sticking with latest unless you hit bugs that are blocking your work. New model support lands on latest first — when Anthropic releases a new Claude model, being on latest means you get access to it straight away rather than waiting for it to roll into stable.

Troubleshooting

If something isn’t working, claude doctor is your first stop. It diagnoses the most common issues automatically.

Common issues
  • “command not found” — Your PATH doesn’t include the install location. Check ~/.local/bin is in your PATH.
  • Authentication failures — Try claude logout then claude again to re-authenticate.
  • Permission errors on install — Don’t use sudo with the native installer. It installs to your home directory by design.
  • Old Node.js version — If using bun/npm install, make sure you have Node.js 18 or later.

What’s Next

You’ve got Claude Code installed and authenticated — now it’s time to learn how to actually use it. The next guide in this series covers the TUI: modes, shortcuts, slash commands, and the permission system.

Using the Claude Code TUI →