What you will be able to do
- Explain why everything a subagent needs must be written into its prompt
- Pass complete prior findings to a later subagent, keeping source attribution intact
- Write coordinator prompts that give goals and quality criteria instead of fixed procedures
- Use fork_session to try a different approach from a shared analysis without changing the original session
1.Subagents start fresh: the prompt is the handoff
Each subagent starts a new conversation. It loads its own system prompt and project-level context such as CLAUDE.md. It does not get the coordinator's message history. So any fact, file path, decision or earlier finding the subagent needs has to be written into the prompt the coordinator passes to it. Isolation works in the other direction too: the subagent's intermediate tool calls and results stay inside it, and only its final message goes back to the coordinator. That is why a subagent can read dozens of files without filling up the coordinator's context.
Separate invocations do not share memory either. Each query() call starts a new session. To continue a subagent's earlier work, you must resume the same session and refer to the subagent by its agent ID. If you skip that, a later call has no access to what the earlier subagent did.
Checkpoint 1 of 4· Put it in order
Put the steps for resuming a subagent's earlier work in the documented order
- 1.Capture session_id from messages during the first query
- 2.Pass resume with that session ID in the second query's options and include the agent ID in the prompt
- 3.Parse agentId from the Agent tool result text
The subagent's transcript is stored in the original session, so you need both the session ID and the agent ID before you can resume it.
“pass resume: sessionId in the second query’s options, and include the agent ID in your prompt.”Source: code.claude.com
2.Passing complete findings, with their attribution
A synthesis subagent cannot see what the search subagents found, so the coordinator has to put those findings into its prompt. A subagent returns only a short summary to its parent. When a later stage needs earlier results, the coordinator should pass the complete findings: the web-search results *and* the document-analysis outputs. A paraphrase of them is not enough. Anthropic's Research system shows the same handoff. When research is finished, the lead agent passes all findings to a CitationAgent. That agent matches claims to specific source locations so that every claim stays attributed.
The exam guide adds a practice for these handoffs: use structured data that keeps each finding's content separate from its metadata, such as source URL, document name and page number. That way the next agent can still say where each claim came from. The sources here back the goal, which is attribution that survives the trip to the citation step. They do not define a schema or format for this. If prior outputs are too large to copy through the coordinator, the engineering post describes another option: subagents save their work to external storage and pass back lightweight references.
Checkpoint 2 of 4· Check yourself
A synthesis subagent's report has accurate claims but cites no sources, even though the search subagents collected URLs. What is the most likely cause?
The synthesis subagent only knows what its prompt contains. If the source URLs and document details are left out of the handoff, the subagent cannot attribute claims to them.
“passes all findings to a CitationAgent, which processes the documents and research report to identify specific locations for citations.”Source: www.anthropic.com
3.Coordinator prompts: goals and quality criteria, not scripts
Open-ended research can't be planned step by step in advance, because each finding changes what to look at next. Anthropic's lead agent therefore does not hand subagents a fixed procedure. Each delegation gives an objective, an output format, guidance on which tools and sources to use, and clear task boundaries. The prompts aim to build good heuristics instead of rigid rules: break the problem down, judge source quality, and adjust the approach as new information arrives.
Too little guidance also fails. Short instructions like "research the semiconductor shortage" made subagents misread the task or repeat each other's searches. What helps is to be specific about the goal and the quality bar, and leave the steps to the subagent. The subagent's own system prompt, the prompt field of its AgentDefinition, sets its role and behaviour. The coordinator's per-task prompt says what this particular run should produce.
Checkpoint 3 of 4· Check yourself
Which coordinator-to-subagent instruction best fits this guidance?
It sets an objective, task boundaries, a source-quality standard, an output format and a point at which to stop, without fixing the steps. The first option is too vague, and the second is a rigid procedure.
“Each subagent needs an objective, an output format, guidance on the tools and sources to use, and clear task boundaries.”Source: www.anthropic.com
4.Forking a session to explore other approaches
Sometimes you want to try two different approaches from the same analysis. Resuming a session adds to its existing history. Forking creates a new session that starts with a copy of that history, so you can try something else while the original stays as it was. Both use resume. A fork also sets fork_session=True (forkSession in TypeScript).
| Goal | Option | Effect on the original |
|---|---|---|
| Pick up the most recent session | continue_conversation=True / continue: true | Continues it |
| Return to a specific session | resume with a captured session ID | Appends to it |
| Try an alternative approach without losing the original | resume plus fork_session=True | Untouched; the fork gets a new session ID |
async for message in query(
prompt="Instead of JWT, outline how OAuth2 would work for the auth module",
options=ClaudeAgentOptions(
resume=session_id,
fork_session=True,
max_turns=5,
),
):After the fork runs, resuming the original session_id carries on with the JWT approach as if the fork never happened. To branch from an earlier point instead of the end of the session, the Python SDK has resume_session_at. Use it with resume, and usually with fork_session, to load the conversation only up to a chosen message UUID.
Checkpoint 4 of 4· Match them up
Match each session option to what it does
Tap a term, then the definition that fits it.
These definitions come from the Python ClaudeAgentOptions reference. Only fork_session leaves the original session unchanged.
“When resuming with resume, fork to a new session ID instead of continuing the original session”Source: code.claude.com
Exam traps
Each one states something that sounds right. Open it to see what is actually true.
1.A subagent inherits the coordinator's conversation, so a short prompt that points back to earlier discussion is enough.Why is that wrong?
Each subagent starts a new conversation and never sees the parent's turns, so every piece of context it needs must be written into its prompt.
2.Exploring an alternative by resuming the same session keeps the original analysis clean.Why is that wrong?
A plain resume adds to the original session. Only a fork creates a new session ID and leaves the original unchanged.
Sources
Every claim above is drawn from one of these pages, quoted as it was written on the date shown.
- 1.https://code.claude.com/docs/en/agent-sdk/agent-loopOfficial docs
“It does not see the parent’s turns, and only its final response returns to the parent as a tool result.”
↩︎ Subagents start fresh: the prompt is the handoff“It does not see the parent’s turns, and only its final response returns to the parent as a tool result.”
↩︎ Exam trap 1 - 2.https://code.claude.com/docs/en/agent-sdk/subagentsOfficial docs
“intermediate tool calls and results stay inside the subagent; only its final message returns to the parent.”
↩︎ Subagents start fresh: the prompt is the handoff“Each query() call starts a new session by default, and you must resume the same session to access the subagent’s transcript.”
↩︎ Subagents start fresh: the prompt is the handoff“The parent receives a concise summary, not every file the subagent read.”
↩︎ Passing complete findings, with their attribution“The agent’s system prompt defining its role and behavior”
↩︎ Coordinator prompts: goals and quality criteria, not scripts“pass resume: sessionId in the second query’s options, and include the agent ID in your prompt.”
↩︎ Checkpoint - 3.
“This ensures all claims are properly attributed to their sources.”
↩︎ Passing complete findings, with their attribution“Subagents call tools to store their work in external systems, then pass lightweight references back to the coordinator.”
↩︎ Passing complete findings, with their attribution“Our prompting strategy focuses on instilling good heuristics rather than rigid rules.”
↩︎ Coordinator prompts: goals and quality criteria, not scripts“You can’t hardcode a fixed path for exploring complex topics, as the process is inherently dynamic and path-dependent.”
↩︎ Coordinator prompts: goals and quality criteria, not scripts“Without detailed task descriptions, agents duplicate work, leave gaps, or fail to find necessary information.”
↩︎ Coordinator prompts: goals and quality criteria, not scripts“passes all findings to a CitationAgent, which processes the documents and research report to identify specific locations for citations.”
↩︎ Checkpoint“Each subagent needs an objective, an output format, guidance on the tools and sources to use, and clear task boundaries.”
↩︎ Checkpoint - 4.https://code.claude.com/docs/en/agent-sdk/sessionsOfficial docs
“Try an alternative approach without losing the original”
↩︎ Forking a session to explore other approaches“Original session is untouched; resuming it continues the JWT thread”
↩︎ Exam trap 2 - 5.https://code.claude.com/docs/en/agent-sdk/pythonOfficial docs
“Use with resume, and usually fork_session, to branch from an earlier point.”
↩︎ Forking a session to explore other approaches“When resuming with resume, fork to a new session ID instead of continuing the original session”
↩︎ Checkpoint