Scope
Lineage only: who a subagent's parent is, what the root session is, and the parent-of-subagent chain. Operator/user identity is out of scope for agent-bundle by maintainer decision (2026-09-03, see #391); this issue tracks no identity fields.
What the host exposes (2026-09-03, live capture)
Evidence: docs/audits/2026-09-03-host-lineage-matrix.md §1–§5 and fixtures/host-lineage/claude-2.1.257.ndjson (PR #421). Real Claude Code 2.1.257, claude -p, one Agent subagent that spawned a nested Agent (depth 2).
| Fact |
Observed |
| Root id on every hook payload |
session_id (also on nested subagents' events) |
| Subagent id on its own events |
agent_id + agent_type on PreToolUse/PostToolUse/SubagentStart/SubagentStop |
| Parent of a subagent |
absent everywhere. SubagentStart carries only the child's agent_id; the child's own events carry session_id (root) and its agent_id, never the spawning agent. agent_transcript_path is flat (<session>/subagents/agent-<id>.jsonl), so a nested agent's path does not name its parent either. |
| Depth |
not delivered |
background_tasks[] on Stop/SubagentStop |
lists every running subagent (id, type: subagent, agent_type, description) — a flat set, no edges |
MCP tools/call _meta |
claudecode/toolUseId = the PreToolUse tool_use_id (this is what makes hook→MCP correlation exact) |
PostToolUse for MCP tools |
tool_response is a plain string (documented as an object) |
What the framework does about it
request.lineage (#421) is the single surface for parent/root/subagent on every host. On Claude it infers the parent as the agent whose Agent/Task PreToolUse is the newest unclaimed spawn under the same root when SubagentStart fires (resolution: 'registry'); depth follows the parent chain. It is exact for sequential spawns; when two different parents have unclaimed spawns it refuses (id-not-resolvable) rather than guessing, and when several siblings from one parent are pending it places the child under that parent but withholds subagent.toolCallId (the cohort is uncertain). MCP calls correlate exactly through _meta["claudecode/toolUseId"]. The capability-table lineage reasons cite this issue and the observations record since #444 (merged as 284141958).
Host-side gap (recorded for reference; not submitted to the host — maintainer decision 2026-09-03)
parent/depth stay degraded (inferred) until a Claude Code build carries a parent_agent_id (or the spawning tool_use_id) on SubagentStart/SubagentStop and on the subagent's own hook payloads. No feedback is sent to Anthropic; the per-host write-up was removed in #467 (merged as 9d4fbd867) per maintainer decision, and docs/audits/2026-09-03-host-lineage-matrix.md plus the capability tables are the record a newer build is re-checked against.
Scope
Lineage only: who a subagent's parent is, what the root session is, and the parent-of-subagent chain. Operator/user identity is out of scope for agent-bundle by maintainer decision (2026-09-03, see #391); this issue tracks no identity fields.
What the host exposes (2026-09-03, live capture)
Evidence:
docs/audits/2026-09-03-host-lineage-matrix.md§1–§5 andfixtures/host-lineage/claude-2.1.257.ndjson(PR #421). Real Claude Code 2.1.257,claude -p, oneAgentsubagent that spawned a nestedAgent(depth 2).session_id(also on nested subagents' events)agent_id+agent_typeonPreToolUse/PostToolUse/SubagentStart/SubagentStopSubagentStartcarries only the child'sagent_id; the child's own events carrysession_id(root) and itsagent_id, never the spawning agent.agent_transcript_pathis flat (<session>/subagents/agent-<id>.jsonl), so a nested agent's path does not name its parent either.background_tasks[]onStop/SubagentStopid,type: subagent,agent_type,description) — a flat set, no edgestools/call_metaclaudecode/toolUseId= thePreToolUsetool_use_id(this is what makes hook→MCP correlation exact)PostToolUsefor MCP toolstool_responseis a plain string (documented as an object)What the framework does about it
request.lineage(#421) is the single surface for parent/root/subagent on every host. On Claude it infers the parent as the agent whoseAgent/TaskPreToolUseis the newest unclaimed spawn under the same root whenSubagentStartfires (resolution: 'registry');depthfollows the parent chain. It is exact for sequential spawns; when two different parents have unclaimed spawns it refuses (id-not-resolvable) rather than guessing, and when several siblings from one parent are pending it places the child under that parent but withholdssubagent.toolCallId(the cohort is uncertain). MCP calls correlate exactly through_meta["claudecode/toolUseId"]. The capability-tablelineagereasons cite this issue and the observations record since #444 (merged as284141958).Host-side gap (recorded for reference; not submitted to the host — maintainer decision 2026-09-03)
parent/depthstaydegraded(inferred) until a Claude Code build carries aparent_agent_id(or the spawningtool_use_id) onSubagentStart/SubagentStopand on the subagent's own hook payloads. No feedback is sent to Anthropic; the per-host write-up was removed in #467 (merged as9d4fbd867) per maintainer decision, anddocs/audits/2026-09-03-host-lineage-matrix.mdplus the capability tables are the record a newer build is re-checked against.