> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/instructkr/claude-code/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Install Claude Code and run your first session in under five minutes.

This guide walks you through installing Claude Code, authenticating, and running your first task.

## Prerequisites

* **Node.js 18+** and **npm** — or [Bun](https://bun.sh) if you prefer running from source
* An **Anthropic account** — sign up at [anthropic.com](https://www.anthropic.com) if you don't have one

<Steps>
  <Step title="Install Claude Code">
    Install the package globally with npm:

    ```bash theme={null}
    npm install -g @anthropic-ai/claude-code
    ```

    Verify the installation:

    ```bash theme={null}
    claude --version
    ```
  </Step>

  <Step title="Start the REPL">
    Navigate to your project directory and launch Claude Code:

    ```bash theme={null}
    cd /your/project
    claude
    ```

    This opens the interactive REPL. Claude Code reads your current directory and uses it as context for all requests.
  </Step>

  <Step title="Sign in">
    On first run, type the `/login` command inside the REPL:

    ```
    /login
    ```

    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.

    <Info>
      If you are already authenticated (for example, via an `ANTHROPIC_API_KEY` environment variable), `/login` lets you switch accounts instead.
    </Info>
  </Step>

  <Step title="Ask Claude to explain the codebase">
    Once authenticated, type a natural language request at the prompt:

    ```
    Explain the overall structure of this codebase. What are the main modules and how do they interact?
    ```

    Claude Code will read relevant files, summarize the architecture, and point you to key entry points — without you specifying which files to look at.
  </Step>

  <Step title="Make your first code change">
    Try asking for a concrete edit:

    ```
    Add a JSDoc comment to the main export in src/index.ts describing what it does.
    ```

    Claude Code will locate the file, read it, propose the edit, and ask for your confirmation before writing. You can approve, reject, or ask for a revision.
  </Step>
</Steps>

## Interactive vs. non-interactive usage

Claude Code has two modes.

**Interactive REPL** — Run `claude` 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.

```bash theme={null}
claude "Write a one-line summary of every exported function in src/ and save it to EXPORTS.md"
```

Use the `--print` / `-p` flag to suppress the interactive UI and print the final response to stdout:

```bash theme={null}
claude -p "What does the function parseConfig do in src/config.ts?"
```

This makes it easy to pipe Claude Code output into other tools:

```bash theme={null}
claude -p "List all TODO comments in this repo" | grep -i "urgent"
```

## Troubleshooting setup

If something is not working as expected, run `/doctor` inside the REPL:

```
/doctor
```

The doctor command runs a suite of environment diagnostics — checking authentication status, Node.js and Bun versions, network connectivity to the Anthropic API, and configuration validity. It will surface specific errors with suggested fixes.

<Tip>
  For persistent issues, see the [troubleshooting guide](/advanced/troubleshooting) or check the [installation page](/installation) for platform-specific notes.
</Tip>

## Next steps

<CardGroup cols={2}>
  <Card title="Installation" icon="download" href="/installation">
    Platform-specific setup, upgrading, and uninstalling.
  </Card>

  <Card title="Headless mode" icon="code" href="/advanced/headless-mode">
    Run Claude Code in CI pipelines and scripts without a terminal UI.
  </Card>

  <Card title="MCP servers" icon="plug" href="/guides/mcp-servers">
    Connect external tools and data sources to Claude Code.
  </Card>

  <Card title="Agent swarms" icon="network-wired" href="/guides/agent-swarms">
    Parallelize large tasks across multiple coordinated sub-agents.
  </Card>
</CardGroup>
