Skip to main content
This guide walks you through installing Claude Code, authenticating, and completing a real task on a codebase. By the end you will have Claude reading files, running commands, and editing code in your terminal.
Claude Code requires Node.js 18 or later. Run node --version to check. See Installation for full platform-specific requirements.

Step 1: Install Claude Code

npm install -g @anthropic-ai/claude-code
Verify the installation:
claude --version

Step 2: Authenticate

Run claude for the first time in any directory. Claude Code will prompt you to authenticate.
claude
Claude Code will open a browser window to sign in with your Claude.ai account. Complete the OAuth flow and return to the terminal. Your token is stored in the system keychain and refreshed automatically.
This method requires a Claude.ai Pro or Team subscription.
After authentication, Claude Code prints a welcome message and drops you into the interactive REPL.

Step 3: Open a project

Navigate to any code project and launch Claude Code:
cd ~/my-project
claude
Claude Code automatically picks up the current directory as the working directory. If a CLAUDE.md file exists at the project root, Claude reads it as background context before your first message.

Step 4: Ask Claude to do something

Type a task in plain English and press Enter. Claude will plan the work, show you what it intends to do, and execute it step by step. Here are a few tasks to try:
Give me a high-level overview of this codebase. What does it do and how is it structured?
Claude reads the relevant files, searches the codebase, and proposes changes. For file edits, it shows you a diff before writing anything.

Step 5: Review and continue

After Claude completes a task, you can:
  • Ask follow-up questions — Claude retains full context from the current session.
  • Request changes — Tell Claude what to adjust and it will iterate.
  • Run /status — Check context window usage and which model is active.
  • Run /cost — See token usage and estimated cost for the session.
> /status

Common workflows

Continue the most recent session

If you close the terminal and come back later, resume the last session in your project:
claude --continue

Run a one-shot task without the REPL

Use --print (or -p) to run Claude non-interactively and get output on stdout:
claude --print "What does the authenticate() function do?"
This is useful in scripts and CI pipelines. The workspace trust dialog is skipped in --print mode — only use it in trusted directories.

Initialize project memory

Ask Claude to generate a CLAUDE.md file that captures important context about your project:
claude
> /init
Claude reads the project and writes a CLAUDE.md to the root. On future sessions it reads this file automatically.

Switch models

claude --model sonnet
# or interactively:
> /model
Pass a full model name (claude-sonnet-4-6) or an alias (sonnet, opus).

Key keyboard shortcuts

ShortcutAction
EnterSend message
Shift+EnterInsert a newline without sending
Ctrl+CInterrupt the current operation
Ctrl+LClear the terminal
Up / DownNavigate message history
Ctrl+RSearch message history
EscCancel the current input

What’s next

Installation

Full install guide for macOS, Linux, and Windows, including Node version managers and enterprise auth options.

Introduction

Conceptual overview of how Claude Code works — tools, sessions, permissions, and auth.

Sessions

Learn how to resume, compact, and manage conversation sessions.

Configuration

Customize Claude Code behavior with settings files and environment variables.

Build docs developers (and LLMs) love