> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.livingbrain.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.livingbrain.com/_mcp/server.

# From an idea to a pull request

An idea often comes up away from your desk, and by the time you sit down to build it, the details are
gone. In this example a developer texts an idea to OpenClaw from their phone.
OpenClaw checks the team's brain, finds that a similar approach was tried and rolled back, and suggests a
better one. Once the developer agrees, it saves the plan to the brain and opens a GitHub issue. Later,
at the desk, Codex reads the same plan from the brain, builds the feature and opens a pull request.

The agent replies, brain pages, issue and pull request are from a real run, condensed for length. The
phone scenes replay that OpenClaw session inside a phone frame. The project, Pulse, is a small notes app
made for this example, and the team history in its brain is made up.

## What happens

| Step          | Where                    | What the agent does with the brain                                                                                                                               |
| ------------- | ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 1. The idea   | Phone chat with OpenClaw | Searches the "Pulse team" brain before answering (`workspace_search_pages`, `workspace_get_page`)                                                                |
| 2. The memory | OpenClaw's reply         | Finds that a localStorage cache was tried in March and rolled back: it blocked the main thread and ran out of space                                              |
| 3. The plan   | OpenClaw                 | Suggests IndexedDB instead. After the developer agrees, saves the plan as a new page (`captures_capture`) and opens a GitHub issue                               |
| 4. The build  | Codex at the desk        | Reads the issue, then the plan and the March lesson from the brain (`workspace_search_pages`, `workspace_get_page`), and builds the feature without localStorage |
| 5. The result | GitHub                   | Codex runs the tests and opens a pull request that links the issue                                                                                               |

The plan page connects to the March page in the brain, so whoever picks it up next sees both the
decision and the reason for it.

## Set it up

Both agents connect to the same brain over [MCP](/mcp), with the same API key and subject ID.

### Connect OpenClaw

Run the OpenClaw command from [MCP with API key](/mcp) in a terminal. The
[setup video](/mcp#video-walkthroughs) walks through it.

### Connect Codex

Add the Codex entry from the same page to `~/.codex/config.toml`.

### Tell each agent to use the brain

Agents call the brain more reliably when their instructions say when to. In this example, OpenClaw's
workspace and the repository each have an `AGENTS.md` with rules like these:

```markdown
## Living Brain

- Before you answer a question about this project, search the "Pulse team" brain.
- Prefer what the brain says over your own guesses, and say which page it came from.
- When we agree on a plan, save it to the brain: what we decided, why, and what we ruled out.
```

## Why the brain matters here

Each agent works without the other's history. OpenClaw never saw the repository, and Codex never saw
the phone chat. The brain is what they share:

| Without a shared brain                          | With one                                                     |
| ----------------------------------------------- | ------------------------------------------------------------ |
| OpenClaw agrees to the first approach suggested | OpenClaw remembers the approach the team already rolled back |
| The plan lives in a chat on your phone          | The plan is a page any agent or teammate can read            |
| Codex starts from the issue text alone          | Codex reads the plan and the reasons behind it               |

## Ideas to take further

* Capture what shipped when the pull request merges, so the next plan starts from what was built.
* Add more agents. Any [MCP client](/mcp) can read and write the same brain, including Claude Code and
  Cursor.
* Use [Coding agent memory](/docs/use-cases/coding-agent-memory) for the details of sharing a project's
  decisions between coding sessions.

## When to use something else

If one agent does the whole job in one session, it can keep the plan in its own context. A shared brain
helps when the work moves between agents, devices or people, and each one needs the decisions made
before it.

[How to build with Living Brain](/docs/build) covers the write and read paths these agents use.