Task Agent Output Files Empty (TaskOutputTool regression) - 20M+ tokens wasted
Summary
I'm having trouble retrieving results from background Task agents. The output files are empty (0 bytes), and I'm not sure if this is expected behavior or if I'm using the wrong approach.
Version: 2.1.3
Platform: Windows 11
---
What I'm Seeing
When I launch a Task agent (general-purpose subagent), it completes successfully, but:
- The
.outputfile in temp directory is 0 bytes TaskOutputtool returns "success" but no content- The agent transcript IS saved in
~/.claude/projects/.../subagents/agent-{id}.jsonl
Background Bash tasks work fine - their output files have content.
---
What I Tried
TaskOutputwithblock: true→ Returns success, no contentReadtool on the output file → Empty- Resuming the agent → Works, but seems indirect
---
Question
After the change from AgentOutputTool/BashOutputTool to unified TaskOutputTool, what's the correct way to retrieve Task agent results?
Am I using the wrong approach, or is there a bug with agent output file population?
---
File Evidence
Bash task output: /tasks/b4b8e7c.output → 58,145 bytes ✓
Agent task output: /tasks/ad21e0c.output → 0 bytes
Agent jsonl: agent-ad21e0c.jsonl → 66 MB of content
The agent clearly ran and captured data - I just can't retrieve it through the output file mechanism.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗