Feature: Option to separate subagent transcripts from parent session
Problem
When using the Agent tool to spawn subagents, all subagent activities (tool calls, responses, intermediate reasoning) are recorded in the parent session's transcript. This makes it very difficult to:
- Resume sessions: When using
claude --resume, the session list becomes cluttered with entries that are mostly subagent logs rather than the user's main conversation - Navigate conversation history: The actual user-agent dialogue is buried under dozens/hundreds of subagent tool calls
- Manage context: Large subagent transcripts consume context window space during compaction
This is especially problematic when using parallel subagents (e.g., 8 agents running simultaneously for code implementation), which can generate hundreds of tool calls in a single session.
Current Behavior
All subagent activities are embedded inline in the parent session's transcript JSONL file. There is no way to opt out of this.
Parent session transcript:
- User message
- Assistant response
- Agent tool call (spawns subagent)
- [100+ subagent tool calls recorded here]
- Agent result
- User message
...
Proposed Solution
Add an option to store subagent transcripts in separate files, with only a summary/reference in the parent session:
Parent session transcript:
- User message
- Assistant response
- Agent tool call → subagent_id: abc123 (transcript: separate file)
- Agent result: "Completed successfully"
- User message
...
Separate file: subagents/abc123.jsonl
- [All subagent tool calls here]
Possible implementations:
- Agent tool parameter:
Agent(separate_transcript: true)to opt-in per invocation - Settings option:
"subagentTranscriptMode": "separate" | "inline"in settings.json - Automatic: Always separate when
run_in_background: true
Use Case
I'm building a system where Claude Code orchestrates 8+ parallel subagents for code implementation (TDD workflow with separate agents for each module). Each subagent performs 10-20 tool calls. A single orchestration session generates 100+ subagent tool calls, making it nearly impossible to find and resume the parent conversation later.
Environment
- Claude Code version: 2.1.76+
- OS: WSL2 (Ubuntu)
- Usage pattern: Multi-agent orchestration with
Agenttool +run_in_background
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗