Getting Started with Claude Code
Claude Code is a command-line tool. Installation takes a few minutes. This page walks through install, authentication, first session, and what to expect from the permission prompts.
Prerequisites
- Node.js 18+ — Claude Code is distributed as an npm package
- An Anthropic API key — or you can authenticate via Claude.ai (for subscribers on Pro/Max)
- A terminal — Claude Code runs in any Unix-compatible shell (bash, zsh) and in Windows Terminal / PowerShell
Installation
Install globally via npm:
npm install -g @anthropic-ai/claude-codeVerify the install:
claude --versionAuthentication
Claude Code supports two authentication paths:
- Claude.ai login (recommended for subscribers): Run
claudeand follow the browser-based OAuth flow. Claude Code uses your subscription's usage quota — no separate API key needed. - API key (for developers billing via API): Set the environment variable
ANTHROPIC_API_KEY=<your-key>before running Claude Code. Usage billed at API rates.
Starting Your First Session
Navigate to your project directory and run:
cd /path/to/your/project
claudeClaude Code opens an interactive session. Start with a low-stakes exploration task:
- "Explain what this codebase does at a high level."
- "List the main files and describe the purpose of each."
- "What does the main entry point do?"
These read-only tasks let you see how Claude Code explores the codebase without any risk of changes.
Understanding Permission Prompts
When Claude Code wants to take an action with side effects, it asks for your approval:
File write prompt
Shows you the file path and the proposed change. Options: Allow (once), Allow always (for this file pattern), Deny. Review the diff before approving.
Shell command prompt
Shows you the exact command. Options: Allow (once), Allow always (for this command pattern), Deny. Read the command carefully before approving — shell commands have broad access.
Choosing "Allow always" creates an entry in your settings.json so that pattern is pre-approved for future sessions. This is how you build up a permission set for your common workflow without being prompted every time.
Useful First Tasks
Once comfortable with the permission flow, try progressively more involved tasks:
- Run
/initto generate a CLAUDE.md for your project (read-only task that outputs a file) - Ask Claude to run your test suite: "Run the tests and tell me what's failing."
- Ask Claude to fix a specific failing test
- Ask Claude to explain a complex function in the codebase
- Ask Claude to refactor a specific file — review the diff before approving
Checklist: Do You Understand This?
- Install:
npm install -g @anthropic-ai/claude-code— requires Node.js 18+ - Auth: login via Claude.ai OAuth (uses subscription quota) or set
ANTHROPIC_API_KEYfor API billing - Start a session:
claudein your project directory - File writes and shell commands require permission approval — read each before accepting
- "Allow always" writes to settings.json — use it to pre-approve patterns for your common workflow