Task .output files in /private/tmp grow unbounded (95GB+)
Description
Subagent task .output files in /private/tmp/claude-501/<project>/<session>/tasks/ can grow to tens of gigabytes without any size cap, filling up disk space silently.
Observed behavior
Found 95GB consumed by three .output files:
| Project | File | Size | Cause |
|---------|------|------|-------|
| Headband | bpnv8d8um.output | 46.1 GB | Subagent output aggregation — all child agent JSON messages concatenated into one file |
| AnnasTeech | bx09ukqis.output | 43.5 GB | Same — unbounded agent output aggregation |
| time-guy | b95uphkyk.output | 5.0 GB | sentry-cli login interactive prompt looped infinitely printing invalid input! |
All other .output files in the same directories were normal size (10KB–100KB).
Expected behavior
Task output files should have a size cap (e.g., 50MB or 100MB) to prevent unbounded growth. When a cap is hit, either truncate with a warning or stop capturing.
Steps to reproduce
- Run a Claude Code session with multiple subagents (e.g., 5+ parallel agents via worktrees)
- One agent runs a command that produces infinite or very large output (interactive prompt in non-interactive shell, verbose build loop, etc.)
- The corresponding
.outputfile in/private/tmp/claude-501/grows without limit
Environment
- macOS (Darwin 25.3.0)
- Claude Code with heavy subagent usage (product-review, product-sprint workflows with parallel agents)
- Files located at:
/private/tmp/claude-501/<project-path>/<session-uuid>/tasks/<task-id>.output
Workaround
rm -rf /private/tmp/claude-501 — these are ephemeral task output captures and safe to delete. Directory is also cleared on reboot.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗