Skip to content

rb with Claude Code, Codex and Cursor

Each agent needs rb’s instructions where it reads them, so all three write to the same record.

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 asks once before it changes a file that was already there. We ran it where it could not ask, so it left AGENTS.md 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

There is no .codex/ here, so rb wrote no hook for Codex. With .codex/, or when Codex runs rb init, rb adds one to .codex/hooks.json. The session hook says what it does.

Commit all of it with .rb/.

  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

    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.

  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
    }
    ]
    }
    }
  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. Take it all out

    rb remove takes out only what is rb’s:

    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 record files not committed. To keep a copy first, run: rb export --with-record --zip --out ~/int8-resnet-20-on-cifar-10-record.zip

rb records which agent made each write, with its chat session and the model it reported (rb log --json). The screens never name the agent.

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