Installing Claude Code
- 1 Installing Claude Code
- 2 Using the Claude Code TUI
- 3 CLAUDE.md and Settings
- 4 Skills, Agents, and MCP Servers
- 5 Hooks
- 6 Plugins and Marketplaces
- 7 Agent Teams
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
- 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.
Native Installer (Recommended)
The simplest way to install Claude Code is the native installer. It downloads a standalone binary with no runtime dependencies.
On macOS and Linux:
On Windows (PowerShell):
The binary gets installed to ~/.local/bin/claude (or %LOCALAPPDATA%\Programs\claude on Windows).
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.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:
You should see the version number printed. You can also run the built-in diagnostic tool:
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:
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:
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.
Troubleshooting
If something isn’t working, claude doctor is your first stop. It diagnoses the most common issues automatically.
- “command not found” — Your PATH doesn’t include the install location. Check
~/.local/binis in your PATH. - Authentication failures — Try
claude logoutthenclaudeagain to re-authenticate. - Permission errors on install — Don’t use
sudowith 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.