-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
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
-
Identify subagent messages: Detect messages that originate from subagents (they may have metadata like
sourceToolAssistantUuidor similar markers) -
Visual differentiation: Display subagent-originated messages differently from regular human input (e.g., different icon, label like "Subagent Result" instead of "Human")
-
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 logicweb/src/feature/session/component/message-bubble.tsx- Message display componentshared/domain/transcript_user.go- User transcript domain model (hasSourceToolAssistantUUIDfield)
Metadata
Metadata
Assignees
Labels
No labels