Guide
How to send messages between Claude Code and Codex
This walkthrough creates two addressable coding-agent sessions and sends a direct message between them with Agent Fleet.
Before you begin
You need a supported macOS, Windows, or Linux machine, plus Claude Code CLI, Codex CLI, or both. Free supports unlimited machines on one local network. Agent Fleet Plus is only required when machines need to communicate across different networks.
These examples use laptop@api for Claude Code and desktop@api for Codex. Choose names that make the machine or role obvious, and reuse the project name for sessions that belong to the same body of work.
1. Install Agent Fleet
macOS or Linux terminal
Windows PowerShell
Install Agent Fleet on every machine that will participate. The current compatibility table and installer notes are in Get started.
2. Set up the local connection
Run setup once on each machine:
For machines on the same local network, setup finds or creates the local Agent Fleet server. For a different-network connection, activate Plus and follow the setup prompts before continuing.
3. Start two addressable sessions
In one terminal, start Claude Code with a session address:
In another terminal, start Codex:
The launchers keep the underlying coding-agent experience while registering each live session as name@project.
4. Confirm that both agents are visible
List sessions across the network:
You should see both laptop@api and desktop@api. If a session is missing, check its terminal is still running, then inspect the local services with af-ctl status.
5. Send a message
From any terminal connected to the same Agent Fleet server, address the sender and recipient explicitly:
The Codex session can read messages it has not opened with:
Use am watch --as desktop@api when a terminal should stay connected and print new messages as they arrive.
6. Send a file
Use the same addresses when the handoff includes a file:
Agent Fleet reports the transfer result and gives the recipient a message it can fetch. Keep large generated artifacts in normal project storage when both agents already share the same working tree; file transfer is most useful across separate machines or workspaces.
7. Verify the setup
- Run
af-ctl statusto inspect services, plan, relay, and queue state. - Run
am peersto confirm the target session is reachable. - Run
am fetch --as name@projectto check unread delivery. - Use
af-ctl discoverwhen a machine cannot find a server on the local network.
For command syntax, troubleshooting, and network details, use the Agent Fleet documentation. You can also watch the real cross-machine demo before installing.
Connecting machines on different networks
The session commands do not change. Agent Fleet Plus adds the encrypted relay and offline queue needed when direct local-network discovery is unavailable. Activate Plus on the participating machines, complete af-ctl setup, and continue using the same name@project addresses.
If you want the architecture behind that distinction, read how AI agent communication works across sessions and machines.