Concept · D1 Agentic Architectures · 27% of CCA-F

How to Hand Off State Between Subagents: Shared Files, Structured Messages, or Tool Results

I hit a state-drop bug on a Claude multi-agent pipeline last quarter that turned out to be the wrong handoff primitive, not a model failure. Here is when to use shared files, when to use structured messages, when to use tool results, and when to do none of the above.

Loading your plan…
Mental modelStructured messages are the default; use tool results for tight synchronous chains and shared files only for payload constraints.

Last updated

Loop mascot planning a structured subagent state handoff.
Share
01 · Summary

TLDR

Default to structured messages. Promote to tool results when the chain is synchronous and the receiver is itself a tool. Fall back to shared files only when payload size or binary format makes serialization impractical. Never pass raw conversational text - that is always the wrong answer on D1 scenario questions.

02 · The three primitives

Shared files vs structured messages vs tool results

Every subagent handoff in a Claude multi-agent pipeline reduces to one of three primitives. Choose by latency profile, payload shape, and audit requirements.

  • Shared files suit large, persistent payloads - for example, artifacts a downstream agent reads at its own pace. They introduce coupling on storage location and require explicit locking or versioning to avoid race conditions between concurrent subagents. Use only when payload size or binary format forces it.
  • Structured messages (JSON or typed envelopes passed through an orchestrator or message bus) are the preferred CCA-F default. They keep handoff intent explicit, are inspectable mid-flight, and align with Claude's tool-call / tool-result turn structure. Treat this as the path-of-least-surprise.
  • Tool results are the tightest handoff primitive - the calling agent receives a typed result synchronously, making them ideal when the receiving subagent is itself exposed as a tool and the orchestrator needs deterministic chaining.
03 · Decision rule

The decision rule the exam rewards

The CCA-F exam tests this decision explicitly: tool results for tight synchronous chains, structured messages for loose orchestration with audit requirements, and shared files only when payload size or binary format makes serialization impractical.

SituationRight primitiveWhy
Subagent exposed as a tool; orchestrator chains synchronouslyTool resultDeterministic, typed return; lowest-latency path; easiest to replay in tests.
Asynchronous flow; orchestrator routes between many subagentsStructured messageInspectable mid-flight; survives orchestrator restarts; clean audit trail.
Payload too large or binary for envelopesShared file + structured pointerStorage-mediated; pass the pointer through a structured message, never the file itself.
Need to forward conversation contextExtract structured facts firstRaw transcripts leak prompt structure and balloon downstream context. Always wrong on the exam.
04 · HowTo

How to choose a handoff pattern: a five-step blueprint

  1. Default to structured messages. Pass typed JSON envelopes through your orchestrator. Each handoff is explicit, inspectable mid-flight, and aligns with Claude's tool-call / tool-result turn structure. Treat this as the safe default for CCA-F.
  2. Promote to tool results for tight synchronous chains. When the receiving subagent is itself exposed as a tool and the orchestrator needs deterministic chaining, return the handoff as a tool_result block on the calling turn. This is the tightest primitive and the easiest to test.
  3. Fall back to shared files only for size or format constraints. If the payload is too large or binary (model checkpoints, large CSVs, images), write to shared storage and pass a pointer through a structured message. Require explicit versioning or locking to avoid race conditions between concurrent subagents.
  4. Never pass raw conversational text as state. Conversational text leaks prompt structure, balloons context, and is explicitly penalized in D1 scenario questions. If you find yourself forwarding a transcript, you have a missing schema - define it before shipping.
  5. Instrument the handoff. Log every handoff with the producing subagent, receiving subagent, envelope size, and timestamp. The 12% skip-rate problem and silent state-drop bugs both surface from this telemetry, not from prompt review.
05 · Anti-pattern

The anti-pattern to flag

Never pass raw conversational text as state

Passing raw conversational text between subagents as "state" leaks prompt structure into downstream contexts, balloons the receiving subagent's context window, and is explicitly penalized in D1 scenario questions. If you need a downstream agent to act on a conversation, extract the structured facts first and pass those - not the transcript.

06 · FAQ

Frequently asked

Showing 7 of 7 questions

Help someone pass

Share this concept.

One share is one less person stuck on the same question.

Last reviewed ·