claude-code - 💡(How to fix) Fix Label Agent tool calls with the dispatched agent's name

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Root Cause

  • Telling which agent is which means reading the parenthesised description on every row, both while watching a session run and when auditing a long one afterwards. A code-quality review and a general-purpose researcher look identical until you do.
  • Correlating transcript rows with --output-format stream-json events requires matching on description text, because the TUI doesn't expose the subagent_type that the JSON emits.

Fix Action

Fix / Workaround

When a session dispatches multiple agents in parallel (review swarms, research fan-out, or skill-orchestrated sub-tasks), every tool-call row in the transcript starts with the same literal Agent(...) prefix. Concrete failure modes:

Code Example

code-quality(Review GDScript diff)
Explore(Find hyprlock submit path)
general-purpose(Check Linear for stale tickets)
RAW_BUFFERClick to expand / collapse

Scenario

When a session dispatches multiple agents in parallel (review swarms, research fan-out, or skill-orchestrated sub-tasks), every tool-call row in the transcript starts with the same literal Agent(...) prefix. Concrete failure modes:

  • Telling which agent is which means reading the parenthesised description on every row, both while watching a session run and when auditing a long one afterwards. A code-quality review and a general-purpose researcher look identical until you do.
  • Correlating transcript rows with --output-format stream-json events requires matching on description text, because the TUI doesn't expose the subagent_type that the JSON emits.

Proposal

In the interactive TUI transcript, render Agent tool calls using the subagent_type argument that is already present on every call:

code-quality(Review GDScript diff)
Explore(Find hyprlock submit path)
general-purpose(Check Linear for stale tickets)

(Built-in agent casing as currently rendered; the field is subagent_type on the Agent tool input.)

Scope: interactive terminal transcript only. No schema change required, since --output-format json / stream-json already carries subagent_type in the tool input.

Related

  • #39147
    • open, asks for subagent_type on the Claude App remote-control view. Same data, different surface.
  • #43553
    • stream-json subagent events.
  • #14859
    • agent hierarchy in hook events.
  • #46253
    • subagent observability gap.
  • #16529
    • closed via autoclose; about user-prompt attribution from inside an agent.
  • #26151
    • closed stale; hook-based rendering override, an alternative the maintainer might prefer.

extent analysis

TL;DR

Render Agent tool calls in the interactive TUI transcript using the subagent_type argument to improve agent identification and event correlation.

Guidance

  • Identify the current implementation of Agent tool call rendering in the TUI transcript and locate where the subagent_type argument is available.
  • Modify the rendering logic to use the subagent_type instead of the literal Agent(...) prefix.
  • Verify that the change only affects the interactive terminal transcript and does not impact other output formats like stream-json.
  • Test the updated rendering with different agent types and sub-tasks to ensure correct display and correlation with JSON events.

Example

# Assuming a function to render Agent tool calls
def render_agent_call(agent_call):
    # Current implementation
    # return f"Agent({agent_call.description})"

    # Updated implementation using subagent_type
    return f"{agent_call.subagent_type}({agent_call.description})"

Notes

This solution only addresses the rendering of Agent tool calls in the interactive TUI transcript and does not affect other surfaces or output formats. The proposed change is limited to the terminal transcript and does not require any schema changes.

Recommendation

Apply the workaround by modifying the Agent tool call rendering logic to use the subagent_type argument, as it improves agent identification and event correlation without introducing any schema changes or affecting other surfaces.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Label Agent tool calls with the dispatched agent's name