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:
| Environment | Practical path |
|---|---|
| macOS | Use the official installer or Homebrew if your team manages developer tools through Homebrew. |
| Windows | Use the official Windows path such as WinGet when available, or follow the current WSL guidance for Unix-like workflows. |
| Linux | Use the documented package manager path for your distribution, or npm if that is the official path for your setup. |
| CI or automation | Prefer 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 doctorIf 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.
- Open the project directory.
- Run
claude. - Complete the login or provider authentication flow.
- Ask Claude Code to inspect a small file first.
- Add a short
CLAUDE.mdonly 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.
Basic Usage
Learn the everyday Claude Code workflow: start a session, inspect a project, plan safely, edit code, run checks, and resume work.
Claude Code Architecture Analysis
Use Claude Code to map a codebase, understand boundaries, plan architecture changes, document decisions, and reduce refactor risk.