Task output file in /private/tmp grows unbounded (350GB in single session)

Resolved 💬 3 comments Opened Mar 12, 2026 by elon-choi Closed Mar 16, 2026

Bug Description

A single task output file under /private/tmp/claude-501/<project>/<session>/tasks/ grew to 350GB during one conversation session, filling the disk to 99% capacity.

Environment

  • Claude Code version: 2.1.74
  • OS: macOS (Darwin 25.3.0, APFS 460GB disk)
  • Platform: VSCode extension

Steps to Reproduce

  1. Have a long conversation session with many sub-agent (Agent tool) invocations
  2. The file /private/tmp/claude-501/<project>/<session-id>/tasks/<task-id>.output accumulates all sub-agent outputs via append
  3. No size cap or rotation exists on this file

What Happened

  • Session ID: 884644d8-bdb0-491d-8c84-363b330c3317
  • File: b6rs5lm1n.output
  • Size: 376,142,184,393 bytes (350GB)
  • Lines: 17,316,244
  • The file concatenates sub-agent outputs with === <agent-id>.output === delimiters
  • First 10MB alone contained 171 sub-agent output sections
  • Estimated total: ~6 million sub-agent output entries
  • Created during a single day of conversation (Mar 12, 2026)

Impact

  • Disk filled to 99% (405GB/460GB used), macOS showed storage full warning
  • User could not identify the cause without deep investigation into /private/tmp
  • File was still held open by processes even after deletion (required lsof + kill to reclaim space)

Expected Behavior

  • Task output files should have a size cap or rotation policy
  • Old/completed task outputs should be cleaned up when a session ends
  • At minimum, warn the user when tmp storage exceeds a threshold

Workaround

# Find large task output files
du -sh /private/tmp/claude-501/*/tasks/*.output | sort -rh | head

# Delete and kill any processes holding the file
rm <file>
lsof | grep <filename>  # find PID
kill <PID>

🤖 Generated with Claude Code

View original on GitHub ↗

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