Claude Code setup

Claude Code Setup

Install Claude Code on Windows, macOS, Linux, or WSL; verify the CLI, sign in, connect a project, and configure safe repository instructions.

Last verifiedAugust 13, 2026
Quick answer

Use Anthropic's native installer for your operating system, verify with `claude --version` and `claude doctor`, then start `claude` inside a Git repository. Keep the first task read-only and add project-specific instructions only after Claude has correctly explained the codebase.

Requirements

  • macOS 13+, Windows 10 1809+, Windows Server 2019+, Ubuntu 20.04+, Debian 10+, or Alpine Linux 3.19+.
  • At least 4 GB RAM and an x64 or ARM64 processor.
  • Internet access and a supported Claude Code account or configured enterprise provider.
  • Git for Windows is optional on native Windows, but enables the Bash tool; WSL 2 supports sandboxed execution.

Quick setup

Install, verify, and open a project

macOS, Linux, or WSL
curl -fsSL https://claude.ai/install.sh | bash
Windows PowerShell
irm https://claude.ai/install.ps1 | iex
Verify
claude --version
claude doctor
Start in a project
cd path/to/your-project
claude

Step 1

Choose native Windows or WSL before installing

Install Claude Code in the same environment that owns your repository and toolchain. Mixing Windows Node, WSL paths, and Linux package managers creates avoidable PATH and permission errors.

  1. Use native Windows for Windows-native repositories, PowerShell tools, and files stored under C:\.
  2. Use WSL 2 for Linux toolchains, repositories stored under ~/code, or sandboxed command execution.
  3. On macOS or Linux, install from the terminal where Git, your package manager, and project commands already work.

Step 2

Install and verify the executable

The native installer is Anthropic's recommended route and updates automatically. Verification should prove both that the executable is on PATH and that its configuration is healthy.

Check PATH and version
claude --version
Run read-only diagnostics
claude doctor

Important: Do not run the Windows installer as Administrator. If you use npm instead, the current package requires Node.js 22+ and should not be installed with sudo.

Step 3

Authenticate from the environment you will use

Run `claude` and follow the browser login flow. Claude Code currently supports eligible Claude plans, Console accounts, and configured enterprise providers.

  1. Start Claude Code from the project terminal, not from an unrelated home directory.
  2. Complete the browser prompt and return to the same terminal.
  3. If an ANTHROPIC_API_KEY is already set, confirm that you intended to use that key before approving it.

Step 4

Connect one repository and test context

Before asking for edits, verify that Claude can find the entry points, build commands, tests, and important boundaries of the repository.

  1. Compare the explanation with the README, package scripts, and CI configuration.
  2. Correct missing or wrong assumptions before generating CLAUDE.md.
  3. Commit or stash existing work before allowing the first edit.
Safe first prompt
Explain this repository's entry points, test commands, and risky areas. Do not edit files.

Step 5

Add CLAUDE.md and narrow permissions

Repository instructions should contain real commands and boundaries, not a product description. Permission choices should match the task rather than remain permanently broad.

  1. Document install, development, test, lint, and build commands that actually pass in the repository.
  2. Name directories the agent may change and areas that require explicit approval.
  3. Use plan mode or read-only exploration for broad or unfamiliar work before permitting edits.
  4. Review the diff and rerun important checks outside the agent's own summary.

Step 6

Update without changing installation methods

Native installations update in the background. Package-manager installs use the update mechanism of that package manager.

Native manual update
claude update
WinGet
winget upgrade Anthropic.ClaudeCode
Homebrew stable channel
brew upgrade claude-code

Common setup errors

`claude` is not recognized or command not found

Open a new terminal, run `claude --version`, and use `claude doctor`. Confirm you installed inside the same environment you are launching from.

Windows shell commands behave unexpectedly

Confirm whether the prompt is PowerShell, CMD, Git Bash, or WSL. Native Windows can use PowerShell; Git for Windows enables Bash.

Claude sees the wrong files

Stop the session and reopen Claude from the repository root. Check ignore files and instruction scope before adding more context.

Next steps

All setup guides

Official sources

Commands and platform requirements were checked against the product documentation on August 13, 2026. Product setup changes; verify the official page before automating an installation across a team.