Prerequisites
- Node.js 18+ and npm — or Bun if you prefer running from source
- An Anthropic account — sign up at anthropic.com if you don’t have one
Start the REPL
Navigate to your project directory and launch Claude Code:This opens the interactive REPL. Claude Code reads your current directory and uses it as context for all requests.
Sign in
On first run, type the This starts the OAuth flow. Your browser will open to complete authentication with your Anthropic account. Credentials are stored securely — on macOS they are saved to the system Keychain.
/login command inside the REPL:If you are already authenticated (for example, via an
ANTHROPIC_API_KEY environment variable), /login lets you switch accounts instead.Ask Claude to explain the codebase
Once authenticated, type a natural language request at the prompt:Claude Code will read relevant files, summarize the architecture, and point you to key entry points — without you specifying which files to look at.
Interactive vs. non-interactive usage
Claude Code has two modes. Interactive REPL — Runclaude with no arguments to open the persistent session. You can have a back-and-forth conversation, use slash commands, and approve tool calls interactively.
Non-interactive (headless) — Pass a prompt directly on the command line. Claude Code runs the task and exits. Useful for scripting and CI pipelines.
--print / -p flag to suppress the interactive UI and print the final response to stdout:
Troubleshooting setup
If something is not working as expected, run/doctor inside the REPL:
Next steps
Installation
Platform-specific setup, upgrading, and uninstalling.
Headless mode
Run Claude Code in CI pipelines and scripts without a terminal UI.
MCP servers
Connect external tools and data sources to Claude Code.
Agent swarms
Parallelize large tasks across multiple coordinated sub-agents.