Up to 59% offLaunch prices on every plan while spots last.See pricing
KANBANMCP
Sign inStart free

Agent to Agent Communication: Patterns and Failure Modes

10 min read

Key takeaways

  • Agent to agent communication relies on three patterns: direct messaging, shared state, and protocol-mediated handoffs.
  • Direct messaging scales badly and loses context if a session dies mid-handoff, making it unsuitable for multi-agent setups.
  • Shared state like a board or task file acts as a system of record, keeping chat sessions disposable and allowing agents to recover project context weeks later.
  • Race conditions are the first failure mode for shared files; you need a tool with atomic card claiming to prevent two agents from grabbing the same task.
  • A durable handoff note must contain what was done, what failed, the exact next action, and any constraints for the next agent.

Agent to agent communication today comes down to three patterns: direct messaging between agents, shared state like a board or task file, and protocol-based handoffs. Each breaks differently: chat handoffs bleed context, shared files hit race conditions, and protocols lock you in. This guide maps each pattern to its failure mode so you can pick the right one for your 2-5 agent setup.

What is agent-to-agent communication and why does it matter?

Agent to agent communication is how two AI agents pass work and context between each other: one agent claims a task, does it, and leaves enough state behind that a different agent, in a different session, can pick it up without re-reading the whole chat history. It matters because if you run 2-5 coding agents, your "hundreds of different cli and app chats and sessions" hold the real state of your projects, and recovering context a week later is painful.

The dominant shared interface today is MCP, Anthropic's open protocol for tools and resources (MCP documentation), which is why tools like KanbanMCP expose a board to agents over it. Agents write to shared state; you steer from the same board.

What are the main agent-to-agent communication protocols available today?

Three families cover almost everything solo devs run: tool-layer protocols, purpose-built agent protocols, and plain files.

MCP as the de facto tool layer

Model Context Protocol lets any agent call the same tools: read a task, claim a card, write a note. The protocol does not make agents talk to each other directly; it points them all at shared state, which sidesteps race conditions if your tool enforces claiming. KanbanMCP (https://kanbanmcp.com/) works this way: agents pick up cards and leave handoff notes for the next one, and you steer from the same board.

Emerging agent-to-agent protocols

A2A-style protocols aim at direct agent-to-agent messaging: agents announce capabilities and negotiate tasks. They suit fleets of distinct services, which is more structure than a solo dev with 2-5 coding agents usually needs.

File and CLI conventions agents already use

Markdown task files, CLI tools like Task Warrior, and git-adjacent files are the pattern most people actually run. They work because agents read and write them natively, but nothing stops two agents editing the same file.

FamilyHow agents coordinateFirst thing that breaks
Tool layer (MCP)Shared state via toolsUnclaimed or double-claimed work
Agent protocolsDirect messagingAdoption; overkill for small setups
Files and CLIRead/write shared filesRace conditions, stale context

Direct messaging vs shared state: which agent-to-agent communication pattern fits your workflow?

Pattern 1: direct messaging between agents

Agent A finishes and pings agent B directly with a summary. This works for a single handoff between two agents you control, but it scales badly: with five agents across three projects, you end up with a mesh of point-to-point messages and no single place to see what anyone is doing. If a session dies mid-handoff, the message dies with it.

Pattern 2: shared state (files, boards, memory)

Instead of messaging, agents read and write one shared artifact: a markdown backlog, a board, a task file. This is the "system of record" approach — chat sessions stay disposable, and any agent can recover the context of the project a week later by reading the board. The trade-off is coordination: two agents grabbing the same card is a race condition unless the system supports claiming. This is where a board built for agents earns its keep — on KanbanMCP, an agent claims a card, does the work, and leaves a note for the next one, so the handoff lives in the state, not in a chat that nobody will reopen. The failure mode is density: notes and docs pile up until the board becomes too dense for management. Keep the system of record for tasks and keep long-form material elsewhere.

Pattern 3: protocol-mediated handoffs

Protocols standardize the exchange itself. Google's A2A protocol, for example, defines how independent agents discover each other's capabilities and exchange structured task updates over HTTP (A2A protocol docs). That matters when agents are built on different stacks and need a contract, not a shared file. For a solo dev running agents from one vendor, it's more machinery than the job needs; the protocol pays off when you want agents to talk across tools you didn't build.

What breaks first: common failure modes in multi-agent communication?

Each pattern fails in a predictable way. Match the failure to the pattern before you build on it.

Lost context in chat handoffs

Direct messaging dies on recovery. If a project only exists across chat sessions, you cannot recover the context of the project weeks later. The fix is separating the system of record from working memory: tasks live in one durable place, chat sessions stay disposable. A board like KanbanMCP does this by making the card the handoff, with the agent leaving a note for the next one.

Race conditions on shared files

Shared state breaks when two agents write the same file at once. Two agents both read a task as "todo", both claim it, and you get repeating logic that used to work. You need a claim step: one agent takes the card, the state flips to in-progress, the second agent sees it taken. Without atomic claims, file-based boards like backlog.md need you to run agents one at a time.

Lock-in when the protocol owns your data

Protocol-based approaches trade convenience for control. If your task state only exists inside one vendor's server, migration means re-entering everything. Plain files avoid this but reintroduce race conditions.

Where KanbanMCP falls short: the board is hosted, so your task history lives with us, not in your repo. If you want everything in git, a file-based board wins on that axis.

How do AI agents exchange context without losing state?

The pattern that survives weeks of agent churn is a split: one place holds the truth about what needs doing, another holds what an agent needs right now. Chat sessions stay disposable. If a project only exists across AI chats, you can't recover the context of the project a week later, which is why a durable system of record beats scrolling session logs.

System of record vs working memory

Keep tasks and their status in one durable store, and keep the notes agents need mid-task in a second, lighter layer. A CLI like Task Warrior works well as the record, but hundreds of different cli and app chats and sessions still leave gaps between what's stored and what an agent knows. Working memory is the bridge: short, per-card context an agent writes and the next agent reads. The card is the unit, not the chat.

What a good handoff note contains

A handoff note should carry four things: what was done, what was tried and failed, the exact next action, and any decision that constrains the next agent. One agent claims a card, does the work, and leaves that note for the next one; on KanbanMCP the note lives on the card, so you watch and steer from the same board. The honest limit: notes rot if agents write vague summaries, so make "exact next action" a hard requirement, not a suggestion.

How do you evaluate an agent-to-agent communication protocol before adopting it?

Run any candidate through four checks before you commit.

Data ownership. Where do tasks and notes live? If the protocol stores state on someone else's server and offers no export, you are one dead company away from losing your system of record. Flat files you own beat a hosted board you rent.

Agent coverage. Does every agent in your stack speak it? A protocol only two of your five agents can use means the other three fall back to copy-paste, and context bleeds through that gap.

Recovery after weeks away. Park the project for three weeks, come back, and ask: can you recover the context of the project from the board alone, without scrolling old chats? If the answer depends on session history, it fails. Chat sessions stay disposable; the board is the memory.

Race safety. Two agents claiming the same card at once is the first bug you will hit. Check whether claims are atomic. If the tool has no locking, you will spend your evenings untangling duplicate work.

Honest note on our own KanbanMCP against this list: files and board state are exportable, all MCP-speaking agents are covered, and card claims are atomic. Where it falls short is recovery depth — notes capture what an agent did, not why, so a month-long gap still costs you a read-through.

How does this look in practice: a worked solo-dev setup?

Say you run three agents across one side project. Put the board in a repo, connect each agent over MCP, and let them claim cards. Agent A picks up "add auth", does the work, and leaves a note: what changed, what's untested, what the next agent needs. Agent B claims the next card, reads that note, and continues without reading a single chat log. Your chat sessions stay disposable; the board is the system of record, the card notes are working memory. This is the claim/work/note pattern applied to shared state, and it maps to what you may already like about backlog.md, a markdown-based task board your agents can edit directly.

Running the same criteria against KanbanMCP honestly

By the same criteria from earlier sections: context handoff is the strong point, since notes live on the card where the next agent claims it. Race conditions are handled with card claiming, one agent per card. Where it falls short: it is a hosted board, so unlike a markdown file in your repo, the state is not versioned with your code, and if the product disappears you are exporting JSON, not reading plain text. If that trade bothers you, a file-based board in the repo is the safer pattern; if you want to steer agents from a live view, the hosted one wins.

How does agent-to-agent communication differ from human-to-agent interaction?

When you prompt an agent, it can ask a clarifying question, infer intent from half a sentence, and recover from a bad guess on the next turn. An agent handing work to another agent gets none of that. There is no follow-up turn, so the note left on a card has to carry the full working state: what was done, what broke, what the next agent should not touch.

That is why handoffs need structured state rather than chat. Freeform summaries drift, and the next agent fills gaps by guessing, which is how repeating logic that used to work happens. A card with claimed-by, status, and a handoff note turns ambiguity into something both agents read the same way.

FAQ

What is agent-to-agent communication?

It is how two AI agents pass work and context between each other. One agent claims a task, does it, and leaves enough state behind that a different agent in a different session can continue without re-reading chat history. The three patterns are direct messaging, shared state, and protocol-mediated handoffs.

Do AI agents need a protocol to talk to each other?

Not for small setups. Plain markdown task files and CLI tools work because agents read and write them natively. Protocols like MCP point agents at shared tools and state. A2A-style protocols handle direct messaging between independent services, which is usually more machinery than a solo dev running 2-5 agents needs.

How do I get two coding agents to hand off work to each other?

Use the claim, work, and note pattern on shared state. Agent A claims a card, does the work, and leaves a note with what changed, what failed, and the exact next action. Agent B claims the next card and reads that note instead of a chat log. This keeps chat sessions disposable and makes the card the handoff.

What is the best agent to agent communication protocol for a solo developer?

For most solo setups, MCP over shared state is the practical choice. Every MCP-speaking agent can read the same board or task file, and claiming prevents two agents grabbing the same card. File-based boards win on data ownership since state lives in your repo. A2A-style protocols pay off only when agents talk across different stacks.

How do agents share context without losing state?

Split the system of record from working memory. Tasks and status live in one durable store; short, per-card notes hold what an agent needs right now. A handoff note should carry four things: what was done, what was tried and failed, the exact next action, and any decision that constrains the next agent.