# Subagent And Session Lineage
Maintenance mode: curated Mermaid flow; provider inventory is visible in the generated capability seam graph.
This graph keeps delegation semantics separate from hook observation. A subagent backend creates an ordinary child agent/session through the shared provider registry.
```mermaid
flowchart TD
parent["Parent Agent + Session"]
tool["tool-subagent
model-facing name"]
registry["ctx.subagents provider registry"]
spawn["spawn provider
fresh child session"]
fork["fork provider
seeded from completed-turn prefix"]
acp["ACP provider
out-of-process child"]
child["Child AgentHandle
ordinary Agent lifecycle"]
result["SubagentResult returned to tool"]
parent --> tool --> registry
registry --> spawn --> child
registry --> fork --> child
registry --> acp --> child
child --> result --> parent
```
The hooks stack adds richer lifecycle observation around child runs; the core ownership rule stays the same: the provider owns the child handle and must dispose it.