Skip to main content
This guide walks you through installing Claude Code, authenticating, and running your first session in the interactive REPL.

Prerequisites

  • Bun ≥ 1.1.0 — the only required runtime. Install from bun.sh.
  • An Anthropic API key or access to Claude through your organization’s account.

Get started

1

Install Claude Code

Install the claude binary globally from npm:
npm install -g @anthropic-ai/claude-code
Verify the installation:
claude --version
The published npm package is @anthropic-ai/claude-code. The binary name is claude. See Installation for build-from-source instructions and platform notes.
2

Authenticate

Log in with your Anthropic account:
claude /login
This opens an OAuth flow in your browser. On macOS, credentials are stored securely in the system Keychain.To log out at any time:
claude /logout
3

Run a diagnostics check

Before your first session, verify that your environment is configured correctly:
claude /doctor
The /doctor command runs the Doctor.tsx full-screen UI (src/screens/Doctor.tsx), checking API connectivity, authentication, tool availability, and MCP server status. Fix any reported issues before continuing.
4

Start the REPL

Launch the interactive REPL:
claude
You’ll see the terminal UI rendered with React + Ink. Type a message or a slash command to begin.

First things to try

Once you’re in the REPL, start with these commands to get oriented:
List all available slash commands and their descriptions:
/help
Commands are grouped by category. Use this whenever you want to discover what’s available.
Run environment diagnostics at any time from inside the REPL:
/doctor
Reports on API connectivity, authentication status, tool availability, and connected MCP servers.
Ask Claude to read and explain a file in your project:
Read src/main.tsx and explain what it does on startup
Claude will invoke FileReadTool and stream a response with its analysis. You’ll see each tool invocation rendered inline in the terminal.
Ask Claude to modify a file. Claude will use FileEditTool (partial string replacement) or FileWriteTool (full overwrite) depending on the change:
Add a JSDoc comment to the processInput function in src/utils/input.ts
Claude will ask for permission before writing any changes, unless you’re running in a non-interactive mode.
Ask Claude to run a shell command on your behalf:
Run the test suite and summarize any failures
Claude uses BashTool (src/tools/BashTool) to execute the command and feeds the output back into the conversation.

Sample REPL session

$ claude

> Read package.json and tell me what runtime this project requires

  I'll read your package.json now.
  ╭─ FileReadTool ──────────────────────╮
  │ path: package.json                  │
  ╰─────────────────────────────────────╯

  The project requires **Bun ≥ 1.1.0** as its runtime (set in the
  `engines.bun` field). It uses `[email protected]` as the package manager.

> /commit

  ╭─ Git status ────────────────────────╮
  │  M src/utils/helpers.ts             │
  ╰─────────────────────────────────────╯
  Draft commit message: "refactor: simplify input normalization helper"
  Commit? [y/n]

Useful slash commands

/commit

Stage, draft a commit message, and commit — all from the REPL. Claude reads your diff and writes the message.

/review

Ask Claude for a code review of the current diff or a specific file. Uses a PromptCommand that injects your changes as context.

/config

View and edit Claude Code settings interactively. Covers API keys, permission modes, themes, and more.

/memory

Manage persistent memory entries. Claude can recall facts across sessions using the memdir subsystem.

/compact

Compress the conversation context when you approach the token limit. Summarizes history to free up context window space.

/cost

Show token usage and estimated cost for the current session, tracked by src/cost-tracker.ts.

Common first workflows

> What is the overall structure of this project?
> How does authentication work in this codebase?
> Find all places where BashTool is invoked
Claude uses GlobTool, GrepTool, and FileReadTool in sequence to navigate the codebase and synthesize an answer.
Use /config to set your preferred permission mode. The bypassPermissions mode skips approval prompts for trusted workflows; plan mode requires you to approve every tool call before execution.

Build docs developers (and LLMs) love