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

# Codex

> Use Product Brain with Codex through natural-language task instructions and generated agent context.

<Warning>
  **Early access** — [**Join the Product Brain Community**](https://community.productbrain.io) for Codex + Product Brain pairs that work today.
</Warning>

Codex works best when Product Brain is part of the task instructions. You say what should happen; Codex handles the CLI mechanics inside the repository.

## Start a task

What you say to Codex:

```text theme={null}
Use Product Brain to orient for this task and start a session before making changes.
```

<details>
  <summary>CLI equivalent</summary>

  ```bash theme={null}
  pb orient --task "Describe the task"
  pb session start
  ```
</details>

## Refresh agent context

Ask Codex to refresh local Product Brain context when the repository needs current agent instructions:

```text theme={null}
Refresh the Product Brain handshake before continuing.
```

<details>
  <summary>CLI equivalent</summary>

  ```bash theme={null}
  pb handshake
  ```
</details>

## Close the loop

What you say to Codex:

```text theme={null}
Capture any durable decisions or tensions from this work, then close the Product Brain session.
```

<details>
  <summary>CLI equivalent</summary>

  ```bash theme={null}
  pb capture "DEC: ..."
  pb capture "TEN: ..."
  pb session close
  ```
</details>

Codex should treat the Chain as the source of truth for product context, not just the current conversation.
