agent-bridge
Skill4 starsChanged 6 months agoMITView on GitHub
Operate the bridge-harness inter-agent comms reliably: report your identity, discover who is online across projects, message any agent by identity, spawn new agents in a terminal tab that auto-register, and keep your rooms aligned with your git worktree. Works on any host of the bridge tools (Claude Code, Pi, Codex, ...). Trigger: When the user says "activa bridge harness", "usa bridge harness", "agent bridge", "activa bridge", "usa bridge", asks who is connected on the bridge, or asks to create/spawn a new agent ("crea un agente de pi/claude para que ...").
8 other projects use a version of this.
Adopted by
Most recently taken up by
- kununu/agent-bridgetheir own version, first seen Nov 12, 2026
- Latth/agent-bridgetheir own version, first seen Nov 8, 2026
- ilamanov/skillstheir own version, first seen Oct 13, 2026
- avas-app/agent-bridgetheir own version, first seen Sep 24, 2026
- JaylanJerry/codex-agent-bridgetheir own version, first seen Sep 20, 2026
- Mihirokte/agent-skillstheir own version, first seen Jul 31, 2026
Other versions8 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 8
- kununu/agent-bridge★ 18same name
- xyva-yuangui/agent-bridge★ 15same name
- EthanSK/agent-bridge★ 11same name
- avas-app/agent-bridge★ 3same name
- Latth/agent-bridge★ 2same name
- ilamanov/skills★ 1same name
- JaylanJerry/codex-agent-bridge★ 0same name
- Mihirokte/agent-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository5 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- openspec-apply-changeSkill
- openspec-archive-changeSkill
- openspec-exploreSkill
- openspec-proposeSkill
The file
We split this skill into the rules it gives an agent
3 rules. 0 are common, 1 is distinctive, and 2 are very specific to this project.
0
Common
Most of the 7 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 52
NOT follow you if you move to a different git worktree.
- Very specific: line 58
If that differs from the project reported by whoami, call use_bridge with that name.
- Very specific: line 126
After calling spawn_agent, wait for the new agent's confirmation DM — read to catch its "<name> online, ready" message, then coordinate the …
“Common” is measured: kept by at least 6 in 10 of the 7 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
How to invoke (host-specific)
The bridge exposes the same capabilities everywhere; only the call syntax differs:
- Claude Code / Codex / MCP hosts — call the tools directly:
whoami,send,read,list_agents,join_room,who_is_in,use_bridge,set_name,spawn_agent. - Pi — call the single tool
agent_bridgewith anaction:agent_bridge action=send to=... message=...,agent_bridge action=whoami, etc. (actions:send,read,whoami,list_agents,join_room,use_bridge,set_name,spawn_agent).
Below, an action like whoami means "the whoami tool" on Claude/Codex, and
"agent_bridge action=whoami" on Pi.
When to Use
- The user says "activa bridge harness", "agent bridge", or "activa bridge".
- The user asks who is connected / quién está conectado on the bridge.
- You need to send to, or coordinate with, another agent over NATS.
Routing model (read this first)
| Concern | How it works |
| Direct messages | GLOBAL by identity. send to: "agent:<agentId>" reaches that agent across ANY project / git worktree. Subject: bridge.dm.<agentId>. The reliable way to reach someone. |
| Discovery | GLOBAL. list_agents shows every agent online across all projects, each tagged with its project. The roster is reliable (agents broadcast who-there on connect and reply with here). |
| Rooms | Project-scoped (bridge.<project>.room.<room>). Each git worktree has its own isolated lobby; a room only reaches agents in the same project. |
| Durability | DMs are retained by JetStream (~30 min) and redelivered, so you're woken for every DM. Needs nats-server -js (the bundled auto-start does this). |
Activation Sequence (run in order, every time)
- Identify yourself —
whoami. ReportagentId,displayName,project. - Check your worktree ↔ room alignment (see below) and realign if it drifted.
- Discover peers —
list_agents. Show the user who is online and where. - Show the comms cheat-sheet so you never mis-route.
Worktree drift check (do this at activation and after any cd)
project (which scopes your rooms) is captured when the agent process starts and does
NOT follow you if you move to a different git worktree. Verify and realign:
basename "$(git rev-parse --show-toplevel)" # your CURRENT worktreeIf that differs from the project reported by whoami, call use_bridge with that
name. DMs are global, so messaging still works even if your room drifts — this only
keeps your room/lobby membership correct.
Critical Patterns
| Rule | Why |
| DM by identity to reach anyone | send to: "agent:<agentId>" is global and durable — works across projects/worktrees and wakes the peer. Prefer over rooms for real-time. |
| Rooms are project-local | send to: "room:<project>" only reaches agents in the same project. Use it for a shared lobby, not to reach someone elsewhere. |
read is pull-based | You see messages when you read. On Claude a rewake hook wakes you on incoming DMs; on Pi messages are pushed into your turn. Either way, read after any expected exchange. |
send warns on no recipient | NATS "succeeds" at publishing to nobody. If send warns the target isn't visible, re-check the agentId with list_agents. |
| NATS must be up (with JetStream) | Transport is NATS on localhost:4222, started with -js for durability. If real-time stops, verify NATS first. |
Comms Cheat-Sheet
# Claude Code / Codex (direct tools):
whoami
list_agents
send to: "agent:<agentId>" message: "<text>" # global DM, durable
send to: "room:<project>" message: "<text>" # your project's lobby only
read
use_bridge bridge: "<project>" # realign rooms / share a room
set_name name: "auth-reviewer" # memorable handle → reachable as agent:auth-reviewer
spawn_agent tool: "pi" name: "verifier" task: "..." # open a new agent in a tab; it DMs you when up
# Pi (single tool, action=):
agent_bridge action=whoami
agent_bridge action=list_agents
agent_bridge action=send to="agent:<agentId>" message="<text>"
agent_bridge action=read
agent_bridge action=use_bridge bridge="<project>"
agent_bridge action=set_name name="auth-reviewer"
agent_bridge action=spawn_agent tool="pi" name="verifier" task="..."Stable, memorable identity. The auto-generated agentId can be awkward to share. If
the user gives you a name (or asks you to pick one), call set_name — it sets your
displayName AND makes you reachable as agent:<name> (a stable DM alias on top of your
agentId). Use a unique name; two agents sharing one would both receive its DMs.
Your DM subject (what wakes you): bridge.dm.<agentId> (claude-code-<ppid> for Claude,
pi-<pid> for Pi). Under cmux, your displayName includes the surface name (e.g.
Claude Code @ review) so instances are distinguishable.
Spawning a new agent (spawn_agent)
Launch a brand-new agent in a fresh terminal tab that gets on the bridge by itself and reports back to you. Use it when the user says e.g. "crea un agente de pi para que verifique X".
spawn_agent tool: "pi"|"claude" name: "test-verifier" task: "verify the login flow"
# Pi: agent_bridge action=spawn_agent tool="pi" name="test-verifier" task="verify the login flow"What it does:
- Detects the terminal host — a capability probe checks pane controllers before the
emulator (cmux → tmux → zellij → plain emulator). This ordering matters: cmux runs on
top of ghostty, so
TERM_PROGRAM=ghosttyandCMUX_SOCKET_PATHcoexist; checking the emulator first would wrongly conclude "can't open a tab". - Opens the tab and launches the agent with a one-line startup prompt telling it to:
activate the bridge,
set_name "<name>", DM you to confirm it's active, then dotask. - Graceful fallback — on a plain emulator (or if the spawn fails), it does NOT fail silently: it returns the exact command for the user to paste into a new tab. The command is identical to what it would have run itself.
After calling spawn_agent, wait for the new agent's confirmation DM — read to catch
its "<name> online, ready" message, then coordinate the task over the bridge.
Optional fallback — application-level "Roll Call"
list_agents is the primary, reliable presence source. Only if you suspect the roster
is stale, probe manually: send to: "room:<project>" message: "WHO_IN? from=<myAgentId>",
then read the HERE ... DM replies (dedupe by id, exclude your own echo). If you
RECEIVE a WHO_IN?, reply by DM to agent:<requesterId> with your identity.
Verification
- You reported your own
agentIdand confirmed your room matches your git worktree. list_agentsshows live peers across projects.- A DM to
agent:<id>reaches the peer and wakes them; youreadthe reply.
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.

