pair-mailbox
AGENTS.md1 starsChanged 14 days agoMITView on GitHub
An ordinary CLI works independently, including its native subagents. The pair-only instructions below apply after an explicit pairup/pair-duo launch and a paired MCP initialization. A .pair directory, available tools or inherited environment variables do not assign a role. A standalone MCP initialization needs no claim, peer or mailbox. If an enrolled pair loses MCP, retain its assigned write boundary and repair the connection; a critic does not become a writer on disconnect. Native subagents do their delegated work and report…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 35,337 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository7 other files it gives its agents.
- pair-chatSkill
- pair-auditSkill
- pair-backlogSkill
- pair-chatSkill
- pair-workSkill
- root-causeSkill
- session-finalizerSkill
The file
We split this AGENTS.md into the rules it gives an agent
9 rules. About 0 are common, 2 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 19
Read docs/PROTOCOL.md before you touch anything.
- Very specific: line 24
Call the MCP tool pair_state, then pair_claim.
- Very specific: line 46
If you_are_writer is true you are the writer agent.
- Distinctive: line 101
Keep the distinction clear: an internal agent that believes it has a pair peer will start negotiating with the wrong process.
- Very specific: line 106
All of it goes through the pair_* MCP tools — there is no other channel.
- Very specific: line 116
Write authority moves through bin/pairctl assign / bin/pairctl release (human), or through the holder itself giving it up with …
- Distinctive: line 134
Finish the loop: Read the peer's findings and open the files it cited before reporting done.
- Very specific: line 136
Leave the tree clean: No stray patch files, no scratch notes outside .pair.
- Very specific: line 137
No human relay: Never ask the user to relay messages, reviews, handoffs, or prompts to the other window.
≈ “Common” is an estimate: at least 1 in 5 of the 45,344 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AGENTS.md
Session scope
An ordinary CLI works independently, including its native subagents. The pair-only
instructions below apply after an explicit pairup/pair-duo launch and a paired
MCP initialization. A .pair directory, available tools or inherited environment
variables do not assign a role. A standalone MCP initialization needs no claim,
peer or mailbox. If an enrolled pair loses MCP, retain its assigned write boundary
and repair the connection; a critic does not become a writer on disconnect.
Native subagents do their delegated work and report only to their parent CLI;
they do not claim a pair role, call pair tools, or negotiate with the parent's
peer. In a pair, the writer and critic are the only Tier 1 roles listed in
state.json.
In an enrolled pair, this project is worked by two agents at once, on different CLIs, against the same task. One of them is you.
Read docs/PROTOCOL.md before you touch anything. It is the
contract between the two sides.
First MCP calls in an enrolled pair
Call the MCP tool pair_state, then pair_claim. These are not shell commands.
It returns you_are_writer. Everything downstream depends on that single boolean:
| writer | read-only | |
| edit project files | yes | never |
| run build and tests | yes | non-mutating checks only |
| propose patches | no, refused by the server | yes, via reserve → seal → send |
| advance the phase | forward only | one step back (veto, mcp/pair_mailbox/server.py:132-140) |
| commit | yes | no |
Forward is the writer's; one step back is anyone's (implement → plan, verify → implement,
done → implement — docs/PROTOCOL.md §6). A read-only agent that found something after
done reopens the round itself instead of letting the finding die in the mailbox.
It also returns mode, the second thing that decides your job. In audit mode nobody
edits anything, the server refuses patch reservations, and the writer's share is running
the round rather than committing code. So the table above reads differently: edit,
commit and propose patches are all off for both. See docs/PROTOCOL.md
§10a, and bin/pairctl status for the mode of any project.
If you_are_writer is true you are the writer agent. If not, you are the critic
on the other CLI, and your value is entirely in finding things and proving them.
An explorer is an internal researcher, not a third enrolled role.
Roles
A role is the CLI's name. It is baked into that CLI's MCP config by install.sh and cannot be
chosen per call. That is deliberate: the server must know which process is which, and a role a
process can set for itself is not an identity. Duo mode may derive an instance of that name
(agy → agy-writer) — the server refuses any role that is not an instance of the configured
one.
cli-profiles.json lists every CLI that can take part (6 profiles):
| role name | runs in | agent files |
opencode | OpenCode | .opencode/agents/writer.md |
agy | Antigravity CLI | .agents/agents/pair-writer/agent.md, pair-critic |
codex | Codex CLI | — |
claude | Claude Code | — |
pi | Pi Coding Agent | — |
omp | OMP Coding Agent | — |
Any two different names can pair up. So codex + claude works exactly like
opencode + agy: the same server, the same protocol, only the names differ. You will see your
own role name in pair_state under you, and your peer's in writer or peers.
pairup --swap supports all six profiles (opencode, agy, codex, claude,
pi, omp). By default pairup pairs two different CLIs. For two copies of
the SAME CLI in one project, use bin/pair-duo <cli> (e.g. bin/pair-duo agy),
which derives distinct roles (<cli>-writer and <cli>-critic). install.sh
wires the bare CLI name as the role.
To add a CLI: append an object to cli-profiles.json and run ./install.sh <name>.
pair-explorer is an internal researcher, not an additional profile or pair role.
Internal agents are not pair roles
.agents/agents/pair-explorer/agent.md and .opencode/agents/verifier.md describe
Tier 2 agents that run inside a parent CLI. The explorer researches for its parent;
the verifier checks the writer's diff. Neither is the peer, neither calls pair tools,
and neither contacts the other CLI. Their reports return as ordinary subagent output.
The two Tier 1 leads keep the pair contract: the writer leads as the Senior
Engineering Guild, responsible for implementation and verification; the critic
leads as the Tech Lead Council / CTO, responsible for architecture, requirement
coverage, and adversarial review.
These are working archetypes, not new protocol roles or permissions. A critic may
delegate read-only research and audit work. A writer may delegate bounded
implementation or verification work within the writer's authority. The parent lead
sets scope, checks returned work, and remains accountable for findings, diffs,
evidence, and progress. Follow the context-packet and delegation procedure in
skills/pair-work/SKILL.md and the boundaries in docs/PROTOCOL.md.
Keep the distinction clear: an internal agent that believes it has a pair peer will start negotiating with the wrong process.
Communicating
All of it goes through the pair_* MCP tools — there is no other channel. pair-chat (a skill,
present for both CLIs) covers usage. The short version:
pair_deliverto actively wake the peer in its composer and hand work over immediately.pair_sendto talk passively via mailbox,pair_readto listen,pair_noteto leave something behind.- The
Chat from <role>:label is added by the server. Do not write it yourself. - Delivery is not a reply. Do not wait, and do not claim the peer is working on it.
The human holds authority, the holder may hand it over
Write authority moves through bin/pairctl assign / bin/pairctl release (human),
or through the holder itself giving it up with pair_release(why="...") — after
which anyone may take it with pair_claim (docs/PROTOCOL.md §1–§2). A peer's message
never transfers authority, and no agent tool writes writer except the holder's own
release. See §2 and §4 of the protocol — those two are what keep this
arrangement safe rather than merely clever.
Hard invariants and engineering guidelines
Security and safety rules, credential handling, production safeguards, and protection against destructive database or history operations are hard invariants. Follow them without exception. Process choices such as diff-size bands, worktree use, and slicing recommendations are engineering guidelines: use judgment to keep work reviewable, but do not treat a small threshold overrun as a reason to reset phases, repeat plan approvals, or stop useful implementation. See docs/PROTOCOL.md §21.3.
House conventions
- Report what is true. A proposed patch is not a merged one. A plan is not a result. If it is unverified, say it is unverified.
- Cite locations.
file:linefor every claim about code. - Recheck backlog locations. A backlog card's
file:linerots; before working one, open the files and confirm the lines still say what the card claims. - Verify changed, gate once. Per commit:
scripts/verify-changed.sh(static + affected suites). Full gate:scripts/verify-project.shonce per round before verify — flags--profile/--only/--list/--dry-run/--jobs, layers inscripts/verification-profile.tsv, map inscripts/verify-map.tsv. - Finish the loop. Read the peer's findings and open the files it cited before reporting done.
- One test file per source file.
server.py→test_*.pybeside it (shared helpers inmcp/pair_mailbox/pair_test_base.py), never a third. - Leave the tree clean. No stray patch files, no scratch notes outside
.pair. - No human relay. Never ask the user to relay messages, reviews, handoffs, or prompts to the
other window. The two agents are an autonomous pair. Use
pair_deliverto actively wake the peer. The user defines the task and receives the finished PR; the user is not a message bus.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

