What is Claude Code?
Anthropic’s AI-powered coding tool. From the terminal you instruct it in natural language to:
- Write and modify code across multiple files
- Run shell commands and analyze the output
- Author and run tests
- Make git commits and open PRs
- Debug, refactor, and review code
This guide covers the terminal CLI, but Claude Code also runs on the web, the desktop app, the VS Code and JetBrains extensions, Slack, and GitHub Actions / GitLab CI/CD.
Before you start
You’ll need:
- A terminal or command prompt
- A code project to work on
- One of:
- A Claude subscription (Pro, Max, Team, or Enterprise) — recommended
- A Claude Console account (prepaid-credit API access)
- A supported cloud provider (Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry)
The free claude.ai plan does not include Claude Code access.
System requirements
- Operating system: macOS 13.0+, Windows 10 1809+ or Windows Server 2019+, Ubuntu 20.04+, Debian 10+, Alpine Linux 3.19+
- Hardware: 4 GB+ RAM, x64 or ARM64 processor
- Network: internet connection required
- Shell: Bash, Zsh, PowerShell, or CMD
See the advanced setup docs for the current requirements.
Step 1 — Install
The official docs recommend Native Install, which automatically updates in the background.
Official quickstart: code.claude.com/docs/en/quickstart — always check the official docs first for the latest install commands and OS-specific differences.
macOS / Linux / WSL
curl -fsSL https://claude.ai/install.sh | bash
Windows (PowerShell)
irm https://claude.ai/install.ps1 | iex
Windows (CMD)
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
Git for Windows is recommended on native Windows so Claude Code can use the Bash tool. Without it, Claude Code uses PowerShell as the shell tool instead. WSL setups don’t need Git for Windows.
Homebrew (macOS / Linux)
brew install --cask claude-code
claude-code tracks the stable release channel; claude-code@latest tracks the latest channel. Homebrew installs don’t auto-update by default — run brew upgrade claude-code (or brew upgrade claude-code@latest) periodically.
WinGet (Windows)
winget install Anthropic.ClaudeCode
WinGet installs don’t auto-update by default either — run winget upgrade Anthropic.ClaudeCode periodically. To have Claude Code run the upgrade command for you on Homebrew or WinGet, set CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATE to 1: it upgrades in the background when a new version is available and shows a restart prompt.
npm
npm install -g @anthropic-ai/claude-code
The npm package requires Node.js 22 or later and installs the same native binary as the standalone installer. Don’t install with sudo. To upgrade, run npm install -g @anthropic-ai/claude-code@latest.
On Linux you can also install with apt, dnf, or apk.
Verify the install
Open a new terminal window and run the command below. A working installation prints a version number.
claude --version
Native Install auto-updates and is the simplest path. Pick Homebrew or WinGet only if you prefer those package managers and remember to upgrade.
Step 2 — Log in
Run claude to start an interactive session — you’ll be prompted to log in on first use.
claude
To switch accounts later or re-authenticate, type /login inside the running session.
/login
Supported account types:
- Claude Pro / Max / Team / Enterprise — recommended
- Claude Console — API access with pre-paid credits. On first login, a “Claude Code” workspace is automatically created in the Console for centralized cost tracking.
- Amazon Bedrock / Google Cloud’s Agent Platform / Microsoft Foundry — enterprise cloud providers
- Claude apps gateway — if your organization runs a self-hosted gateway, your admin pre-configures the gateway URL and
/loginopens directly on the Cloud gateway screen for you to sign in with corporate SSO
Once logged in, your credentials are stored and you won’t need to log in again.
Step 3 — Start your first session
cd into your project and run claude.
cd /path/to/your/project
claude
The Claude Code prompt appears with the version, current model, and working directory shown above it. /help lists available commands; /resume continues a previous conversation.
Step 4 — Ask your first question
Start with understanding the codebase.
What does this project do?
What technologies does this project use?
Where is the main entry point?
Claude reads your project files as needed — you don’t have to manually add context.
Step 5 — Make your first code change
Add a hello world function to the main file
Claude Code finds the appropriate file and shows you the change. If it asks before making the change, select Yes to approve.
The session’s permission mode sets which actions Claude can take without asking you first. Press Shift+Tab at any time to switch the permission mode of the session you’re in.
Step 6 — Use git
What files have I changed?
Commit my changes with a descriptive message
Create a new branch called feature/quickstart
Help me resolve this merge conflict
Step 7 — Fix a bug or add a feature
Describe what you want in natural language. Claude finds the relevant code, understands the context, implements a solution, and runs tests when available.
Add input validation to the user registration form
There's a bug where users can submit empty forms — please fix it
Step 8 — Try other workflows
Refactor the authentication module to use async/await instead of callbacks
Write unit tests for the calculator function
Update the README with installation instructions
Review my changes and suggest improvements
Essential commands
Shell commands, run from your terminal:
| Command | What it does |
|---|---|
claude | Start interactive mode |
claude "task" | Start interactive mode with an initial prompt |
claude -p "query" | Run one-off query, then exit |
claude -c | Continue most recent conversation in current directory |
claude -r | Resume a previous conversation |
Session commands, run inside Claude Code:
| Command | What it does |
|---|---|
/help | Show available commands |
/clear | Clear conversation history |
/resume | Continue a previous conversation |
/exit or Ctrl+D twice | Exit Claude Code |
Ctrl+C interrupts a running operation. If nothing is running, the first press clears the prompt input and a second press exits.
Full lists in the CLI reference and the commands reference.
Beginner tips
- Be specific — prefer “Fix the login bug where users see a blank screen after entering wrong credentials” over “fix the bug”
- Step-by-step instructions — break complex tasks into numbered steps
- Let Claude explore first — ask “analyze the database schema” before requesting changes
- Use shortcuts — type
/to see the commands and skills available to you, Tab for command completion, ↑ for command history,Shift+Tabto cycle permission modes,?on empty input for the shortcut help panel
Use CLAUDE.md for project context
A CLAUDE.md at the project root is auto-loaded into every session. Recommended contents:
- Project overview and tech stack
- Directory layout summary
- Common commands (build, dev, test)
- Code conventions and “do not” rules
See the Writing a Great CLAUDE.md guide for details.
Plan mode
For complex work, use Plan mode so Claude proposes a plan before touching code. Plan mode is one of the permission modes, so you enter and leave it by cycling modes with Shift+Tab. Review and approve before execution. See Using Plan Mode Well for details.
Next steps
- ccstatusline — show token usage, active model, and git branch in the status bar
- Superpowers — automate brainstorming, TDD, and systematic debugging workflows
- Installing Your First Plugin — practice the marketplace flow
- Skill vs Plugin vs MCP — understand the three extension types
- Official docs — Quickstart — the source for this guide