Claude · Setup

How to Install and Use Claude Code

Claude Code runs in your terminal rather than a chat window, which means it can read your actual files, run commands and make edits across a project. Installation is genuinely quick. The two things that trip people up are Node versions and reaching for sudo when npm complains about permissions, and the second causes more damage than the problem it appears to solve.

GPTPrompts.AI Editorial

Steps verified against the vendor's own documentation · Last updated August 2026

01 · The steps

Pick the route that matches your situation

Install with npm

Works on macOS, Linux and Windows. Check your Node version first.

  1. 1Check you have Node.js 18 or newer by running: node --version
  2. 2If Node is missing or too old, install it with nvm rather than a system package, so npm never needs root.
  3. 3Install the package @anthropic-ai/claude-code globally with npm, using the -g flag.
  4. 4Do not prefix that with sudo, even if npm suggests a permissions problem.
  5. 5Change into a project directory and run: claude
  6. 6Your browser opens for sign-in. Authorise the CLI against your Anthropic account.

If npm gives permission errors

The correct fix is to stop npm needing root, not to give it root.

  1. 1Install nvm, the Node version manager.
  2. 2Use nvm to install a current Node release, which places Node inside your home directory.
  3. 3Open a new terminal so the change takes effect.
  4. 4Run the install command again, still without sudo.

Your first session

  1. 1Open a terminal in the root of the project you want to work on.
  2. 2Run claude.
  3. 3Describe the task in plain language, for example asking it to find where a function is defined and explain what it does.
  4. 4Review any edit it proposes before accepting. It is an agent with file access, so read the diff.
  5. 5Use /help inside the session to see the available commands.

02 · Read this first

What most guides leave out

Never install it with sudo

If npm reports a permissions error, running the same command as root appears to fix it and quietly creates root-owned files in your npm directory that break later installs. Install Node through nvm instead, so your user owns everything.

The free Claude plan does not include it

Claude Code needs a paid plan, Pro, Max, Team or Enterprise, or an Anthropic Console account with API credits. Signing in with a free account will not grant access, which is the most common reason installation appears to succeed and then does not work.

It edits real files, so run it in version control

This is not a chat window suggesting code you copy across. It acts on your working directory. Use it inside a git repository with a clean tree, so every change it makes is visible in a diff and reversible.

npm is not the only install route

Anthropic also ships native installers, and which one is recommended has changed over time. If the npm route fights you, check Anthropic's current installation documentation rather than following an older blog post.

03 · Questions

Frequently asked questions

Is Claude Code free?

No. It requires a paid Claude plan such as Pro, Max, Team or Enterprise, or an Anthropic Console account with API credits. The tool itself is free to install, but it will not run against a free Claude account.

What is the difference between Claude Code and using Claude in a browser?

The browser version sees only what you paste. Claude Code runs in your terminal with access to your project, so it can read files across the codebase, run commands and apply edits directly. That is more capable and correspondingly more worth supervising.

Do I need to know the terminal to use it?

Enough to open one and change directory. Once running, you describe tasks in plain language rather than typing flags. The habit that matters more than terminal skill is reading the diff before accepting a change.

Which operating systems does it support?

macOS, Linux and Windows. The npm route is the same everywhere and needs Node.js 18 or newer, and native installers are also available, so check Anthropic's documentation for the current recommendation on your platform.

Sources

Menu names change. If a step no longer matches what you see, the vendor documentation above is the authority.

Keep going

Don't stop here

What to read next

Hand-picked guides our readers explore right after this one.