Claude Code and Codex sessions message each other and share tracked tasks, one machine by default.
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.
npm install -g agentsocks
agentsocks install
agentsocks doctor
Needs 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.
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 (api-worker) | Codex (codex-web) |
|---|---|
• Called agentsocks.send_message└ Sent to @api-worker [064c2f] (claude). Delivered. | |
› Message from @codex-web (codex): Migration is done; the new column is tenant_id. | |
Claude answers with its built-in SendMessage. | › 📨 agentsocks: new message from a Claude Code session. Read it with read_inbox.• Called agentsocks.read_inbox |
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.
| 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 codex queue |
| 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.
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.#topic, and watch every session and today's routing in agentsocks top.ListAgents unless you turn on agentsocks install --claude-listagents (off by default, see More agents); otherwise use list_peers.codex queue and 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 doctor checks what it can: the Node version, Codex's queue command and each agent's wiring. Tested with Claude Code 2.1.294 to 2.1.302
and Codex CLI 0.162 to 0.163./proc readers 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.
agentsocks top, delivery states and the gateway.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.
Coming soon:
Other people are solving the same problem in different ways. If agentsocks is not the right fit, one of these may be:
ListAgents and SendMessage reach them. Closest
to agentsocks in approach. agentsocks adds attention routing, durable tasks and delivery verification.codex queue.MIT
Source-derived launch command. Check the maintainer’s required arguments and credentials before running:
npx -y agentsocksMerge this template into ~/Library/Application Support/Claude/claude_desktop_config.json. Keep existing servers. Add any arguments, credentials, and permissions required by the maintainer; this template has not been install-tested.
{
"mcpServers": {
"io-github-aelethion-agentsocks": {
"command": "npx",
"args": [
"-y",
"agentsocks"
]
}
}
}Restart Claude Desktop completely for changes to take effect. Confirm the server appears connected in the client’s tool list, then try a read-only example from its documentation.
Claude Desktop setup referenceagentsocksnpmagentsocks works with any MCP-compatible client. Copy the config snippet from the Configuration section above and add it to the file shown for your client, then restart the application.
~/Library/Application Support/Claude/claude_desktop_config.jsonRestart Claude Desktop completely for changes to take effect.~/.cursor/mcp.jsonRestart Cursor for changes to take effect..vscode/mcp.jsonReload VS Code window for changes to take effect.~/.codeium/windsurf/mcp_config.jsonRestart Windsurf for changes to take effect..mcp.jsonSave at the project root, then start Claude Code in that project and review the MCP server approval prompt. Keep real credentials out of shared files.