[Docs/UX] Task tool recommends Read for agent outputs that can exceed size limit
Bug Description
The Task tool documentation recommends using the Read tool to check agent output files:
"To check on the agent's progress or retrieve its results, use the Read tool to read the output file, or use Bash with tail to see recent output."
However, agent output files (stored as JSONL in ~/.claude/projects/.../subagents/agent-*.jsonl) can easily exceed the Read tool's 256KB size limit for non-trivial tasks. When this happens, the error message suggests using offset/limit or Grep, but doesn't mention TaskOutput as the appropriate tool.
Steps to Reproduce
- Launch a background agent with a moderately complex task (e.g., editing 10+ files)
- Wait for the agent to make progress
- Attempt to read the agent output file using the Read tool
Expected Behavior
Either:
- Task tool documentation should recommend
TaskOutputinstead ofRead - Error message when Read fails on agent output files should suggest
TaskOutput - Read tool should auto-detect agent output paths and handle them appropriately
Actual Behavior
Error: File content (964.5KB) exceeds maximum allowed size (256KB).
Please use offset and limit parameters to read specific portions of the file,
or use the GrepTool to search for specific content.
The error doesn't mention TaskOutput as the correct tool for agent outputs.
Evidence from Investigation
| Metric | Value |
|--------|-------|
| Agent task | Fix translations in 22 files |
| Output file size | 1.3MB |
| Tool calls in output | 61 (29 Read, 19 Edit) |
| Read tool limit | 256KB |
Each tool result includes full file contents, causing the JSONL output to grow unboundedly.
Suggested Fixes
- Update Task tool documentation to recommend
TaskOutputfor retrieving agent results instead ofRead
- Improve error message when Read fails on agent output files:
````
Error: Agent output file exceeds 256KB limit.
Use TaskOutput(task_id: "abc1234") to retrieve results.
- Auto-detect agent output paths in Read tool and route to TaskOutput behavior
Environment
- claude-code version: 2.1.3
- OS: macOS (darwin)
- Model: claude-opus-4-5-20251101
Related Issues
- #4002 - File token limit (addresses token limit, not byte limit)
- #15083 - TaskOutput unavailable to subagents (different issue - about subagent access)
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗