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.
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
curl -fsSL https://claude.ai/install.sh | bashirm https://claude.ai/install.ps1 | iexclaude --version
claude doctorcd path/to/your-project
claudeStep 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.
- Use native Windows for Windows-native repositories, PowerShell tools, and files stored under C:\.
- Use WSL 2 for Linux toolchains, repositories stored under ~/code, or sandboxed command execution.
- 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.
claude --versionclaude doctorImportant: 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.
- Start Claude Code from the project terminal, not from an unrelated home directory.
- Complete the browser prompt and return to the same terminal.
- 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.
- Compare the explanation with the README, package scripts, and CI configuration.
- Correct missing or wrong assumptions before generating CLAUDE.md.
- Commit or stash existing work before allowing the first edit.
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.
- Document install, development, test, lint, and build commands that actually pass in the repository.
- Name directories the agent may change and areas that require explicit approval.
- Use plan mode or read-only exploration for broad or unfamiliar work before permitting edits.
- 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.
claude updatewinget upgrade Anthropic.ClaudeCodebrew upgrade claude-codeCommon 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
Turn the installation into a controlled workflow.
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.