Install Command Generator

The exact command to install Claude Code on your machine.

  • $15 Free
  • 20 sec
  • No signup
1

Pick your OS and package manager

2

See the exact install + auth commands

3

Copy and run - you're set up

You get: A copy-paste install script for your exact OS and package manager.

Your machine

Operating system
Install method

Install script

# Native install for macOS
curl -fsSL https://claude.ai/install.sh | bash

# Start Claude Code (authenticate in the browser on first run)
claude

# Verify the install
claude --version
claude doctor

Run these in your terminal. On first launch Claude Code opens your browser to authenticate. Confirm the exact install URL against Anthropic's official docs before running scripts from the web.

Two ways to install Claude Code

There are two mainstream ways to get Claude Code onto a machine. The native installer is a single command that downloads a self-contained build - it does not require Node.js and it manages its own updates. The npm route installs the @anthropic-ai/claude-code package globally, which is handy if you already live in a Node toolchain and want the CLI managed alongside your other global packages. The generator above picks the right command for your OS and preferred method, then adds the verify step so you know it worked.

Whichever route you choose, the flow is the same after install: run claude, authenticate in the browser on first launch, and you are working. The verify commands - claude --version and claude doctor - confirm the binary is on your PATH and that its environment checks pass.

Picking the right method for your OS

  • macOS - the native curl installer is the simplest path and needs no Node. If you already manage tools with npm, the global npm package works just as well.
  • Linux - same as macOS: native curl script or npm global. The native build avoids a Node dependency entirely.
  • Windows via WSL - treat it like Linux. Run the install inside your WSL distribution, not in Windows itself, so the tools operate on your Linux filesystem.
  • Windows native - use the PowerShell installer. Running inside WSL is still the smoother experience for most developers, but the native path exists when you need it.

Only pipe scripts you trust

Piping a remote script into bash or PowerShell runs whatever that URL serves. Confirm the install URL against Anthropic's official documentation before running it, and prefer the official domain over any mirror.

The npm route and Node versions

If you install via npm, you need a reasonably modern Node.js - version 18 or newer is the safe floor. Install globally with npm install -g @anthropic-ai/claude-code, then run claude. If you hit a permissions error on the global install, that is usually a sign your npm global prefix points at a system directory; using a Node version manager fixes it cleanly and avoids reaching for sudo, which you should not need.

Verifying the install

After installing, run claude --version to confirm the binary is found and to see which version you are on. Then run claude doctor, which checks your environment - PATH, auth state, and common misconfigurations - and reports anything that needs attention. If doctor is happy and version prints, you are ready. If claude is not found, your shell likely needs a restart so it picks up the new PATH entry.

Authentication on first run

Installation and authentication are separate steps. The install just puts the CLI on disk. The first time you run claude, it opens your browser to sign in and link the CLI to your account. You do not paste an API key into a config file for normal interactive use - the browser flow handles it. Once authenticated, the session persists, so you only do this once per machine.

Updates and keeping current

  1. The native installer keeps itself up to date automatically by default, so you generally do not have to think about it.
  2. If you installed via npm, update with npm update -g @anthropic-ai/claude-code when you want the latest.
  3. To pin a version and stop auto-updates, set DISABLE_AUTOUPDATER in your environment - the generator adds this line when you toggle it off.
  4. Run claude doctor after any update if something feels off; it surfaces environment issues fast.

If something goes wrong

The most common install snag is claude not being found after install - almost always a stale shell that has not reloaded PATH. Open a new terminal and try again. On npm installs, a permissions error on the global directory means your npm prefix is pointing somewhere it should not; switch to a Node version manager rather than running the install with sudo. Beyond that, claude doctor is the first thing to run - it names the specific problem more often than not.

Frequently asked questions

  • Do I need Node.js to install Claude Code?

    Not for the native installer - it ships a self-contained build. You only need Node.js 18 or newer if you choose the npm global install method instead.

  • Should I install on Windows directly or in WSL?

    WSL is the smoother path for most developers, since the tools then operate on a Linux filesystem. A native PowerShell installer exists if you specifically need to run outside WSL.

  • How do I check the install worked?

    Run claude --version to confirm the binary is on your PATH, then claude doctor to validate your environment. If both look good, you are ready to start a session.

  • How do I authenticate?

    Just run claude. On first launch it opens your browser to sign in and links the CLI to your account. For normal interactive use you do not paste an API key into a config file.

  • claude: command not found - what do I do?

    Almost always a shell that has not reloaded its PATH after install. Open a fresh terminal and try again. If it persists, confirm the install directory is on your PATH.

  • How do I update or pin the version?

    The native installer auto-updates by default. For npm installs, run npm update -g @anthropic-ai/claude-code. To stop auto-updates, set DISABLE_AUTOUPDATER in your environment.

Liked this tool? The club is the next step.

Join Claude Code Club for $9/month. 650+ lessons, weekly updates, and the workflows behind every tool on this site.

  • No experience needed
  • Cancel anytime
  • Updated weekly