[BUG] Task .output files in /private/tmp/claude-{uid}/ never cleaned — 537 GB from single session, recurring 6+ times in 30 days
Environment
- Claude Code: v2.1.47
- OS: macOS 26.2 (Darwin 25.2.0)
- Hardware: Mac Studio M4 Max, 64 GB RAM, 2 TB APFS SSD
- Node: v25.2.1
Bug Description
Claude Code writes Task/subagent output to /private/tmp/claude-501/{cwd-slug}/tasks/{task_id}.output files. These files persist indefinitely — there is no TTL, no session cleanup, and no size cap.
A single research-heavy session generated 537 GB of .output files today, completely filling a 2 TB disk. This has caused disk-full emergencies 6+ times in 30 days (Jan 20 – Feb 19, 2026).
The .output files are written by the Task tool (subagent system) and grow large when agents do web fetches, code exploration, or other data-heavy operations. They accumulate across tasks within a session and are never cleaned up — not when the task completes, not when the session ends, not on next launch.
Evidence (live capture, Feb 19, 2026)
$ du -sh /private/tmp/claude-501/*/ | sort -hr | head -5
537G /private/tmp/claude-501/-Users-neo14-code-sn-root-20260218-1553-ui-tests/
154M /private/tmp/claude-501/-Users-neo14-code-30-6002-43-context-agent-.../
$ find /private/tmp/claude-501/ -name "*.output" -size +100M | head
/private/tmp/claude-501/-Users-neo14-code-sn-root-20260218-1553-ui-tests/tasks/b19f9ea.output
/private/tmp/claude-501/-Users-neo14-code-30-6002-43-context-agent-.../tasks/b5fd4f3.output
$ find /private/tmp/claude-501/ -name "*.output" | wc -l
1247
Previous occurrences
| Date | Size | Session type |
|------|------|-------------|
| Feb 19 (today) | 537 GB | UI test research (web-fetch heavy) |
| Feb 19 (earlier) | 513 GB | MPA research session |
| Multiple earlier (6+ total) | disk full each time | Various research/explore sessions |
The pattern is consistent: any session that makes heavy use of the Task tool (subagents for exploration, web fetching, or code search) generates hundreds of GB of .output files that are never reclaimed.
Workaround
rm -rf /private/tmp/claude-501/
Claude Code recreates the directory structure as needed. But users shouldn't have to do this manually.
Expected behavior
- Session cleanup: Task
.outputfiles should be deleted when the session/conversation ends - Size cap: A per-session or per-task size limit (e.g., 1 GB total) would prevent runaway accumulation
- TTL: At minimum, files older than N hours should be automatically purged
claude cleancommand: A user-facing command to purge temp data (see #11646)
Any one of these would prevent the recurring disk-full emergencies.
Related issues
- #195 (closed) — Massive files in /tmp
- #16130 (closed) — Generating massive temp files
- #8856 (open) —
-cwdtracking file leak (different files, same/private/tmp/claude-{uid}/directory) - #24207 (open) —
~/.claudegrows unbounded - #11646 (open) — Feature request:
claude cleancommand
These previous issues were either closed or cover different file types. None specifically addresses task .output file accumulation at the 500 GB+ scale documented here.
This issue has 9 comments on GitHub. Read the full discussion on GitHub ↗