[Bug] TaskOutput returns raw JSONL transcript instead of subagent summary (regression in 2.0.77)

Open 💬 7 comments Opened Jan 12, 2026 by peterjrichens

Description

When using TaskOutput to retrieve results from a subagent, the tool result contains raw JSONL session transcript data instead of the subagent's actual findings/summary. This completely undermines the purpose of subagents, which is context isolation - the main agent now receives the full subagent conversation (including all tool inputs and outputs) in its context window.

This is a regression introduced in v2.0.77. Version 2.0.76 correctly returned a summarized format ([Tool: Name] {args} + --- RESULT --- with actual findings).

Related Issue

See #17208 which describes the same problem but was filed as a feature request. This is actually a regression from previously working behavior.

Environment

  • Last working version: 2.0.76
  • First broken version: 2.0.77
  • OS: macOS

Reproduction Steps

claude --output-format stream-json --verbose --print \
  "launch the Explore subagent in the background to summarize the code base. After 5 seconds check on its progress and tell me what it found with its first tool call" \
  > /tmp/claude_subagent_test.jsonl

Then inspect the TaskOutput tool_result message in the JSONL output.

Expected Behavior (worked in 2.0.76)

The <output> section in the tool_result should contain a clean summary of the subagent's findings:

<retrieval_status>success</retrieval_status>
<task_id>af9675b</task_id>
<task_type>local_agent</task_type>
<status>completed</status>
<output>
[Tool: Bash] {"command":"ls -la","description":"List files"}
[Tool: Read] {"file_path":"/src/main.py"}

--- RESULT ---
## Codebase Summary

The codebase is a Python/FastAPI application with the following structure:
- src/: Main application code
- tests/: Test suites
...
</output>

Actual Behavior (broken since 2.0.77)

The <output> section contains the raw JSONL session transcript:

<retrieval_status>success</retrieval_status>
<task_id>af9675b</task_id>
<task_type>local_agent</task_type>
<status>completed</status>
<output>
[Truncated. Full output: /tmp/claude/-private-tmp/tasks/af9675b.output]

{"parentUuid":null,"isSidechain":true,"userType":"external","cwd":"/private/tmp",...,"message":{"role":"user","content":"Explore and summarize the codebase..."},...}
{"parentUuid":"...","message":{"model":"claude-haiku-4-5-20251001","role":"assistant","content":[{"type":"tool_use","id":"toolu_01...","name":"Bash","input":{"command":"ls -la /private/tmp"}}],...}
{"parentUuid":"...","message":{"role":"user","content":[{"tool_use_id":"toolu_01...","type":"tool_result","content":"total 4216\ndrwxrwxrwt  492 root..."}]},...}
...
</output>

The main agent receives:

  • The subagent's initial prompt
  • Every tool call the subagent made (Bash, Glob, etc.)
  • The full output of every tool call (file listings, command outputs, etc.)
  • All intermediate assistant messages

Impact

  1. Broken context isolation: The main agent sees 100% of subagent tokens, negating the primary benefit of subagents
  2. Unusable output: The main agent receives garbage (raw JSON with UUIDs, timestamps, token usage) instead of actionable findings
  3. Context explosion: With multiple TaskOutput calls, the main agent's context fills with redundant subagent transcripts

View original on GitHub ↗

This issue has 7 comments on GitHub. Read the full discussion on GitHub ↗