Skip to content

rb with Claude Code, Codex and Cursor

This cookbook sets one repository up for Claude Code, Codex and Cursor, so all three keep the same record.

You use Claude Code on Monday, Codex on Tuesday, and Cursor when you are in the editor. Each agent needs rb’s instructions in the place it reads them, and all three must write to the same record in the same way.

Paste this into your agent

Set this repository up for every agent you use, and say what goes in git.

Set this repository up so Claude Code, Codex and Cursor all keep the same Rabbit Brain record.

- A session that is already running loads no new skill, so `rb init` installs nothing in this session. Tell me to run `rb init --dry-run`, then `rb init "<the work's theme>"`, in my own terminal.
- After I have, run `git status --short`, and tell me which files rb added for each agent and which ones to commit.

The repository already has a CLAUDE.md, an AGENTS.md of its own, and a .cursor/ folder.

rb init, in your own terminal:

Terminal window
$ rb init "INT8 ResNet-20 on CIFAR-10"
Project 'int8-resnet-20-on-cifar-10' started: ~/int8-agents/.rb
Rabbit Brain YAML files beside the code: commit .rb/ with it, so the record travels with the work.
For the agents here:
Claude Code (CLAUDE.md): the skill in .claude/skills/rabbit-brain/SKILL.md; rb's MCP server in a new .mcp.json; rb's session hook in a new .claude/settings.json (SessionStart and Stop run rb journal scan, which looks at the repository and says nothing)
The agents that read AGENTS.md (AGENTS.md): AGENTS.md was here before rb, so rb left it as it is. rb skill add --agents-md --yes adds rb's section at its end (the text rb skill prints, between two marker lines).
Cursor (.cursor/): .cursor/rules/rabbit-brain.mdc; rb's session hook in a new .cursor/hooks.json (sessionStart and stop run rb journal scan, which looks at the repository and says nothing)
Then paste this line into your agent's chat:
Use Rabbit Brain to track this: read rb context, then record where the work stands.

rb made the files that were not there, and left the AGENTS.md that was. In your own terminal it asks once before it changes a file that was there, and anything but y or yes keeps it as it is. We ran it where it could not ask, so it left the file and named the command that adds rb’s section:

Terminal window
$ rb skill add --agents-md --yes
wrote ~/int8-agents/AGENTS.md
The agent picks it up in its next session. The skill defers to `rb docs` for the full rules.
Terminal window
$ git status --short
M AGENTS.md
?? .claude/
?? .cursor/
?? .mcp.json
?? .rb/
AgentWhat rb wroteWhere
Claude Codethe skill, rb’s MCP server, and rb’s session hook.claude/skills/rabbit-brain/SKILL.md, .mcp.json, .claude/settings.json
Codex, and any agent that reads AGENTS.mdrb’s section, between two marker lines, at the end of the fileAGENTS.md
Cursora rule, and rb’s session hook.cursor/rules/rabbit-brain.mdc, .cursor/hooks.json

This repository has no .codex/, so rb wrote no hook for Codex. Where .codex/ is there or Codex runs rb init, rb adds its session hook to .codex/hooks.json too. The session hook says what it does.

Commit all of it with .rb/: the next session of each agent, on any machine, reads the same instructions and writes to the same record.

  1. Show the plan, write nothing

    In your own terminal:

    Terminal window
    $ rb init --dry-run
    Dry run: nothing was written. The write would say:
    Project 'int8-agents' started: ~/int8-agents/.rb
    Rabbit Brain YAML files beside the code: commit .rb/ with it, so the record travels with the work.
    For the agents here:
    Claude Code (CLAUDE.md): the skill in .claude/skills/rabbit-brain/SKILL.md; rb's MCP server in a new .mcp.json; rb's session hook in a new .claude/settings.json (SessionStart and Stop run rb journal scan, which looks at the repository and says nothing)
    The agents that read AGENTS.md (AGENTS.md): AGENTS.md was here before rb, so rb left it as it is. rb skill add --agents-md --yes adds rb's section at its end (the text rb skill prints, between two marker lines).
    Cursor (.cursor/): .cursor/rules/rabbit-brain.mdc; rb's session hook in a new .cursor/hooks.json (sessionStart and stop run rb journal scan, which looks at the repository and says nothing)
    Then paste this line into your agent's chat:
    Use Rabbit Brain to track this: read rb context, then record where the work stands.
    rb init would write:
    .rb/: the record (.gitignore, .gitattributes, project.yaml, log.jsonl), and rb's lock and local copies (.lock, cache/), which .rb/.gitignore keeps out of git
    .claude/skills/rabbit-brain/SKILL.md: new
    .mcp.json: new
    .claude/settings.json: new
    .cursor/rules/rabbit-brain.mdc: new
    .cursor/hooks.json: new
    .git/rb/owned.jsonl: rb's list of what it writes outside .rb/
    .git/rb/journal/: what rb sees land in the repository, from the look rb init makes as the record begins
    Later commands add:
    refs/rb/snapshots/<tree>: a ref in git to the code a run was recorded at; git update-ref -d removes it (rb run add, rb journal run)
    .git/rb/views/: a past version of the record, checked out while the screen shows it (rb open, rb ui)
    .git/rb-last-seen.json: what you last saw, so rb ui can say what is new since (rb ui)
    rb-page.html: the record as one page, beside .rb/ by default (rb page)
    rb-export/: the page with a manifest, beside .rb/ by default (rb export)
    rb-export.zip: the same, as one zip file (rb export --zip)
  2. In an agent session, install nothing

    Run inside a session that is already running, rb init installs nothing, since that session would not load it, and names the commands for later sessions:

    Terminal window
    $ rb init "INT8 ResNet-20 on CIFAR-10"
    Project 'int8-resnet-20-on-cifar-10' started: ~/int8-agents-session/.rb
    Rabbit Brain YAML files beside the code: commit .rb/ with it, so the record travels with the work.
    For the agents here:
    Nothing installed: a session already running loads no skill or MCP server added during it. For later sessions:
    Claude Code: rb skill add --claude --project, and claude mcp add --scope project rabbit-brain -- rb mcp
    The agents that read AGENTS.md: rb skill add --agents-md
    Cursor: rb skill add --cursor
    Use Rabbit Brain to track this: read rb context, then record where the work stands.
    Next: rb context --model <your model id>
  3. rb’s MCP server, for Claude Code

    Terminal window
    $ cat .mcp.json
    {
    "mcpServers": {
    "rabbit-brain": {
    "command": "rb",
    "args": [
    "mcp"
    ]
    }
    }
    }

    claude mcp add --scope project rabbit-brain -- rb mcp adds the same entry by hand. Every call over MCP is recorded as the agent’s.

  4. rb’s session hook, for Cursor

    Terminal window
    $ cat .cursor/hooks.json
    {
    "version": 1,
    "hooks": {
    "sessionStart": [
    {
    "command": "rb journal scan --hook cursor; exit 0",
    "timeout": 10
    }
    ],
    "stop": [
    {
    "command": "rb journal scan --hook cursor; exit 0",
    "timeout": 10
    }
    ]
    }
    }

    As a session starts and as each turn ends, it runs rb journal scan, which looks at the repository and says nothing.

  5. rb’s section, for Codex

    Terminal window
    $ tail -n 12 AGENTS.md
    - work in another branch or worktree is recorded there the same way, never as an experiment per branch: name the experiment and the variant on every run, and the records merge with git (`rb status` says what branches not merged yet hold).
    ## Boundaries
    - Never compute a finding, an error, a ranking or a regression yourself: record the numbers, and read the finding.
    - Never edit `.rb/` by hand: rb catches it, and `rb doctor` lists it.
    - Never set or unset `RB_ACTOR` or `RB_HUB_TOKEN`, and never read the credentials file `rb login` writes.
    - Report a finding by its axes as rb prints them: the comparison with its interval and units, the rule, the timing, and every integrity problem. `criterion undetermined · point only` on 2 units is said in those words, never rounded up to "it works".
    Everything else is in `rb docs`. Tools instead of shell: `claude mcp add rabbit-brain -- rb mcp` from the project root; same record, same rules.
    <!-- rabbit-brain skill: end -->
  6. And how to take it all out

    rb remove takes out only what is rb’s, including the hook files it made, and puts AGENTS.md back byte for byte:

    Terminal window
    $ rb remove --dry-run
    Dry run: nothing was removed. rb remove would do this in ~/int8-agents:
    Will remove:
    .rb/: the record (1 record, each as its log says rb wrote it, and the log), and rb's own files and local copies
    .claude/skills/rabbit-brain/SKILL.md: rb's skill for Claude Code, as rb wrote it
    .cursor/rules/rabbit-brain.mdc: rb's rule for Cursor, as rb wrote it
    AGENTS.md: rb's section, as rb added it: the file goes back to what it was, byte for byte
    .mcp.json: made by rb, and as rb wrote it
    .claude/settings.json: made by rb, and as rb wrote it
    .cursor/hooks.json: made by rb, and as rb wrote it
    .git/rb/: rb's folder inside git's: its journal, its list of what it wrote outside .rb/, and the past versions it showed
    Not rb's to touch: your research files, worktrees and .git/worktrees, git history, git objects, config, hooks and the index.
    Listed, not removed:
    the rb command itself: pip uninstall rabbit-brain (or uv tool uninstall rabbit-brain, pipx uninstall rabbit-brain)
    4 files of the record have uncommitted changes. To keep a copy first, run: rb export --with-record --zip --out ~/int8-resnet-20-on-cifar-10-record.zip

All three agents write the same commands to the same record, and rb records which agent made each write, with its chat session and the model it said it runs on. That stays in the data (rb log --json). The screens never name a writer: what they show is whether something an agent wrote waits for you, such as design not confirmed or Proposed, not made.

Whichever agent did the work, the record reads the same, and you confirm the same way.

Rabbit Brainrabbitbrain.ai · GitHub · PyPI · Privacy · Apache-2.0