{"version":"2.1.292","anchor":"sdk-messages-carry-agent-id-for-subagent-output","canonical_anchor":"sdk-messages-carry-agent-id-for-subagent-output","heading":"SDK messages can now say which subagent wrote them","tier":"use","area":"SDK","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.292\/e\/sdk-messages-carry-agent-id-for-subagent-output","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.292","markdown":"### SDK messages can now say which subagent wrote them\n\nSDK messages gain an optional `agent_id` naming the exact subagent that produced them; it is absent on main-thread messages\n\n**Unclear.** Whether Claude Code always fills in `agent_id` on subagent messages is not confirmed.\n\n**What**\n\nMessages that Claude Code sends through the SDK (the kit developers use to build on Claude Code) can now carry an optional `agent_id` field. It identifies the subagent (a helper agent Claude starts for part of a task) that produced the message. Its value is the `task_id` used in that subagent's task events, and it stays the same when the subagent is resumed. Messages from the main conversation do not have it. Before, only the subagent's type was given.\n\n**Why**\n\nPrograms built on Claude Code can now tell which particular subagent wrote a message, not just what kind of subagent it was.\n\n- Area: SDK\n- Names: `agent_id`\n- Tier: Use it now\n- Useful: 4\/5\n- Signal: 1\/5\n- Scope: individual\n- Heads-up: no"}