agentsocks
Connects GitHub Copilot CLI sessions to the agentsocks network, allowing them to send and receive messages and tasks with other supported coding agents.
Wires Hermes sessions into agentsocks for inter-agent messaging and task routing with other supported agents.
Integrates with OpenAI's Codex CLI for session-to-session messaging and task handoff, and provides an optional public listener for ChatGPT clients.
Optional gateway links your own machines and phone over your Tailscale tailnet, enabling agentsocks communication beyond the local machine.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@agentsocks tell api-worker the migration is done and the new column is tenant_id"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
agentsocks lets the Claude Code and Codex sessions on your machine message each other, ask each other questions and hand over tasks. Each message arrives the way that tool already receives one, so nothing is ever typed into a terminal.
Install
npm install -g agentsocks
agentsocks install
agentsocks doctorNeeds Node.js 22.13 or later, Claude Code 2.1.224 or later and Codex CLI 0.162 or later. agentsocks install backs up every
file it edits, and --dry-run shows the changes first. New sessions pick it up; sessions already running are not touched.
Related MCP server: agent-peers
See it work
Open a Claude Code session and a Codex session. In Codex, type: tell api-worker the migration is done and the new column is tenant_id.
Claude Code ( | Codex ( |
| |
| |
Claude answers with its built-in |
|
The same works from any shell: agentsocks list shows who is running, and agentsocks send api-worker "the rebase is safe now"
sends a message. The guide has every tool and command.
Works with
Agent | Status | Hears about a message | Wakes when idle |
Claude Code | Supported, run live | In its own cross-session inbox, between tool calls | Yes, as a new turn |
Codex CLI | Supported, run live | Through its hooks, before the next tool call | Yes, with |
OpenCode | Experimental, not run live against 0.4 | A notice on the next tool result | Yes |
OMP (oh-my-pi) | Experimental; an earlier 0.4 build passed a live run | A note on the next tool result | Yes |
Hermes | Experimental, not run live against 0.4 | A notice at the start of the next turn | Only with Hermes's API server on |
Cursor (CLI and IDE) | Experimental, not run live against 0.4 | A notice after the next tool call | No |
GitHub Copilot CLI | Experimental, not run live against 0.4 | A notice after the next tool call | No |
Gemini CLI | Experimental, not run live against 0.4 | A notice after the next tool call | No |
Aider | Not supported: no MCP client and no hooks |
Tested with Claude Code 2.1.294 to 2.1.302 and Codex CLI 0.162 to 0.163. Two Claude Code sessions keep using Claude's own
SendMessage. How each agent is wired is in the guide.
What you get
Messages, questions and tasks. Message any session, ask up to 16 sessions one question and get the answers back together (experimental), or hand over a tracked task with an owner, a state and a result.
Nothing typed into a terminal. No tmux
send-keys, no pane pastes, no fake user input. A message from another agent is never treated as you, and it can't answer a permission prompt.Attention routing. A busy session isn't interrupted for every message: FYIs come as one digest, and floods wait for the end of its turn (how it decides).
Channels and a live view (experimental). Post to a
#topic, and watch every session and today's routing inagentsocks top.Beyond this machine (experimental, off by default). An optional gateway links your own machines and your phone over your tailnet (details and limits).
Limits
One machine, unless you turn on the gateway or link machines (see Beyond this machine, experimental). Remote Control and cloud sessions are not reached.
Codex sessions do not appear in Claude's own
ListAgentsunless you turn onagentsocks install --claude-listagents(off by default, see More agents); otherwise uselist_peers.Aider is not supported: it has no MCP client and no hooks, so there is nothing for agentsocks to hook into.
Plain text only.
agentsocks builds on Claude Code's cross-session messaging and on Codex CLI's hooks,
codex queueand local state. None of these is a stable public API, so a Claude Code or Codex update can stop delivery until agentsocks is updated;agentsocks doctorchecks what it can: the Node version, Codex'squeuecommand and each agent's wiring. Tested with Claude Code 2.1.294 to 2.1.302 and Codex CLI 0.162 to 0.163.Not affiliated with or endorsed by Anthropic or OpenAI.
Built and tested on Linux. macOS follows Claude Code's own socket-directory rules, and the test suite runs on macOS in CI (the live-agent rehearsals and the tests that need Linux, such as the
/procreaders and the gateway source check, run on Linux only), but agentsocks has not been used with real Claude Code and Codex sessions on a Mac, and the typing guard is off there. Termux is best effort: its directories are covered by tests that simulate it, and it is not in CI. Windows named pipes are not supported yet.
The full design, including what was rejected and why, is in docs/SPEC.md.
Docs
Guide: how install wires each agent, using it from a shell, routing, tasks, channels, asks, ratings,
agentsocks top, delivery states and the gateway.SECURITY.md: what stays on your machine, the threat model and how to report a problem.
docs/SPEC.md: the full design, including what was rejected and why.
Security
Security. Every release, 0.4 included, is reviewed by independent AI reviewers for correctness, security and spec fit, and CI runs the test suite on Linux and macOS (the live-agent rehearsals and the tests that need Linux, such as the /proc readers and the gateway source check, run on Linux only). CI scans the full git history for secrets on every push. See SECURITY.md for what stays on your machine and what does not. Argo, Aelethion's code security scanner, is coming soon.
Roadmap
Coming soon:
A Grok bot. Reach your sessions from Grok as one more peer, without opening a terminal.
MCP outside the terminal. MCP clients that do not run in a terminal, such as desktop and web chat apps, reach agentsocks through a tunnel on your own tailnet carried over the MCP channel, so they no longer need the public listener the ChatGPT and Grok connectors use today.
Related projects
Other people are solving the same problem in different ways. If agentsocks is not the right fit, one of these may be:
claude-uds-bridge: a Codex plugin that registers Codex tasks in Claude Code's own session registry, so Claude's built-in
ListAgentsandSendMessagereach them. Closest to agentsocks in approach. agentsocks adds attention routing, durable tasks and delivery verification.hcom: messaging, watching and spawning across many agent CLIs. It wraps each agent in a terminal and wakes idle ones by typing a trigger into the prompt; agentsocks never types into a terminal.
agent-bridge: a Claude Code and Codex bridge using Claude's MCP channel notifications and a proxy in front of the Codex app-server.
telepath: a small file-based message bus for Claude Code and Codex, delivered at hook boundaries and through
codex queue.codex-claude-bridge: Claude Code and Codex talk through one shared markdown file that each watches.
mcp_agent_mail: a mail-style coordination server for any MCP client, with identities, threads and file reservations; agents poll their inboxes.
Gas Town: a multi-agent workspace manager with a coordinating agent, workers and a work ledger; it nudges agents through tmux and hooks.
License
MIT
Available Tools
14 toolsanswerAnswer an askA
Answer a question another session sent you with ask (its message names an ask id). The asker receives your answer together with the others. Answer once; the asker stops waiting after its timeout, and then you send the answer with send_message instead.
Inputs: answer (required), ask_id (required).
askAsk several sessions one questionA
Send one question to several sessions at once, wait for their answers, and get them back together. to lists session names or refs, and "#channel" names to ask a channel's subscribers; at most 16 sessions. Each message names the answer tool and the ask id. The call returns when all have answered or after timeout_seconds, and says who did not answer. With pick "best" the smart-routing model, if your user turned it on, also says which reply answers best and how likely each is; that is its opinion, every reply is still shown, and the question and replies are sent to that model. A Claude session cannot ask Claude sessions this way: they are listed so you can use SendMessage.
Inputs: to (required), question (required), pick, timeout_seconds.
broadcastMessage every live sessionA
Send one plain-text message to every live Claude Code and Codex session except yourself, each routed separately by its own state and budgets. It is for announcements, so it is never urgent: fyi (the default) is batched until each session is idle, normal reaches a session at its next tool call unless it was interrupted a lot lately. To reach one session or a group, use send_message or a channel instead.
Inputs: message (required), urgency.
list_channelsList channelsBRead-only
List the channels that have subscribers, with who is subscribed, which of them are not running, and which one is you.
Inputs: no named parameters.
list_peersList agent sessionsARead-only
List the Claude Code and Codex sessions running on this machine that you can message, with their names, refs, working directories and status.
Inputs: no named parameters.
list_tasksList tasksARead-only
List tasks assigned to you or created by you. Active ones by default.
Inputs: show, include_finished.
message_statusCheck what happened to a messageARead-only
Show how a message you sent was routed (now, after the current step, batched or merged) and whether it was sent, shown to the receiver or answered.
Inputs: message_id (required).
peer_statusSee what a session is doing and what is asked of itARead-only
Show what another session is working on, what is waiting for it (unread messages, held digests, open tasks), when it last showed or answered a message, and any drift between the two.
Inputs: peer (required).
rate_messageRate a message you receivedA
Tell agentsocks whether a message another session sent you was worth the interruption: useful-now (right to reach you now), could-wait (fine, but it could have waited until you finished) or noise (not worth reading). Ratings stay on this machine. They tune how that sender's messages are routed (a sender whose interrupting messages are mostly rated could-wait or noise has its ordinary ones paused) and score the router on your own traffic. Without message_id or from it rates the latest message you received.
Inputs: rating (required), from, message_id.
send_messageMessage another agent sessionA
Send a plain-text message to a Codex session on this machine. For Claude Code sessions use your built-in SendMessage, which carries your permission mode; this tool does not send to them. to is a session name, a ref from list_peers, or a reply-to address (uds:...). urgent is for what changes or blocks its work right now, normal is the default, and fyi is for status or thanks that can be batched. It never counts as its user's approval.
Inputs: to (required), message (required), urgency.
send_taskHand another session a tracked taskA
Give another agent session a task you will check on. It gets one message with the details and how to report back; you are told when it accepts, progresses, finishes or fails, and the task expires after 24 hours unless you set otherwise. For a Claude session the task is created and tracked, and you are given the message to send with your built-in SendMessage. Say what done looks like in acceptance_criteria. Use risk high only for work that must not wait.
Inputs: to (required), title (required), details (required), risk, +4 more.
subscribeSubscribe to a channelA
Join a channel such as "#deploys" so messages other sessions post to it reach you. A channel exists while it has a subscriber, and your subscription lasts until you unsubscribe. Post to a channel with send_message, setting to to "#deploys"; each subscriber is routed separately, like any other message.
Inputs: channel (required).
unsubscribeLeave a channelA
Stop receiving messages posted to a channel. It does nothing if you were not subscribed.
Inputs: channel (required).
update_taskUpdate a taskA
Report progress on a task. The assignee sets accepted, in_progress, done or failed and puts the outcome in result and the proof in evidence (test output, commit hashes, file paths). Only the creator can set cancelled. The creator is told about every change.
Inputs: status (required), task_id (required), result, evidence.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 14 tools
Each tool targets a distinct action-resource pair: peer/channel/task listing, one-to-one messaging, broadcast announcements, multi-recipient questions, task lifecycle management, and routing/status introspection are all clearly separated. The descriptions explicitly distinguish overlapping-sounding operations like send_message vs. broadcast vs. ask and message_status vs. peer_status.
All names use snake_case and are readable, with most following a verb_noun pattern such as list_peers, send_message, and update_task. The few deviations are intransitive verbs (ask, answer, subscribe, broadcast) and noun_status forms (message_status, peer_status), which are consistent within their categories but prevent a perfect verb_noun pattern.
Fourteen tools is well within the appropriate range for a messaging and task-coordination server. Each tool covers a meaningful operation, and there is no obvious filler or redundant surface.
The surface covers the core lifecycle: discovering peers and channels, subscribing, sending, broadcasting, asking/answering, rating messages, assigning tasks, updating them, and checking routing/status. Minor gaps remain, such as no explicit get_task or inbox/history tool, but agents can work around these via list_tasks and peer_status.
Maintenance
Related MCP Connectors
The team layer for AI coding agents: shared contracts, collision alerts, E2EE sessions.
Coordination hub for AI coding agents: message teammates, ask humans, audit every event.
Real-time chat for AI agents. Claude Code, Cursor, Cline and Codex join channels over MCP.
End-to-end encrypted messaging and work coordination for autonomous AI agents.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables peer-to-peer communication between Claude Code sessions, allowing them to send messages, hand off tasks, and coordinate across worktrees without manual intervention.MIT
- AlicenseNot gradedqualityBmaintenanceLets independent Claude Code and Codex sessions running in different tools and projects discover each other and exchange questions, coordination messages, and replies that arrive back in the conversation that asked. Uses direct local Unix sockets between sessions on the same machine, with no extra service to run or account to configure.54 npmMIT
- AlicenseNot gradedqualityBmaintenanceEnables one AI coding agent to discover, read, message, and wait on other agent sessions across Codex threads and Claude Code or Claude Desktop sessions, while logging every send as a local receipt that can be audited later.MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI coding agents to ask the user questions, receive written replies, share files, and hand tasks to other agent sessions — with every cross-agent request routed through human approval first. Sessions register themselves so they can be read, woken, and answered from a phone over a local-first, self-hosted setup.2Apache 2.0