What the next agent needs to know

When one agent gets stuck and another takes over, the handoff decides whether the second attempt is better or just different. Anatomy of a continuation brief.

Agents get stuck. They run out of attempts on a hard bug, they hit a usage limit halfway through a refactor, they circle around a test they don’t understand. Often a different agent gets further — different training, different habits, a fresh look.

But a fresh look is only useful if it doesn’t start from zero. The second agent needs to know what happened. In PaneScale that information travels as a continuation brief.

What goes in

The original task

Not a summary of it — the task itself, with its finish line. Summaries drift; each retelling loses a constraint.

A plain statement of the situation

“Another agent already worked on this task in this directory and got stuck. Its changes are still here.” This one sentence changes the second agent’s behavior completely. Without it, agents tend to treat existing changes as the starting codebase and build on top of mistakes. With it, they inspect first.

An instruction to keep what is good

The previous agent rarely got everything wrong. Asking the next one to review the existing changes, keep what is good and fix what isn’t is cheaper than starting over — and usually produces a smaller diff.

The last failing check

The exact output of the check that failed last. This is the most valuable part: it tells the next agent where reality disagreed with the previous attempt.

The state of the repository

Which branch, which commit, what is uncommitted, what was committed since the task started. An agent that knows the state of the repository checks it before it continues; an agent that doesn’t may re-apply work that is already there, or revert work it didn’t recognize.

What stays out

  • The previous agent’s long reasoning. It is long, and it is the reasoning that got stuck. The diff, a short summary and the failing check carry the useful part.
  • Opinions about the previous agent. “The last agent made a mess” primes the next one to throw everything away.
  • The full terminal scrollback. Thousands of lines of build output push the task out of the next agent’s attention. The end of the output, where the failure is, is enough.

A brief, assembled

Here is the shape of a brief for an autopilot task that the lead agent couldn’t finish:

Continuation brief
Task (unchanged):
  Uploads survive a single 503 from the storage API.
  Done when: npm test -- upload passes, including a new test
  "retries once on 503, then succeeds"; npm run typecheck passes.

Situation:
  Another agent already worked on this task in this directory and
  got stuck after 2 attempts. Its changes are still here.

What to do:
  Review the existing changes first. Keep what is correct, fix what
  is not. Do not start over unless the existing approach cannot work.

Last failing check (npm run typecheck):
  src/upload/client.ts:48:21 - error TS2322: Type 'string' is not
  assignable to type 'number'.

Nothing in it is clever. Every line answers a question the next agent would otherwise spend tokens and minutes rediscovering.

Limit handoffs are a special case

A handoff because of a usage limit is different from a handoff because an agent got stuck. The first agent was not wrong — it just ran out. So the brief carries more of its work forward: in PaneScale it is built from the previous CLI’s session file and the current Git state, and includes what you asked for, messages you had queued, the previous agent’s summary, its plan and task list, the files it changed, the last commands it ran, and where it stopped.

Two details make limit handoffs reliable:

  • Waiting can be better than switching. If the limit resets in a few minutes, the same session with its full context is the better choice. PaneScale’s default waits when the reset is close — 20 minutes unless you change it — and hands off otherwise.
  • The original must not come back. Claude Code resumes by itself once its limit is free again. After a handoff that would mean two agents in the same files, so PaneScale stops the original session from resuming unless you turn that off.

Where handoffs happen in PaneScale

  • The Overnight Autopilot runs one lead agent with retries and hands each task to a backup agent for the second half of its attempts.
  • From any pane, choose Hand off to another agent… and PaneScale writes a brief from the pane’s session for the agent you pick — see Handoff.
  • At a usage limit, the limit handoff continues the work on another account or agent.
  • Between teammates in Agent mode, a teammate can pass a subtask to another one — see Agent mode.

The autopilot and pane handoffs keep the work in the same place. The next agent opens the same files the last one touched — no copying, no pasting, no lost changes.

Choosing the backup

The best backup is the agent most different from the lead. If your lead is good at broad changes, pick a backup known for small, careful steps — or the other way round. A handoff between two agents with the same strengths tends to get stuck in the same place.

Is the handoff helping?

Handoffs cost something: a second agent reading the same files, a second set of attempts. Whether that pays off shows in the morning reports. Look at the tasks that went to the backup and ask two questions:

  • How many became ready on the backup’s attempts? If it is close to none, the backup isn’t adding anything — or the tasks need rewriting, not a second agent.
  • Did the backup keep the lead’s work, or start over? Large diffs after a handoff usually mean the brief didn’t make the situation clear, or the existing work really was unusable.

A few nights of this tells you whether to keep the backup, swap it for a different agent, or put the effort into better tasks instead.

Questions about handoffs

Is a handoff better than more attempts with the same agent?

Often, but not always. More attempts with the same agent help when the failure was close — a typo, a missed edge case. A different agent helps when the first one keeps failing in the same way, because it brings different habits. The loop guard in the autopilot ends a task when the same failure repeats on the same state, which is the moment a handoff or a better task is worth more than another attempt.

Does the next agent see the previous conversation?

It sees what is useful from it: the task, the situation, the previous agent’s summary and plan where they exist, the files that changed and the last failure. It does not get the full transcript, because a long transcript of an agent going in circles teaches the next one to go in the same circles.

Can I edit the brief before it is sent?

The brief is saved as a file, so you can read exactly what the next agent receives. For a handoff you start by hand, add your own note to the new agent’s first message — one sentence from you is often worth more than a page of automatic context.

Writing a brief by hand

The same structure works when you hand work from one agent to another yourself, without any tool: paste the original task unchanged, add one sentence that another agent already worked on it and its changes are still in the folder, ask for a review before any new changes, and paste the last error. Four short blocks, and the next agent starts where the last one stopped instead of at the beginning.

Sources

More articles

Five ways an agent can fake a green build

Agents rarely cheat on purpose, but under pressure to make tests pass they find shortcuts. Here is what to look for — and what PaneScale flags automatically.

Write tasks an agent can finish

The difference between a task that runs overnight and one that wanders is usually a single sentence — the finish line. A short template and examples.

Bypass mode: a decision table

Skipping an agent’s permission prompts saves hours — and occasionally costs a lot more. When it is reasonable, and what to put in place first.