> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/jackdog668/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.

## Prerequisites

* **Node.js 18 or higher.** Check your version with `node --version`. [Download Node.js](https://nodejs.org) if needed.
* A Claude account at [claude.ai](https://claude.ai), **or** an Anthropic API key.

## Install and authenticate

<Steps>
  <Step title="Install globally via npm">
    ```bash theme={null}
    npm install -g @anthropic-ai/claude-code
    ```

    Verify the installation:

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

  <Step title="Authenticate">
    Run `claude` from any directory. On first launch, Claude Code detects that no credentials are configured and prompts you to log in.

    ```bash theme={null}
    claude
    ```

    **OAuth via claude.ai (recommended):** Follow the URL printed in the terminal to complete the OAuth flow in your browser. Your subscription entitles you to use Claude Code without managing API keys.

    **API key:** If you prefer to use an API key directly, set the `ANTHROPIC_API_KEY` environment variable before running `claude`:

    ```bash theme={null}
    export ANTHROPIC_API_KEY=sk-ant-...
    claude
    ```

    <Note>
      If both an OAuth session and `ANTHROPIC_API_KEY` are present, Claude Code uses the API key and skips the OAuth flow.
    </Note>
  </Step>

  <Step title="Navigate to your project">
    Claude Code works best when launched from your project root so it can read the files it needs.

    ```bash theme={null}
    cd my-project
    claude
    ```
  </Step>

  <Step title="Ask Claude something">
    Once the interactive session opens, type a prompt and press **Enter**:

    ```
    > explain what this codebase does
    ```

    Claude reads relevant files and replies in the terminal. You can continue the conversation, ask for edits, run commands, and more — all in the same session.
  </Step>
</Steps>

## First non-interactive call

Use the `-p` (or `--print`) flag to run a single prompt and print the result to stdout. This is useful for scripting or quick one-off queries:

```bash theme={null}
claude -p "what files are in this directory?"
```

Output is written to stdout, making it easy to pipe into other tools:

```bash theme={null}
claude -p "list all TODO comments in the codebase" > todos.txt
```

## Tips for effective use

<Tip>
  Start sessions from your project root. Claude Code uses your working directory as the base for all file operations.
</Tip>

* **Be specific about scope.** Tell Claude which files or directories are relevant if the codebase is large.
* **Ask for plans before big changes.** Prompt Claude to outline what it intends to do before making edits across many files.
* **Use non-interactive mode for automation.** The `-p` flag makes it straightforward to integrate Claude into shell scripts, Makefiles, or CI workflows.
* **Resume sessions.** Use `claude --resume` to continue a previous conversation rather than starting over.

## Next steps

<CardGroup cols={2}>
  <Card title="Installation" icon="download" href="/installation">
    Full installation options including alternative package managers, Bedrock, and Vertex AI.
  </Card>

  <Card title="Interactive mode" icon="terminal" href="/usage/interactive-mode">
    Learn the interactive REPL in depth.
  </Card>
</CardGroup>
