Background task output file grows unbounded when process restarts in a loop
Resolved 💬 2 comments Opened Mar 12, 2026 by dilverse Closed Mar 12, 2026
Summary
When a background task (run_in_background: true) spawns a process that restarts repeatedly (e.g. crashes and re-spawns in a tight loop), the output file in /private/tmp/ grows without any size cap, and can fill the entire disk.
What happened
- Claude launched a process as a background Bash task.
- The process kept restarting in a tight loop.
- Each restart wrote a few lines of output to the task output file.
- This repeated hundreds of millions of times with no limit, consuming 1.7 TB and filling the disk.
Impact
- Disk went from ~4% free to completely full with no warning.
- macOS became unresponsive until the file was manually deleted.
- No alert or error was surfaced to the user inside Claude Code.
Expected behavior
Background task output files should have a size cap, with either:
- A hard truncation with a warning message, or
- The background task being killed and an alert shown to the user when the limit is hit.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗