Skill Locker
All posts
byJames Cooper

How to Install Claude Code: Step-by-Step Setup Guide

How to install Claude Code on macOS, Windows, or Linux in five minutes — the install command, per-platform notes, updating, uninstalling, and error fixes.

Claude CodeSetupGetting Started

If you want to install Claude Code and start using Anthropic's terminal coding agent, the whole process takes about five minutes on any platform. This guide covers the requirements, the exact install command, the per-platform notes for macOS, Windows (WSL), and Linux, how to authenticate, how to update and uninstall Claude Code later, and how to fix the handful of errors that trip people up — so you don't lose an hour to a PATH problem.

Requirements

Before you install Claude Code, you need:

  • Node.js 18 or newer. Check with node --version. If it's missing or old, install it via nodejs.org or a version manager like nvm.
  • A terminal. macOS Terminal, any Linux shell, or — on Windows — WSL (Windows Subsystem for Linux) is strongly recommended over native PowerShell.
  • An Anthropic account. Either a Claude Pro/Max subscription or API credits. You authenticate after install.

The install command

Claude Code installs as a global npm package:

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

That's the entire installation. Verify it worked:

claude --version

If you see a version number, you're done installing. If you see "command not found," skip to the troubleshooting section below — it's almost always a PATH issue and it's quick to fix.

Installing Claude Code on macOS, Windows, and Linux

The npm install -g command above is the canonical method on every platform. The only differences are how you get Node.js and which terminal you use.

macOS

Install Node.js 18+ (via nodejs.org, or brew install node if you use Homebrew, or nvm), then run the npm install command in Terminal or iTerm. Nothing macOS-specific beyond that.

Windows

Use WSL (Windows Subsystem for Linux), not native PowerShell or CMD. Claude Code is a terminal-first tool built around a Unix-style shell; WSL avoids a whole class of path and shell issues. Install WSL (wsl --install in an admin PowerShell), open your WSL distro, install Node.js inside it, then run the npm install command there. Treat everything from that point on as Linux.

Linux / Ubuntu

Install Node.js 18+ (your distro's package manager, or nvm to avoid sudo), then run the npm install command. Ubuntu, Debian, Fedora, Arch — all identical once Node is present. If you hit permission errors, that's a Node-ownership problem, not a Linux problem — see troubleshooting.

Can you install Claude Code with Homebrew?

People search for this, so the honest answer: the officially supported install path is npm (npm install -g @anthropic-ai/claude-code). If a Homebrew formula or other third-party package exists, it's community-maintained and can lag behind releases or miss the auth flow. For a tool that updates frequently, stick with the official npm method — it's one command and it's always current.

First run and authentication

Navigate into any project and start it:

cd your-project
claude

On first run, Claude Code walks you through authentication. You have two options:

  • Subscription: log in with your Anthropic account. Claude Pro is $20/month, Max is $100/month. Usage is included in the plan.
  • API key: pay per token via the Anthropic API. Better for occasional use or automation.

Pick whichever matches how you'll use it. You can change this later.

Installing the IDE extension (optional)

Claude Code also ships as an extension for VS Code, Cursor, and JetBrains IDEs. The terminal tool and the extension share the same engine — the extension just adds an in-editor panel. Install it from your IDE's extension marketplace by searching "Claude Code." You don't need the extension to use Claude Code; the terminal version is fully featured.

Verify everything works

Run a trivial task to confirm the install and auth are good:

claude
> What files are in this project?

If Claude lists your project files, the installation, authentication, and file access are all working. You're ready to go.

Troubleshooting common install errors

These are the issues people actually hit, in rough order of frequency.

"command not found: claude"

Your global npm bin directory isn't on your PATH. Find it with:

npm config get prefix

Add <that path>/bin to your shell profile (~/.zshrc, ~/.bashrc, or equivalent), then restart the terminal. This is the single most common install problem.

Permission errors (EACCES) during install

Don't fix this with sudo — that creates worse permission problems later. Instead, use a Node version manager (nvm, fnm, or volta) so npm installs into a directory you own. Reinstall Node through the manager, then re-run the install command.

Old Node.js version

If node --version shows below 18, Claude Code won't run correctly. Upgrade Node — via nvm install --lts if you use nvm — and reinstall.

Authentication keeps failing

Confirm your Anthropic account has an active subscription or API credits. If you're behind a corporate proxy or VPN, that can block the auth flow — try from a normal network to isolate the cause.

How to update Claude Code

The reliable, platform-independent update command is the same as install with @latest:

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

Claude Code also tends to keep itself current and may prompt you when a new version is available, so in practice you rarely need to update manually. Either way, confirm with claude --version afterwards. If a version looks stuck, the npm command above force-refreshes it.

How to uninstall Claude Code

Remove the global package:

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

That removes the tool itself. Your configuration and any installed skills live separately in the ~/.claude/ directory — leave that alone if you might reinstall, or delete it for a completely clean removal (you'll lose your skills and settings, so back them up first if they matter).

What to do next

Once Claude Code is running, the difference between casual and power users comes down to configuration:

That small upfront investment pays back on every conversation.

FAQ

How do I install Claude Code?

Install Node.js 18+, then run npm install -g @anthropic-ai/claude-code. Verify with claude --version, then run claude inside a project and follow the authentication prompts. The whole process takes about five minutes.

Is Claude Code free to install?

The tool itself is free to install. To use it you need either a Claude Pro ($20/mo) or Max ($100/mo) subscription, or pay-as-you-go Anthropic API credits. There's no separate charge for Claude Code.

Does Claude Code work on Windows?

Yes, but use WSL (Windows Subsystem for Linux) rather than native PowerShell for the smoothest experience. Install WSL, then follow the standard Linux install steps inside it.

Why does my terminal say "claude: command not found"?

Your global npm bin directory isn't on your PATH. Run npm config get prefix, add the resulting /bin path to your shell profile, and restart the terminal. This is the most common install issue.

Do I need an IDE to use Claude Code?

No. Claude Code is a terminal tool and works with any editor or none. An optional IDE extension exists for VS Code, Cursor, and JetBrains, but it's not required.

What Node.js version does Claude Code need?

Node.js 18 or newer. Check with node --version. If it's older, upgrade through a version manager like nvm before installing, to avoid permission problems.

How do I install Claude Code on Mac?

Install Node.js 18+ (nodejs.org, brew install node, or nvm), then run npm install -g @anthropic-ai/claude-code in Terminal. There's nothing macOS-specific beyond having Node present.

How do I install Claude Code on Windows?

Use WSL, not native PowerShell. Run wsl --install, open your WSL distro, install Node.js 18+ inside it, then run the npm install command there. From that point it behaves exactly like Linux.

How do I install Claude Code on Linux or Ubuntu?

Install Node.js 18+ via your package manager or nvm, then run npm install -g @anthropic-ai/claude-code. It's identical across Ubuntu, Debian, Fedora, and Arch once Node is available.

Can I install Claude Code with Homebrew?

The officially supported method is npm. Any Homebrew or third-party package is community-maintained and may lag releases — for a frequently-updated tool, the official npm command is the safer choice.

How do I update Claude Code?

Run npm install -g @anthropic-ai/claude-code@latest, then check claude --version. It often updates itself or prompts you, so manual updates are rarely needed.

How do I uninstall Claude Code?

Run npm uninstall -g @anthropic-ai/claude-code. Config and skills live in ~/.claude/ — delete that too for a fully clean removal, but back it up first if your skills or settings matter.

Ready to go further

Installation is the easy part. The leverage comes from configuring Claude Code for your workflow — skills, CLAUDE.md, and good prompting habits.

Browse the skill library →

Ready to supercharge Claude Code?

296 pre-built skills across 33 categories. One purchase, lifetime updates.

Browse skills