Skip to main content
← All setup guides

Anthropic · Setup guide

How to set up Claude Code

Install Claude Code beside the editor you already use, authenticate once, and start with a read-only repository explanation before asking for a patch. Written for first-time terminal users as well as experienced developers.

Claude Code

terminal · checked August 14, 2026

~10 minBeginner

The “Open Claude Code” link goes to the vendor site. It is not an affiliate-tracked link on this page — no commission is claimed for that click. Affiliate disclosure.

Critical: finish install before closing the window

Keep the installer terminal open until you see a success message. If you used an admin window, do not close it until verification works. Then open a new Terminal or PowerShell window and run the verify step — PATH updates rarely apply to shells that were already open, especially on Windows.

Before you begin

  • macOS, Linux, WSL, or Windows PowerShell.
  • A terminal and a project directory you can safely inspect.
  • Git for Windows is recommended when using native Windows.
  • A Claude subscription or Anthropic Console account for sign-in.

Authentication

Browser sign-in on first launch

Account: Claude Pro/Max/Team/Enterprise or Anthropic Console access

Free Claude.ai does not include Claude Code. If ANTHROPIC_API_KEY is set, usage can bill API credits instead of your subscription — prefer subscription login for plan-included usage.

Install or open it

1. Get the harness ready

These steps are written for beginners. On Mac, Terminal is the black/white text window where you type commands. On Windows, use PowerShell or Terminal. Use the OS tabs to hide steps that are not for your computer, then copy one command at a time.

  1. 01

    Open Terminal on a Mac

    Mac

    Click the Spotlight search icon (magnifying glass) at the top-right of the menu bar, or press Command (⌘) + Space. Type Terminal and press Return. A text window opens — that is where you paste the install commands below. Leave it open.

  2. 02

    Open Terminal or PowerShell on Windows

    Windows

    Press the Windows key, type Terminal or PowerShell, then press Enter. Use that window for the commands below. If Windows asks for permission to run a script or install software, read the prompt before approving.

  3. 03

    How to paste a command

    Copy one command at a time from this page. Click inside the terminal window, paste (Mac: ⌘+V, Windows: Ctrl+V or right-click → Paste), then press Return / Enter. Wait until the prompt comes back before running the next command. You do not need to type the leading $ if you see one in other docs.

  4. 04

    Do not close the installer until verified

    Keep the installer terminal (or admin PowerShell) open until the install finishes without errors. Closing early can leave a half-written binary or an incomplete PATH update — especially on Windows.

  5. 05

    Open a new terminal after installers

    PATH updates often only apply to new shells — especially on Windows. Do not close the install session until the installer finishes, then open a fresh Terminal/PowerShell before running --version checks.

  6. 06

    Inspect before you pipe an installer

    Commands like curl … | bash download and run a script immediately. Prefer the official package manager when offered. If you use a curl installer, you can download the script first, open it in a text editor, then run it — never paste installers from random blogs.

  7. 07

    Install the CLI (Mac / Linux / WSL)

    Paste this into Terminal and press Return. The native installer puts Claude Code under your home directory (often ~/.local/bin) and does not need sudo — if a guide tells you to sudo the installer, ignore it. On Linux or WSL, use the same command.

    bash
    curl -fsSL https://claude.ai/install.sh | bash

    You should see: The installer finishes without an error. Open a new terminal before the verify step so PATH updates apply.

    If this fails
    • The install command errors, or the next verify step says “command not found”. Re-run the official install command with network access, then open a brand-new terminal window before verifying.
    Claude Code setup
  8. 08

    Install on Windows (PowerShell)

    Windows

    Do not run the Mac/Linux install.sh from Git Bash — it rejects that environment. In PowerShell, paste the official Windows installer, then open a new terminal so PATH updates. Git for Windows is recommended so the Bash tool works.

    powershell
    irm https://claude.ai/install.ps1 | iex

    You should see: The installer finishes without an error. Open a new terminal before the verify step so PATH updates apply.

    If this fails
    • The install command errors, or the next verify step says “command not found”. Re-run the official install command with network access, then open a brand-new terminal window before verifying.
    Claude Code setup
  9. 09

    Verify the command

    Close Terminal and open a new window. If you see a version number, install worked. If you see “command not found”, confirm ~/.local/bin (or %USERPROFILE%\.local\bin) is on PATH, or run claude doctor.

    bash
    claude --version

    You should see: A version number. If you see “command not found”, open a new terminal and check PATH (or run claude doctor).

    If this fails
    • The shell cannot find claude after installation. Open a new terminal, confirm ~/.local/bin or %USERPROFILE%\.local\bin is on PATH, then run claude --version or claude doctor.
    Claude Code quickstart

Repository or project

2. Start in the right place

Keep the first repository small, clean, and easy to roll back while you learn the harness’s permissions and context model.

  1. 01

    Open the repository

    Start in a clean working tree or a disposable branch so the first run is easy to review.

    bash
    cd path/to/your-repository

    You should see: The prompt shows you are inside the intended folder (check with `pwd`).

    If this fails
    • “No such file or directory” or you are still in your home folder. Create or clone the practice folder first, then `cd` into it before starting the tool.
  2. 02

    Start a session

    Run Claude Code from the repository root and complete the sign-in prompt. From 2026-08-14, new Pro/Max/Team sessions default to Auto (classifier-gated autonomy); Enterprise and API remain opt-in for now. For a safe first pass, Shift+Tab to Manual or Plan before broader edits.

    bash
    claude

    You should see: The tool starts in this folder and waits for your first prompt (or shows a short first-run / sign-in screen).

    If this fails
    • Nothing happens, or you land in the wrong folder. Confirm you are inside the practice repo (`pwd`), that you signed in, and that you opened a new terminal after install.

First run

Ask for a map before a modification

Use this task to test the workflow before handing over a larger repository or production responsibility.

  1. 01Even if Auto is the new default on Pro/Max/Team (from 2026-08-14), Shift+Tab to Manual or Plan for the first orientation and ask: explain this repository’s main entry points, test command, and deployment boundary.
  2. 02Do not edit files or run commands that change state until you have reviewed the map.
  3. 03Ask the agent to identify three files worth reading next.

Why this is safe: Auto is safer than skipping permissions entirely, but a read-first Manual/Plan pass still verifies understanding before write or shell work. Classifier overhead on Pro/Max/Team is no longer billed (from 2026-08-07).

Stop and review if

  • The agent proposes deleting, migrating, or rewriting files before explaining the plan.
  • The repository contains secrets or production credentials in the working tree.
  • The tool asks for broader permissions than the task requires.

The operating boundary

Privacy, data, and cost

The setup is incomplete until you know what the harness can see, what account pays for it, and who approves a risky action.

Privacy

Consumer Claude accounts may allow training unless you opt out; Team/Enterprise typically default to no training on inputs — confirm live Anthropic controls for your plan. Claude Code still sends prompts and repo context for inference. Enterprise can enable Inference hooks (beta) for org-controlled DLP before prompts reach the model.

Training on code: tier dependent

Availability and retention can depend on the account, organisation, and provider terms.

Sensitive repos: Use a sanitized clone for the first run, remove secrets, and confirm the organisation policy before connecting a sensitive repository.

Pricing

Primary path: Claude Pro/Max/Team/Enterprise includes Claude Code with shared usage allowance alongside Claude chat. Alternate path: Anthropic Console / API pay-as-you-go. Auto-mode classifier overhead is no longer billed on Pro/Max/Team (effective 2026-08-07).

Model: hybrid

Watch out: Long agent loops still burn the shared allowance or API credits. An exported ANTHROPIC_API_KEY can silently switch you off subscription billing. From 2026-08-14 Auto is the default for new Pro/Max/Team sessions (classifier free on those plans). +50% weekly boost ends 2026-08-19 23:59 PT. Enterprise privacy: Claude Code under a BAA requires ZDR — and ZDR blocks Covered Models (e.g. Fable 5); you cannot have BAA-covered Code and Covered Models at once.

Estimate a seat stack

When setup goes wrong

  • The shell cannot find claude after installation.

    Open a new terminal, confirm ~/.local/bin or %USERPROFILE%\.local\bin is on PATH, then run claude --version or claude doctor.

  • The first session opens the wrong account or bills API credits.

    Run claude logout / claude login with the subscription account, and unset ANTHROPIC_API_KEY if you intended plan-included usage.

  • Local / self-hosted backends hang, spam retries, or exhaust macOS network sockets.

    Claude Code may keep retrying telemetry against a local server. For air-gapped or llama.cpp-style backends, set CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 (and confirm current Anthropic local-proxy docs). Point Claude Code at an Anthropic Messages–compatible endpoint — not an OpenAI /v1 door meant for OpenCode.

  • The agent wants to make a broad change immediately.

    Shift+Tab to Manual or Plan, ask for a plan and file list, then restart from a clean branch with narrower permissions.

  • You need a sandbox on Windows.

    Native Windows Claude Code does not provide the Linux-style sandbox. Use WSL2 and install/run Claude Code inside Linux if you need sandbox isolation.

Next steps

After the first successful run

Keep the pilot small, then compare surfaces and budget before a team rollout.

Setup details change quickly. The page was checked August 14, 2026; use the official source below before installing in a managed or production environment.