[BUG] VS Code agent map: nested subagents show "Tool calls (0)" and are attached to the main agent instead of their real parent

Status Open
Reported on v2.1.284
Maintainer reply None cached
Activity 1 comment · opened Sep 29, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

In the VS Code agent map, subagents spawned by other subagents are displayed incorrectly, although the data on disk is correct:

  1. Empty tool call list. The detail card of a nested subagent shows "Tool calls (0)", while "Open transcript" for the same agent shows its tool calls. The level-2 agent's card shows "Tool calls (0)", but its transcript contains two Agent calls (the first refused by the spawn guard, the retry succeeded) and one SendMessage. The level-4 agent's card shows "Tool calls (0)", its transcript shows one SendMessage.
  1. Wrong parent. The level-3 and level-4 agents are drawn directly under the main agent, and their cards say "Spawned by the main agent". The main transcript contains only one Agent call (the level-1 agent). Each subagent's meta.json has the correct parentAgentId and spawnDepth, and the Agent calls that spawned level 3 and level 4 are in the level-2 and level-3 transcripts, so the map is not using the recorded parent.

The first-level subagent (spawned by main, background) is correct: its card lists its tool calls, and the level-2 agent is drawn under it with "Spawned by Level 1". Background spawns from depth 2 are refused by the spawn guard, so every agent at depth 2+ runs in the foreground; I can't tell whether the trigger is depth or foreground mode.

What Should Happen?

Every subagent's card should list the same tool calls its transcript shows, and every subagent should be drawn under the agent that actually spawned it, with "Spawned by" naming that agent.

Error Messages/Logs

Steps to Reproduce

  1. Open a new session in the VS Code extension panel with Haiku 4.5.
  2. Send:

Tree test. Spawn a background subagent haiku_level_1. It spawns a foreground subagent haiku_level_2, which spawns a foreground haiku_level_3, which spawns a foreground haiku_level_4. haiku_level_4 sends "L4: done" to haiku_level_3 with SendMessage; each level forwards the receipt to its parent.

  1. When all agents finish, open the agent map.
  2. haiku_level_3 and haiku_level_4 are drawn under the main agent with "Spawned by the main agent".
  3. Click haiku_level_2: the card shows "Tool calls (0)". Click "Open transcript": the transcript shows Agent and SendMessage calls.

Claude Model

Other

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.284 (Claude Code)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Other

Additional Information

Environment: Claude Code VS Code extension, chat panel (not the integrated terminal). Model: Haiku 4.5 for main and all subagents.

Parent chain as recorded in each subagent's meta.json vs. what the agent map shows:

| Agent | parentAgentId (meta.json) | spawnDepth | Agent map shows |
|-------|---------------------------|------------|-----------------|
| L1 | none (main) | 1 | main (correct) |
| L2 | L1 | 2 | L1 (correct) |
| L3 | L2 | 3 | main (wrong) |
| L4 | L3 | 4 | main (wrong) |

The level-2 transcript on disk contains the Agent call that spawned level 3; its tool_use id matches the toolUseId in level 3's meta.json. Steps to Reproduce produce the same result each time.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗