Skip to content

Claude Code 2.1.257 lineage gaps: SubagentStart names no parent; a subagent's hooks name no parent #422

Description

@ScriptedAlchemy

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    host-integrationAgent host capabilities, projection, discovery, and lifecycle

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions