How to Make Coding Agents From Different Vendors Work Together
Two coding agents collaborate when they share state, not when they share a chat channel. Give each agent the same repository, a written handoff artifact that survives between sessions, and a common knowledge index it can query. Messaging is the easy part. The hard part is that each agent's understanding dies when its context window ends.
The interop problem is not messaging
The obvious way to make two agents work together is to put them in a room: a shared channel, a message bus, a workspace where both can post. That part is genuinely useful and genuinely easy. Any of the current agent-first chat tools will do it.
It also does not deliver what people expect from it. Watch a real handoff. Agent A spends forty minutes on a refactor: it reads eleven files, discovers that the auth middleware has an undocumented ordering requirement, tries an approach that breaks a test for a non obvious reason, backs out, and lands a working change. Agent B picks up the follow up task and sees the diff, plus whatever A wrote in a summary message.
Everything that made A effective is gone. The ordering requirement, the failed approach and why it failed, the eleven files it had to read to build a mental model. B starts from zero and re-derives most of it, at full token price, and sometimes re-derives it wrong.
That is the interop problem. The channel moved the message. It did not move the understanding.
What actually crosses a handoff boundary
Three things transfer reliably between agents, and they are all files.
The repository state. Both agents see the same code, the same tests, the same build. This is why running agents on the same working tree or on branches of it beats any protocol you could design.
Written artifacts. A plan file, a decision record, an interface contract, a task checklist. If A writes down the ordering requirement it discovered, B reads it. If A only mentions it in a chat message, B may or may not have that message in context when it matters.
Indexed knowledge. Anything either agent has learned or that the team wrote previously, made searchable so an agent can ask for it by meaning rather than by remembering the filename.
What does not transfer is the model's internal state. There is no way to hand Claude Code's working understanding to Codex, and there will not be, because that state is not a serializable object. The practical response is to externalize the parts you need, deliberately, as files.
Design the handoff artifact on purpose
A useful handoff file is short and specific: the goal, what is done, what is deliberately not done, constraints discovered during the work, approaches already ruled out and why, and the exact next step. The approaches ruled out are the highest value line item and the one most often omitted. Without it, the second agent will try the thing that already failed, because it looks like the obvious approach, which is why the first agent tried it too.
Why running two agents costs more than twice as much
Multi agent setups have a cost profile people underestimate. Each agent independently reads the codebase to orient. Each one summarizes the same modules. Each one asks the model to re-derive the same conventions. If you run three agents on one project, you are buying three copies of the same orientation work every session, and none of it is the reasoning you actually wanted.
The fix is a shared knowledge layer that sits below the agents rather than between them. Index the repository, the docs, and the accumulated decisions once. Every agent, whatever vendor it comes from, queries the same index and gets the same answers without regenerating them.
This is what RDK provides. Files from local vaults, docs, and code are indexed as encrypted private chunks, and any agent searches those chunks before querying a model. Token spend drops 80 to 90 percent because the answer is retrieved instead of regenerated, and the saving compounds with each additional agent you add rather than multiplying the cost.
Stacked retrieval across a multi agent team
Private vault retrieval answers 40 to 65 percent of what any agent asks, because most questions about your system were already answered in your own material. The public RDK network adds 15 to 20 percent for general knowledge someone else documented well. The model handles the last 5 to 10 percent. In a two agent setup that means both agents pay full model price only on genuinely new reasoning, and neither pays to rediscover the project.
A working setup
Keep it boring and it will hold.
Give both agents the same repository, on separate branches or worktrees so they cannot corrupt each other's working state. Establish one directory for coordination artifacts: a plan file per task, decision records for anything non obvious, and a status file each agent updates when it stops. Require that an agent write its handoff file before it finishes, in the same way you require a commit message.
Index the repository and your docs so both agents query knowledge instead of re-reading it. Then use the shared channel for what it is good at: notification, arbitration, and letting a human see what is happening without attaching to two terminals.
The division of labor matters more than the tooling. Give each agent a scope with a clear boundary, usually by directory or by layer, and a contract at the seam between them. Agents fail at collaboration for the same reason teams do, which is unclear ownership at the interface, not lack of a chat room.
Frequently asked questions
- Can Claude Code and Codex actually work on the same task?
- Yes, if they share the repository and coordinate through files rather than through model state. Give each a separate branch or worktree, a defined scope, and a written handoff artifact that records constraints and ruled out approaches. What cannot be shared is either agent's internal understanding, so anything important has to be written down deliberately.
- What should a handoff file between two agents contain?
- The goal, what is complete, what is deliberately out of scope, constraints discovered during the work, approaches already tried and why they failed, and the exact next step. The failed approaches matter most and are usually omitted. Without them the second agent repeats the first agent's dead end, since it looks like the obvious path.
- Does running multiple coding agents cost more?
- More than you would expect, because each agent independently re-reads the codebase and re-derives the same conventions before doing any useful work. That orientation cost is paid per agent per session. A shared retrieval index removes the duplication, so additional agents add reasoning cost without adding rediscovery cost.
- Do I need a special protocol for agent to agent communication?
- Rarely. The repository is already a shared medium with locking, history, and conflict detection, and files are readable by every agent regardless of vendor. Use a channel for notification and human visibility. Reserve protocol work for cases where agents must negotiate in real time, which is uncommon in coding workflows.