Claude Code is Anthropic's terminal-based AI coding agent. It can read your codebase, edit files, run commands, and work with git directly. This article covers installation and initial setup.
🟢 Model references match the current lineup · model notice · Fable subscription
Fable 5 and 5.1 subscription (updated September 7, 2026): Claude Fable 5.1, released September 1, 2026, is the current Fable model and Fable 5 is now legacy. Plan terms are the same for both — Max and Team Premium plans include Fable at up to 50% of the weekly usage limit; Pro and Team Standard use usage credits (
New to it? See What is Claude Code? first to learn how it differs from a chatbot or autocomplete.
Before you install
- A paid Claude subscription or API credits: you can't use Claude Code on the free Claude.ai plan. You need a Claude Pro ($20/month) or higher subscription, or an Anthropic Console account with credits.
- (For npm install only) Node.js 22+ (since v2.1.198): the native install method doesn't require Node.js.
- Git (optional, recommended): used for version-control integration.
Method 1: native install (recommended)
This is Anthropic's currently recommended default. It needs no dependencies like Node.js and supports automatic background updates. Run the install script in a macOS/Linux/WSL terminal and the binary is installed on your PATH. Check the official docs (code.claude.com/docs) for the exact install command.
Method 2: npm install
Use this when npm is standard in your environment or you need to pin a specific version.
npm install -g @anthropic-ai/claude-code
As of v2.1.198 this package requires Node.js 22+. On an older version npm prints an EBADENGINE warning, but the install completes and claude still runs — the package downloads a native binary that doesn't use Node.js at runtime (official setup docs, September 2026).
Important: don't use sudo. If you get a permission error (EACCES), instead of sudo, point npm's global directory to a user folder (npm config set prefix '~/.npm-global') or use nvm. nvm installs Node.js in your home directory, eliminating permission problems at the source.
Windows users
On Windows, the WSL2 (Windows Subsystem for Linux) environment is recommended. It removes most compatibility issues and provides a proper Unix environment. Install Node.js inside the WSL terminal (not on the Windows side), and it's best to install nvm inside WSL.
Authentication
After install, running claude for the first time in a project directory connects to your Anthropic account via a browser-based OAuth flow. API-key authentication is also available for headless/server environments. In enterprise settings, deployment via Amazon Bedrock or Google Vertex AI is also supported.
Verify the install
claude --version
If a version number appears, the install succeeded.
Common install problems
claude: command not found: the npm global bin directory isn't on your PATH. Runnpm config get prefixand add its/binsubfolder to your shell PATH (after a native install, open a new terminal first).- Permission (EACCES) errors: don't use
sudo— it creates the ownership tangle it appears to solve. Runnpm config set prefix ~/.npm-globaland add~/.npm-global/binto your PATH, or install Node in your home directory with nvm. - WSL shows
node: not found: ifwhich nodeprints a path starting with/mnt/c/, Windows’ Node is bleeding into Linux. Install Node inside the distro via nvm or its package manager. - Not sure what’s wrong? Run
claude doctorfirst — it checks install path, auth, permissions, and Node version in one pass.
Node.js is not a system requirement in the official docs (September 2026); only the npm route asks for Node.js 22+. The native installer sidesteps Node, PATH, and permission issues entirely.
Recommended first step after install
Creating a CLAUDE.md file in your project root helps Claude Code understand the project context better. Writing down coding conventions, directory structure, and build/test commands makes a big difference in practice.
Learn more: control allow and deny rules and permission modes with Claude Code permissions.
Install commands and detailed options may change by version. Check Anthropic's official docs (code.claude.com/docs) for the latest.
See also: Claude Code IDE Setup (VS Code & JetBrains)
Related: Claude Code Pricing Explained: Plans, API Costs & Limits
Related articles
- How to Use Claude Code: Real Usage After Install (Commands, VS Code)
- What Is Claude Code? A Beginner's Intro to the Terminal AI Agent
- Claude Code Permissions: allow, ask, deny Rules and Modes
- Claude Code IDE Setup: Using VS Code and JetBrains (2026)
- Claude Code Skills (Agent Skills) Guide: Extend Claude with SKILL.md