Learn/Multi-agent · 6 min · updated 2026-08-03

Handing context from one agent to the next

A context window fills up and the session ends. What to carry into the next one, what to leave behind, and how a handover payload differs from a chat transcript.

A handoff is what you write down so the next agent session does not start from nothing. Every long piece of work outlives a context window, and the difference between a session that picks up smoothly and one that re-derives everything for twenty minutes is whether the previous session left a usable record.

What a transcript is bad at

The obvious approach, pasting the previous conversation, is the worst one. A transcript is mostly tool calls, retries and dead ends, so it is long, and its signal is spread thin. Feeding it back costs a large share of the new context window and buys a summary the model has to reconstruct anyway.

What a handoff should contain

CarryLeave
The goal, in the words it was givenThe prompt history
What is done, with commit hashesThe reasoning that produced it
What is in flight, and whereTool output
Decisions taken, and whyOptions considered and dropped
Known traps: flaky tests, stale filesGeneral project background

The test for a line is whether the next session would act differently without it. "The integration test fails on a cold cache; run it twice" passes. "We considered using a queue" does not.

Doing it at the right time

Handing off after the context window is full produces a bad handoff, because the model summarising is the one that has already lost the detail. The moment to write it is at the end of a unit of work, while the session still has room. In practice that means treating handover as part of finishing a task rather than as an emergency measure.

How Aura does it

The aura_handover tool produces a dense payload from the semantic state rather than from the conversation: the active goal, the commits, the symbols touched, the open impacts and the decisions logged as intent. Because it is built from the repository, it does not inherit the conversation's noise, and it stays accurate if the next session runs on a different model.

The same structure is what makes a session resumable somewhere else: on another machine, or by a different agent entirely. See the agent inbox for the live channel, and the audit record for the durable one.

Questions

How do you hand off context between AI coding sessions?

Write down the decisions, not the conversation. The next session needs the current goal, what has already been settled, what is deliberately unfinished, and where the work lives. A transcript is the wrong shape — it is long, and most of it is superseded.

What happens when an agent runs out of context?

It starts losing the earliest part of the session, which is usually where the constraints were set. The visible symptom is an agent that begins redoing settled decisions or contradicting something it agreed to an hour ago.

What should be in a handover between agent sessions?

The goal, the decisions already locked, the current state of the working tree, the open questions, and the immediate next step. Everything that is recoverable from the repository should be left in the repository rather than copied into the payload.

How is a handover different from a chat summary?

A chat summary compresses what was said. A handover states what is now true. The first keeps narration and drops constraints; the second keeps the constraints and drops the narration, which is what the next session actually needs to act.