# Letterbox ![Status: Reference Implementation](https://img.shields.io/badge/status-reference%20implementation-blue) ![PyPI](https://img.shields.io/pypi/v/letterbox) ![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue) ![License: MIT](https://img.shields.io/badge/license-MIT-green) ![POSIX only](https://img.shields.io/badge/platform-POSIX-lightgrey) ![MCP Registry](https://img.shields.io/badge/MCP-Registry-purple) > 📌 **Built for internal production use.** Architecture proven across months of daily AI development. Open-sourced as a reference implementation. I use it almost daily. If you use AI coding assistants in the terminal, you normally work with one at a time — and getting two of them to collaborate means copy-pasting messages between windows yourself. Letterbox lets two assistants (say, Claude and Gemini, or Gemini and Mistral's Vibe) talk *directly* to each other and work a task together, hands-free. **The result:** one agent can plan while another reviews, or the two can split the work between them — collaborating on their own while you watch, instead of relaying every message by hand. *A small file-based comms protocol that lets two AI agents in separate terminals talk to each other in real time.* **Letterbox** lets two terminal coding agents — Claude Code, Gemini CLI, Antigravity, or Mistral's Vibe — hold a real-time conversation by passing message files through a shared directory. When one agent speaks, a `📬` notification is injected into the other's terminal and wakes it to read and reply. No network, no server, no shared memory: just JSON files in a folder and the OS's atomic-rename. It's the messaging layer that was built for an internal planning loop, extracted into a standalone, versioned tool in 2026. If you've ever wanted two CLI agents to collaborate on a task without you copy-pasting between windows, this is for you. It gets the occasional update at the author's whim (the launcher tells you when a newer one is out) — but it's currently unsupported small project, not a community one. The bridge is cross-harness: **Claude on one side, Gemini on the other**, talking through the same channel, has been verified live. The one wrinkle is setup — Claude wires itself automatically, while Gemini and Antigravity load letterbox from their own settings. The [Setup](#setup-per-harness) section walks through both. ## Why it exists I work with two AI collaborators every day — Claude and Gemini — each living in whatever terminal harness it runs in (Claude Code, Gemini CLI, Antigravity CLI, and now Mistral's Vibe). Letterbox is how I get them talking to *each other* instead of through me. That happens in two modes. Sometimes it's **manual**: we're brainstorming and I want to loop the other model into the conversation. Sometimes it's **automated** — in the planning loop, Claude drafts a plan and each plan is routed to Gemini for review as a built-in stage. Letterbox carries both the same way. It's harness-agnostic by design — **Claude Code ↔ Gemini CLI ↔ Antigravity CLI ↔ Vibe** in any combination — and same-model pairs work just as well: two Claude tabs, or two Gemini tabs, talking over one channel. ## What it is Each `letterbox ` launch runs **two coordinated processes** inside one terminal: ``` letterbox claude --channel demo --as alice │ ├─ PTY-Parent (the foreground letterbox process) │ • spawns the harness CLI as a PTY child │ • watches the channel directory for peer writes │ • injects 📬 notifications into the PTY on arrival │ └─ the harness spawns: └─ letterbox mcp (stdio MCP server, agent-spawned) • send_message / check_messages / acknowledge • check_latest_message / channel_info / list_channels Both sides coordinate ONLY through the filesystem: ~/.letterbox/channels/demo/ msg-*.json ← one file per message .read/alice.json ← per-agent read markers .read/bob.json ``` There is no daemon, no IPC, no background service. The filesystem *is* the coordination medium — the PTY-Parent's watcher sees a new `msg-*.json` appear and renders a notification; the channel directory is durable, inspectable, and `cat`-able. Crash recovery is trivial because nothing valuable lives in memory. **How the agent gets the letterbox tools differs per harness**, and it's the one thing you configure once: - **Claude Code** takes a launch flag, so letterbox wires it *automatically* — it generates a temporary MCP config and passes `--mcp-config` to `claude`. Nothing for you to set up. - **Gemini CLI and Antigravity** don't take that flag; they load MCP servers from their own settings file. You add a one-line, channel-agnostic `letterbox` entry there once, and the launcher hands each session its channel and identity through environment variables at launch — so you never edit settings per channel. - **Vibe** loads MCP servers from `~/.vibe/config.toml`. Its MCP subprocess inherits only a trimmed environment, so a one-time bridge script is needed to relay `LETTERBOX_CHANNEL` / `LETTERBOX_SENDER` from Vibe's own process env. Once that's in place, any channel works exactly like Gemini. See the [Vibe setup](#vibe-mistral) section. ## Who it's for - People running terminal coding agents who want **autonomous AI↔AI dialogue** on one machine, without babysitting copy-paste between windows. - People who value **files as the source of truth** — auditable, greppable, no opaque protocol, no magic. ## Who it's NOT for - Anyone wanting a **hosted or networked** chat service — the message protocol is filesystem-local and never touches the network. (The launcher makes one optional, best-effort version check at startup; disable it with `LETTERBOX_NO_UPDATE_CHECK=1`.) - Anyone wanting a **multi-user platform** — it's a point-to-point bridge between agents on one machine, not a many-user hub (see [Built for two](#built-for-two)). - **Windows-native** users — v1 is POSIX-only (see [What we don't support](#what-we-dont-support)). - Anyone wanting a **supported product** — letterbox is versioned and gets the occasional update at the author's whim (the launcher tells you when a newer one is out), but there's no roadmap, no SLA, and no commitment to take feature requests or keep maintaining it. Use it as-is; pull a newer version if it helps. ## Built for two Letterbox is a **two-way bridge at heart** — one peer talking to one peer is what it's designed and tuned for. Three or more agents *can* share a channel: directed addressing (`send_message(to="