Skip to content

Feature: Link subagent sessions to main session view #9

@Koomook

Description

@Koomook

Problem

When a subagent (Task tool) runs in Claude Code, its output is recorded as a type: "user" message in the main session's JSONL file. This makes it appear as if a human typed the message, when it was actually produced by a subagent.

Example

In session ccb768a6-b559-478c-a66b-114fa4c95239:

  • A subagent was invoked to summarize text
  • The subagent's response ("요약할 텍스트: 확인 결과:...") was recorded with "type": "user"
  • This displays as "Human" in the cops dashboard, which is misleading

Proposed Solution

  1. Identify subagent messages: Detect messages that originate from subagents (they may have metadata like sourceToolAssistantUuid or similar markers)

  2. Visual differentiation: Display subagent-originated messages differently from regular human input (e.g., different icon, label like "Subagent Result" instead of "Human")

  3. Link to subagent session: If Claude Code creates separate session files for subagents (e.g., agent-*.jsonl), provide a way to:

    • Show a link/button to view the full subagent session
    • Inline expand the subagent's conversation within the main session view

Questions to Investigate

  • Does Claude Code record subagent sessions in separate JSONL files?
  • Is there metadata in the JSONL that identifies a message as coming from a subagent vs direct human input?
  • How are subagent sessions linked to parent sessions?

Related Files

  • web/src/feature/session/util/parse-content.ts - Message parsing logic
  • web/src/feature/session/component/message-bubble.tsx - Message display component
  • shared/domain/transcript_user.go - User transcript domain model (has SourceToolAssistantUUID field)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions