Skip to main content

When a main agent hands a task to a sub-agent, what should go into the hand-off, and what should come back?

Agents and tools · Pro 1

Short answer

The sub-agent starts with an empty context, so the brief must stand alone: the goal and why it matters, what done looks like, constraints, what is already known, and the output format. It should return a short, structured result with evidence and open doubts, not its whole transcript. The main agent then checks the result before it relies on it.

Deeper answer

People use sub-agents for two reasons: to keep the main agent's context clean, and to run work in parallel. Both depend on the hand-off. The sub-agent has not seen the conversation, so a brief such as 'look into the login bug' loses everything the main agent already learned. A good brief reads like a note to a contractor. It gives the purpose, the scope, the facts already found, what not to touch, and the shape of the answer.

The return path matters as much. If the sub-agent sends back 20,000 tokens of raw search results, the benefit to the main context is gone. Ask for a summary with the key findings, references such as file paths, and a clear statement of what was not checked. Limit the sub-agent's tools to what the task needs. The main agent should treat the result as a report from a colleague and verify the important claims. Interviewers listen for context isolation and its cost: more tokens overall, and information lost at each hand-off.

What a strong answer covers

Answer it out loud in the mock interview about 2 min

Follow-ups to expect

Common mistakes

Learn it

Agent SDKs and sub-agents

Practice Agents and tools questions

More on this topic

Today's AI turns are used

Lessons, roadmaps, videos, practice cards and the code playground stay free with your account, with no limit.