Getting started

Installation & Setup

Install Claude Code with the current official setup paths, verify authentication, and prepare your first project safely.

This guide focuses on the current Claude Code setup flow: install from an official method, verify the claude command, confirm authentication, and start in a small project before giving Claude Code broad tool access.

Choose an Installation Method

Claude Code supports multiple setup paths. Use the one that matches your operating system and team policy:

EnvironmentPractical path
macOSUse the official installer or Homebrew if your team manages developer tools through Homebrew.
WindowsUse the official Windows path such as WinGet when available, or follow the current WSL guidance for Unix-like workflows.
LinuxUse the documented package manager path for your distribution, or npm if that is the official path for your setup.
CI or automationPrefer explicit versions and a locked environment instead of relying on whatever a local machine has installed.

Authentication Is Not Always an API Key

Do not treat ANTHROPIC_API_KEY as a mandatory installation prerequisite. Claude Code can be used through different authentication paths, including Claude subscription login, Claude Console/API, team or enterprise workspaces, and provider-based setups.

Use /status after login to confirm which account or credential Claude Code is using. If an ANTHROPIC_API_KEY is set in your shell, Claude Code may use API authentication, which can affect billing and usage tracking.

Verify The CLI

After installation, open a new terminal and run:

claude --version
claude doctor

If claude is not found, restart the terminal and check whether the install directory is in PATH. On Windows, make sure you are testing in the same environment where you installed Claude Code, such as PowerShell, CMD, Git Bash, or WSL.

Prepare The First Project

Start in a small repository before using Claude Code on a production codebase.

  1. Open the project directory.
  2. Run claude.
  3. Complete the login or provider authentication flow.
  4. Ask Claude Code to inspect a small file first.
  5. Add a short CLAUDE.md only after you know the project commands and boundaries.

Create A Focused CLAUDE.md

Use CLAUDE.md for durable project context, not for every idea about the codebase.

# CLAUDE.md

## Project Commands

- npm run build: build the app
- npm run test: run tests
- npm run lint: run lint checks

## Working Rules

- Prefer small, reviewable changes.
- Run tests before summarizing implementation work.
- Ask for a plan before touching auth, payments, or deployment.

Configure Permissions Conservatively

On the first session, keep permissions narrow. Allow read and search tools freely, then approve edit and shell tools when the task needs them.

For larger work, review:

Official Sources


Next: Basic Usage - Learn basic Claude Code operations.