Claude Code Quickstart
This guide takes you from an empty terminal to your first finished pull request. You'll install the native binary, complete terminal authentication, explore an existing repository, edit safely in Plan Mode, and verify your code.
Prerequisites & System Requirements
Claude Code operates locally on developer workstations and CI runners. Ensure your environment meets the minimum standards:
- Operating System: macOS 10.15+, Ubuntu 20.04+ (or equivalent Linux distro), or Windows 10+ via WSL2 or PowerShell.
- Git: Git 2.23+ installed and configured with your commit credentials.
- Authentication: An active Claude Pro, Team, or Enterprise subscription, or an Anthropic API key with billing enabled.
Step 1: Install the Native Binary
Anthropic provides single-binary native installers that manage auto-updates in the background. Pick your platform's command:
# macOS & Linux (recommended curl script) curl -fsSL https://claude.ai/install.sh | bash # macOS alternative via Homebrew brew install claude-code # Windows (PowerShell via WinGet) winget install Anthropic.ClaudeCodeStep 2: Authenticate Terminal Session
Once installed, launch Claude Code by typing claude into your shell:
claudeOn first run, Claude opens your default browser for OAuth verification. Sign in with your Claude account. If you are running in a headless container, remote SSH terminal, or CI runner, export your API key instead:
export ANTHROPIC_API_KEY="sk-ant-api03-..."Step 3: Open an Existing Project
Always start Claude Code from the root directory of your repository. Claude reads your project's CLAUDE.md file, detects test frameworks, checks git status, and loads auto-memory:
cd /path/to/my-project claudeStep 4: Explore the Codebase
Start with broad questions. Claude uses its fast native Grep and Glob tools to inspect files on demand rather than dumping the entire repository into context:
> give me an overview of this codebase > explain how user authentication works from API route to database > where are the primary database schema definitions stored?Step 5: Edit Safely with Plan Mode
When you want to inspect what Claude intends to change before any files on disk are touched, switch to Plan Mode. Press Shift+Tab in your interactive session, or start the session with:
claude --permission-mode planIn Plan Mode, the status indicator displays ⏸ plan mode on. Claude gathers context, reads files, and prints a step-by-step diff proposal. Once you approve the plan, Claude executes the file edits contiguously.
Step 6: Run Tests & Verify Code
Claude Code closes the feedback loop by running local verification commands. Hand Claude the error reproduction steps:
> run pnpm test and fix any failing unit tests in the auth moduleClaude parses the test failure stack traces, applies corrective edits, and re-runs the tests until all assertions pass.
Step 7: Commit & Create a Pull Request
When the changes are verified, ask Claude to prepare your pull request:
> summarize my changes and create a pull requestClaude runs git diff, writes a clean commit message following your repository conventions, and invokes gh pr create.
Essential Session Commands
| Command | Effect |
|---|---|
/clear | Resets conversation tokens while preserving project memory |
/compact | Summarizes history into a concise context block |
/rewind | Rolls back conversation and file changes to a prior turn |
/model | Switches active model (Opus, Sonnet, Haiku) |
/usage | Displays session token consumption and cache hit rates |
/exit | Closes the interactive Claude Code session |