Agent Mailbox: messaging plugin for Codex and Claude Code
· MIT license · Python 3.10+
Agent Mailbox is an open-source plugin for local agent-to-agent messaging between Codex and Claude Code. A shared SQLite mailbox, Python CLI, and coordination skills let sessions exchange tasks, questions, answers, and results on the same computer.
Keep your conversation with a team lead while teammates use addressed inboxes to ask questions and return work. Either product can be the lead. No MCP server or hosted mailbox service is required; agents receive messages when they check their inbox.
Quickstart · Install the plugin · Start a team · CLI reference · FAQ · Architecture
What you can use it for
- Coordinate Codex and Claude Code teammates: delegate a task, route a question to the human through the lead, and return the answer in the same conversation thread.
- Run independent teams: give each top-level task its own run and lead in one database. Every session has its own address; run boundaries keep mailbox queries separate.
- Continue long tasks: give a replacement session a newly addressed assignment with the original task reference and a versioned checkpoint. See session replacement.
- Recover unacknowledged messages: retry sends with stable keys and reclaim delivery after a lease expires. See retry and recovery for the limits.
Requirements
Python 3.10 or newer, Git, and a local filesystem. The runtime has no third-party Python dependencies. Both agent processes must be able to read/write the selected database and access the CLI. Plugin installation does not install Python or start agents.
Quickstart
git clone https://github.com/mavka-ai/agent-mailbox.git
cd agent-mailbox
python3 --version
./bin/agent-mailbox --help
Try the local messaging demo from the checkout:
python3 scripts/demo.py
It sends a task, receipt, question, simulated human answer, and result through the real CLI. It makes no model calls and does not launch Codex or Claude agents. To connect your own sessions, install the skills, then create a run and send a task.
Keep this checkout at a stable location and pass its absolute bin/agent-mailbox path to agents. No pip install is required. If an archive or plugin cache loses executable permissions, invoke it as python3 /absolute/path/agent-mailbox/bin/agent-mailbox; the Git checkout preserves its executable bit.
Install the skills
Codex and Claude Code use the same skills and core with their own package metadata. Installation commands below refer to the checkout directory. Use current native CLI versions with plugin support; start a new session after installation.
Codex plugin
codex plugin marketplace add /absolute/path/agent-mailbox
codex plugin add agent-mailbox@agent-mailbox-local
Then invoke $mailbox-setup, $mailbox-lead, or $mailbox-teammate from the installed plugin's skill picker. If the host displays a namespaced name, use that displayed name.
Claude Code plugin
claude plugin marketplace add /absolute/path/agent-mailbox
claude plugin install agent-mailbox@agent-mailbox-local
Invoke /agent-mailbox:mailbox-setup, /agent-mailbox:mailbox-lead, or /agent-mailbox:mailbox-teammate. For a session-only local preview: claude --plugin-dir /absolute/path/agent-mailbox.
The catalogs are third-party/local sources, not listings in either provider's public directory. If a host version lacks a command above, use its native plugin browser or upgrade that host; the standalone CLI still works. Native setup details: OpenAI packaging, Claude marketplaces.
Use a database directory outside the checkout and plugin caches. Installed copies may move on updates. In the examples below, replace the paths and export the variables in each new shell that needs them:
export MAILBOX_CLI="/absolute/path/agent-mailbox/bin/agent-mailbox"
export MAILBOX_DB="/absolute/path/team-state/mailbox.db"
export MAILBOX_RUN="website-review"
mkdir -p "$(dirname "$MAILBOX_DB")"
Start a team
Create an independent run and its leader:
"$MAILBOX_CLI" --db "$MAILBOX_DB" --run "$MAILBOX_RUN" \
--as codex-session-17 run-create --label "Review the website" --client codex
Register the teammate:
"$MAILBOX_CLI" --db "$MAILBOX_DB" --run "$MAILBOX_RUN" \
--as claude-session-82 register --role teammate --lead codex-session-17 --client claude