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

# Set up Claude Code to build locally

> Build a BrainGrid requirement locally with Claude Code

## What is Claude Code?

Claude Code is an AI coding assistant made by Anthropic. It runs in your terminal and can read your codebase, write code, run commands, and work through tasks — all from a text-based interface.

BrainGrid connects to Claude Code to give it structured instructions. Instead of describing what to build from scratch, you point Claude Code at a BrainGrid requirement and it implements the tasks automatically.

## Prerequisites

Before you begin, make sure you have the following set up:

* A [BrainGrid account](/quickstart) — create an account at braingrid.ai
* The [GitHub CLI](/guides/github-cli) — installed and authenticated
* The [BrainGrid CLI](/cli/overview) — installed and authenticated
* [Claude Code](https://docs.anthropic.com/en/docs/claude-code/overview) — installed from Anthropic

## Check out and initialize your project

Before Claude Code can build anything, you need to connect your code to BrainGrid. This tells BrainGrid which project you're working on and lets Claude Code find your requirements and tasks.

<Steps>
  <Step title="Connect your repository to BrainGrid">
    Your GitHub repository needs to be linked to a BrainGrid project. This is how BrainGrid knows which codebase your requirements belong to.

    If you haven't done this yet, follow the [Create a Project](/guides/create-project) guide. You'll also need the [GitHub App installed](/github-installation) so BrainGrid can access your repository.
  </Step>

  <Step title="Clone your repository">
    Cloning downloads a copy of your code to your computer. Open your terminal — on Mac, press **Command + Space**, type **Terminal**, and press **Enter**. On Windows, press the **Windows key**, type **PowerShell**, and click **Windows PowerShell**. Then run:

    ```bash theme={null}
    gh repo clone owner/repo
    ```

    Replace `owner/repo` with your actual repository — for example, `my-company/my-app`.
  </Step>

  <Step title="Navigate into the folder">
    Move into the folder you just downloaded:

    ```bash theme={null}
    cd repo
    ```

    Replace `repo` with the name of your repository folder.
  </Step>

  <Step title="Initialize BrainGrid">
    This tells BrainGrid which project this folder belongs to:

    ```bash theme={null}
    braingrid init
    ```

    You'll be prompted to select your project. Once complete, a `.braingrid/project.json` file is created in your folder.

    <Note>
      This command will fail if your repository isn't connected to a BrainGrid project yet. Make sure you completed the first step.
    </Note>
  </Step>
</Steps>

## Install the integration

This adds BrainGrid commands to Claude Code so they can work together. Run this from your project folder:

```bash theme={null}
braingrid setup claude-code
```

## Verify the integration

Make sure everything was set up correctly:

<Steps>
  <Step title="Open Claude Code">
    From your project folder, start Claude Code by running:

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

  <Step title="Check for BrainGrid commands">
    Type `/` in the Claude Code prompt. You should see a list of commands pop up, including `/build`.

    If you don't see `/build` in the list, close Claude Code, run `braingrid setup claude-code` again, and reopen it.
  </Step>
</Steps>

## What gets installed

The setup command installs four components into your project:

### Slash commands

Located in `.claude/commands/`, these give you quick access to BrainGrid features:

| Command             | Description                                | Example                              |
| ------------------- | ------------------------------------------ | ------------------------------------ |
| `/specify`          | Create a requirement from a rough idea     | `/specify Add user auth with OAuth2` |
| `/save-requirement` | Save a Claude Code plan as a requirement   | `/save-requirement`                  |
| `/build`            | Build a requirement — implements all tasks | `/build REQ-123`                     |

### BrainGrid CLI skill

Located in `.claude/skills/braingrid-cli/`, this gives Claude Code context about your project and the BrainGrid workflow so it knows how to use the commands effectively.

### Status line

Located in `.claude/statusline.sh`, this displays your current progress at the top of Claude Code:

**Example:** `BrainGrid: PROJ-3 > REQ-128 [2/5]`

* **Project**: Your current BrainGrid project
* **Requirement**: The requirement you're working on (detected from your branch name)
* **Progress**: How many tasks are completed (2 of 5 in this example)

### CLAUDE.md content

Adds BrainGrid workflow documentation to your project's `CLAUDE.md` file, giving Claude Code background context about your commands and workflow.

## Build a requirement

Once everything is set up, tell Claude Code which requirement to build:

```bash Claude Code theme={null}
/build REQ-123
```

Replace `REQ-123` with your actual requirement ID. Claude Code creates a feature branch, reads the requirement's tasks, and implements them one by one. The status line at the top updates as each task is completed.

You can also add specific instructions:

```bash Claude Code theme={null}
/build REQ-123 Use TypeScript for all new code. Include unit tests.
```

## Learn more

<CardGroup cols={2}>
  <Card title="CLI command reference" icon="book" href="/cli/commands">
    Explore all available CLI commands
  </Card>

  <Card title="Create a requirement" icon="list-check" href="/guides/create-requirement">
    Learn how to create requirements in BrainGrid
  </Card>

  <Card title="BrainGrid console" icon="globe" href="https://app.braingrid.ai">
    Manage projects in the browser
  </Card>
</CardGroup>
