Skip to content

[BUG] Task .output files in /private/tmp/claude-{uid}/ never cleaned — 537 GB from single session, recurring 6+ times in 30 days #26911

@samnurmi

Description

@samnurmi

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

  1. Session cleanup: Task .output files should be deleted when the session/conversation ends
  2. Size cap: A per-session or per-task size limit (e.g., 1 GB total) would prevent runaway accumulation
  3. TTL: At minimum, files older than N hours should be automatically purged
  4. claude clean command: A user-facing command to purge temp data (see Add claude clean command to manage cache and logs #11646)

Any one of these would prevent the recurring disk-full emergencies.

Related issues

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions