Agent Peers logo

Agent Peers

Routes messages between local Claude Code and Codex sessions over Unix sockets, with peer discovery and reply delivery.

Install Agent Peers

Run the project’s own setup commands, in order.

Setup steps from the project

agent-peers installs with its own steps rather than a config we can generate, so these are copied as-is. Follow them in order and run the commands in a terminal. Source: github.com

  1. 1. Install
    npm install -g agent-peers@next
    
  2. 2. Add to Codex
    codex mcp add agent-peers -- codex-peer
    

Overview

agent-peers connects independent Claude Code and Codex sessions for local agent-to-agent messaging across repositories and projects. Its Codex integration runs as an MCP server with peer discovery and message sending, while Claude Code uses its native SendMessage tool. Messages travel over Unix sockets between sessions running under the same OS user, and replies return to the conversation that initiated the request. Reach for it when separate coding agents need to coordinate decisions or work without sharing a single context.

Use cases

  • Coordinate API decisions between Claude Code and Codex sessions
  • Ask a peer agent about changes made in another repository
  • Route answers from a worker session back to a lead conversation
  • Discover active local coding-agent sessions

Key features

  • Local Unix-socket agent messaging
  • Codex MCP server with peer discovery
  • Claude Code SendMessage integration
  • Automatic reply delivery to the originating conversation
  • Hermes and opencode experimental plugins
  • CLI discovery, diagnostics, and JSON logs

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

4/4 checks healthy over the last 16d

How Agent Peers works

What agent-peers does

agent-peers lets separate coding-agent sessions exchange messages while retaining their own context and workflows. Claude Code and Codex sessions can discover one another, ask questions, coordinate changes, and return replies to the originating conversation. Communication can span different projects and repositories as long as the sessions run locally under the same operating-system user.

The project also includes experimental integrations for Hermes and opencode. Hermes can contact Claude and Codex through a native plugin, while the opencode 2.x plugin exposes the same peer tools used by the Codex integration.

How it works

Local Unix sockets provide the transport, so no separate broker, account, or hosted service is required. A peer appears with an identity such as codex:<folder>-<id> or a uds: address that Claude Code can use with SendMessage.

Codex connects through the app-server used by agent-peers. The shared Codex daemon is the default path; headless workers can use a private app-server. Embedded servers started by codex exec, --no-daemon, or certain configuration overrides cannot be reached by peers.

Messages are delivered to a peer's inbox while its host is idle or busy, using the host's normal conversation handling. Delivery confirms that the inbox accepted the message, not that the model produced an answer. There is no offline mailbox, so a closed conversation cannot receive messages.

Setup and configuration

The runtime requirement is Node.js 22 or newer on Linux or macOS. Install the package globally with the npm next tag:

Terminal
npm install -g agent-peers@next

Register the Codex MCP server with:

sh
codex mcp add agent-peers -- codex-peer

Keeping the MCP server name as agent-peers enables the inbox to open when a Codex session starts. Claude Code requires no MCP server; add instructions telling the agent to run agent-peers list, then use SendMessage with a discovered uds: address.

The CLI includes agent-peers list for discovery and agent-peers doctor for installation checks. Set AGENT_PEERS_DEBUG=1 for local diagnostics, then inspect retained metadata with agent-peers logs --json. Existing processes must restart before inheriting the debug setting.

Hermes can install the experimental plugin with hermes plugins install ThomasMarcelis/agent-peers --enable, followed by the documented dependency and injection setup. Stock Hermes supports discovery only; sending requires the documented Hermes fork. opencode 2.x can install its plugin with opencode plugin add agent-peers@next and must be restarted afterward.

Tools and capabilities

The Codex MCP integration supports:

  • list_peers to discover reachable agent sessions.
  • send_peer(to, message) to send a message to a selected peer.

The opencode plugin exposes those tools plus claim_name and release_name for stable session names. Claude Code uses the native SendMessage tool after discovering peers through the CLI. Hermes provides plugin-based contact with Claude and Codex, including private replies to the originating conversation.

Limitations and notes

Messages are peer input rather than user approval, and host approval policies still apply. A peer can answer on its own, but changing a worker's task mid-turn requires the documented headless-worker setup and an instruction in its brief.

Hermes support is experimental, and opencode support is experimental as well. opencode sessions become reachable after a prompt or tool call, can become unbound after 60 minutes without session activity, and should not be run in two servers at once. Its --auto mode can approve tool calls that are not explicitly denied, so it should not be used with untrusted peers or sensitive repositories.

The local transport limits communication to the same machine and OS user. Closed conversations are unreachable, and the system does not provide an offline queue. Diagnostic logs retain bounded metadata, timings, correlation IDs, and failure categories while excluding message bodies and raw errors.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Agent Peers

agent-peers is an MCP server that connects local Claude Code and Codex sessions for agent-to-agent messaging. Codex can use `list_peers` to discover sessions and `send_peer` to contact them, while replies return to the originating conversation over local Unix sockets.

Install it globally with Node.js 22 or newer using `npm install -g agent-peers@next`, then register it with `codex mcp add agent-peers -- codex-peer`. Linux or macOS is required.

Yes, Claude Code uses its native `SendMessage` tool rather than an MCP server. Run `agent-peers list` to find peers, then send to a listed `uds:` address.

No, agent-peers has no offline mailbox. A closed conversation is unreachable, and delivery confirmation only means the peer inbox accepted the message, not that the model replied.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewAgent Peers AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/agent-peers?style=directory)](https://allmcps.com/mcp/agent-peers)
HTML Embed
<a href="https://allmcps.com/mcp/agent-peers"><img src="https://allmcps.com/api/badge/agent-peers?style=directory" alt="Agent Peers on AllMCPs" /></a>