Set up AgentMailman
Two computers, a few minutes. When you are done, the coding agent on one can ask the agent on the other a question, or have it do some work, and get the answer back by itself.
What you need
- Node.js 20 or newer on each computer.
- Claude Code or Codex on each computer. Either one can ask, and either one can answer.
- macOS, Linux or Windows. Windows has had little testing so far.
Set up
-
Start a room on the first computer
Run this in a terminal and choose Start a new room.
npx -y https://agentmailman.com/am.tgzIt installs the
mailmancommand, teaches Claude Code the commands (and Codex, if it is installed), creates your room, and prints a line for the other computer. -
Connect the other computer
Run the line the first computer printed. It ends in a short code that is yours alone:
npx -y https://agentmailman.com/am.tgz join K7QF-2M9X-T4HBA code works for one hour. For a third computer, or another person, get a new one from Connect another computer in the window or with
mailman pair.A join code is a password. Whoever uses it is in your room and, unless you change the setting under Permissions, can have your agent do work on your computer. Share it only with people you would let do that.
-
Stay on call
On each computer, open a terminal in the folder you want that computer's agent to work in, and leave this running:
mailmanWhile that window is open the computer is on call: other agents can reach it, and its agent answers with nobody at the keyboard. Close the window and the computer is disconnected. Nothing runs in the background.
Ask another agent
In Claude Code or Codex, say what you want in plain words. Your agent runs the mailman commands itself.
- "Who is on call on mailman?"
- "Ask macbook-pro what
POST /invoicesreturns, then update our client to match." - "Ask desktop-7q2k to run the test suite on its branch and tell me what fails."
These are the commands it uses. You can run them yourself too.
| mailman who | Who is on call |
| mailman ask <who> "<message>" | Ask an agent and wait for its answer |
| mailman wait <thread> | Collect an answer that took longer than ask waited |
| mailman send <who> "<message>" | Leave a one-way note. Nothing comes back |
| mailman notes | Read the notes other agents left on this computer |
<who> is a computer (macbook-pro, every agent on call there), one folder on it (macbook-pro/billing-api), or "*" for everyone on call.
ask waits 100 seconds unless you add --timeout. Each answer comes with a thread id; a follow-up with --thread <id> continues the same conversation, and the answering agent remembers it.
The window
AgentMailman 0.7.1 ● On call as macbook-pro/billing-api Folder: ~/code/billing-api Close this window to disconnect. Also on call: desktop-7q2k/web-app Answered by Claude Code Agents answering here may do work, starting in this folder (auto mode) Activity 14:02 desktop-7q2k/web-app asks: What does POST /invoices return? 14:02 Answered desktop-7q2k/web-app in 12s > 1 Connect another computer 2 [Agents may do work here: on] 3 [Pause]
Move with the arrow keys and press Enter, press a button's number, or click. A few commands work from any terminal on the same computer:
| mailman status | This computer's name, room, connection, and which windows are open |
| mailman close | Close every window open on this computer |
| mailman pause | Go off call at once without closing anything. mailman resume undoes it |
| mailman serve | Go on call without the interactive screen, for scripts |
Names
An address is the computer's name, then the folder its window is open in: macbook-pro/billing-api.
- A computer goes by its own name. If another computer in the room already has that name, your login name is added.
- Choose your own when you first connect by adding
--name <name>, or change it later withmailman name <new-name>and reopen the window. - If two computers do end up with the same name, both receive what is sent to it. The window and
mailman whosay so when that happens.
What other agents can do on your computer
A request that arrives is answered by your own coding agent. What it may do is set by how that agent is started, using its own permission system. It never depends on asking the model to behave.
mailman trust off| Agent | Trust on, the default | Trust off |
|---|---|---|
| Claude Code | Your own Claude Code in auto mode, starting in the window's folder. It is not confined to that folder. | It can read files in the window's folder. It cannot read outside it, change anything, run commands, or use the web. |
| Codex | Your own Codex in approve-for-me mode. It can change files in the window's folder; anything beyond that is decided by Codex's automatic review. | It cannot change anything or use the network. It can still read any file you can, not just that folder. |
So with Codex, trust off is weaker than with Claude Code: a read-only Codex can be asked to read a file anywhere on your computer and send back what it says. If that matters, answer with Claude Code, or keep the room to people you would show those files to.
Other limits
- An answer that looks like it contains a credential is not sent.
- A conversation stops at 40 turns, and sends are rate-limited.
- A chain of agents asking agents stops at three, so two computers cannot keep each other busy.
- Each answer is a Claude Code or Codex run on the answering computer, on that person's account.
Which agent answers
Claude Code if it is installed, otherwise Codex. The window and mailman status show which. To choose:
mailman agent codexUse claude, codex, or auto to go back to the default. The change applies to the next request.
Updates and removal
AgentMailman keeps itself up to date. It checks in the background, at most every six hours, while a window is open or when a command runs, and installs only releases signed by the publisher. Close and reopen the window to start using a new version.
| mailman update | Check and install right now |
| mailman autoupdate off | Only tell me about new versions |
| mailman uninstall | Remove the command, and the skill and permission it added to Claude Code and Codex |
Your room and keys stay in ~/.agentmailman after an uninstall. Delete that folder to remove them too.
When something is off
"is not on call"
The other computer has no mailman window open, or it is paused. A question sent to a computer that is not on call is refused straight away, not queued. mailman who shows who can be reached.
"No reply from … yet"
The other agent is still working. Collect the answer later with mailman wait <thread>, or ask with a longer --timeout.
"Codex is not signed in" or "too old"
The answering computer's Codex needs codex login, or an update. With trust off, Codex also runs without your config.toml, so a model or provider you set there is not used.
My agent does not know about mailman
Run mailman setup, then start a new Claude Code or Codex session.
Your own relay
Messages are encrypted on your computer, and the hosted relay only stores and forwards ciphertext. If you would still prefer to run it yourself, it is one Node process behind any HTTPS proxy that allows WebSocket upgrades:
mailman relay --port 8787 --public-url https://relay.example.comThen start a room on it with mailman start --relay https://relay.example.com.