> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sparkle.security/llms.txt
> Use this file to discover all available pages before exploring further.

# Claude Code Setup

> Configure Sparkle with Claude Code using the CLI.

Use the Sparkle CLI to connect Claude Code to the Sparkle MCP server, hooks, and guardrail rules.

## Prerequisites

Before you set up Claude Code, make sure you have:

* [Claude Code](https://docs.anthropic.com/en/docs/claude-code) installed on your machine
* **Node.js 20+** — required for the CLI install
* A **Sparkle account** — [sign up for free](https://app.thesparkle.ai)
* The **Sparkle CLI** installed — see [Install CLI](/cli/install)

## Set up Claude Code

<Steps>
  <Step title="Sign in">
    Authenticate with Sparkle via browser OAuth:

    ```bash theme={null}
    sparkle login
    ```

    Your session is stored locally under `~/.sparkle/`.
  </Step>

  <Step title="Configure Claude Code">
    Wire Claude Code to Sparkle:

    ```bash theme={null}
    sparkle setup --ide claudeCode
    ```

    This connects Claude Code to the Sparkle MCP server, configure sparkle hooks, and registers guardrail rules for your machine.
  </Step>

  <Step title="Verify status">
    Confirm you are logged in and Claude Code is configured:

    ```bash theme={null}
    sparkle status
    ```
  </Step>
</Steps>

## Verify guardrails

<Steps>
  <Step title="Open a project">
    Open the repository you want to protect with Sparkle in Claude Code.
  </Step>

  <Step title="Run a prompt">
    Use Claude Code in that project. Sparkle applies guardrails on every prompt before code generation.
  </Step>
</Steps>

## What setup configures

When you run `sparkle setup`, the CLI:

* Connects Claude Code to the Sparkle MCP server
* Installs and wires up hooks
* Registers guardrail rules for your workspace

## Remove configuration

To remove Sparkle configuration from Claude Code only:

```bash theme={null}
sparkle logout --ide claudeCode
```

## Next steps

<CardGroup cols={2}>
  <Card title="Using the CLI" icon="terminal" href="/cli/usage">
    Learn the full CLI workflow.
  </Card>

  <Card title="Commands" icon="list" href="/cli/commands">
    Full command reference with options.
  </Card>
</CardGroup>
