112. Loop Engineering 6 - Multi-Agent Loops and Handoffs
Design loops where more than one agent works: roles, handoff contracts, and the failure modes that only appear at two agents.
By Jacques Botte, founder of Toptronic®. Last updated 17 October 2026.
The lesson
A second agent is not automatically more capability; it is a second context, a second set of permissions and a second bill. The honest reasons to add one are narrow. The work has genuinely different phases with different tools, such as research then build then review. One context would be too large for one window. Or you want a verifier that cannot see the reasoning that produced the thing it is judging, because that independence is the whole value.
The handoff is a contract, and it must be written as one: what is passed, in what shape, who may edit it, and what the receiver is allowed to assume. A handoff that passes a paragraph of prose is a handoff that loses the constraints; a handoff that passes a structured record - task, acceptance check, files touched, open questions, budget remaining - is one the receiver can act on without re-deriving the world.
Roles earn their keep when they carry DIFFERENT checks, not different titles. A builder whose check is the test suite and a reviewer whose check is a rubric over the diff are two agents doing something a single agent could not: the reviewer is not allowed to fix, so it has no incentive to declare the work done. Two agents both allowed to edit and both scored by the same judge are one agent with extra steps and double the cost.
The failure modes that appear at two agents are worth naming now. The infinite politeness loop, where each politely asks the other to proceed. The scope creep handoff, where each adds a requirement the brief never contained. The shared-file collision, where both edit the same file and one silently overwrites the other. And the audit hole, where neither agent's log contains the decision that mattered because it happened in the gap between them.
The controls are unglamorous and they work: a single owner for each file at each moment, a stated maximum number of handoffs, a shared state file that both read and only one writes per turn, and a total budget across all agents rather than a budget each. If the loop cannot finish inside that shared budget, the answer is a smaller task, not a third agent.
Check yourself
Question 1: Which is a genuine reason to add a second agent?
- Two agents are always faster
- You need a verifier that cannot see the reasoning behind the work it judges — correct
- The first agent is expensive
- To double the budget
Answer: You need a verifier that cannot see the reasoning behind the work it judges
Independence is a real property a single context cannot give you. Roles with different titles but the same check are one agent with extra cost.
Question 2: What shape should a handoff take?
- A paragraph of prose describing what happened
- A structured record: task, acceptance check, files touched, open questions, budget remaining — correct
- A screenshot
- Nothing - the second agent can read the transcript
Answer: A structured record: task, acceptance check, files touched, open questions, budget remaining
Prose loses constraints. A structured record lets the receiver act without re-deriving the world.
Question 3: Which failure mode is specific to two agents?
- A failing test
- The shared-file collision, where both edit the same file and one silently overwrites the other — correct
- A timeout
- A missing API key
Answer: The shared-file collision, where both edit the same file and one silently overwrites the other
At two agents you also get the infinite politeness loop, scope-creep handoffs and audit holes in the gap between the logs.
← Previous lesson · All 134 lessons · Next lesson →
The full course — 134 lessons and 402 quiz questions — ships inside the app. Get TPEE to study it offline.
This lesson is the written summary of a course that ships inside the TPEE prompt editor for Windows - thirteen sections, a 0-100 score before you send anything, and it works with no network connection. The three one-time prices, and a 14-day free trial.