Task output files grow unboundedly, filling entire disk (278 GB in minutes)
Product: Claude Code CLI
Version: 2.1.89
OS: macOS 26.2 (arm64, Apple Silicon)
Severity: Critical — causes complete disk exhaustion, system instability
Reproducibility: Intermittent / not yet reliably reproducible
Summary
Claude Code task output files in /private/tmp/claude-<uid>/ grow to hundreds of gigabytes within minutes, filling the entire disk. A single Claude Code session in one project consumed 278 GB of disk space via two runaway task output files (232 GB and 46 GB). The 926 GB drive was at 99% capacity with only 10 GB remaining.
Steps to Reproduce
Not yet reliably reproducible. The conditions under which this occurred:
- Using Claude Code 2.1.89 with Opus 4.6 (1M context)
- Working in a project with multiple subagent types configured (custom plugin agents and built-in core agents)
- Session involved multiple background tasks / subagents — the
tasks/directory contained 61 symlinks to subagent output.jsonlfiles spanning multiple session IDs, suggesting a shared/aggregated task output directory across sessions - Two task output files grew without bound until the disk was full
- Files were still actively growing at the time of discovery
What the output files contain
Inspecting the file content:
- Head of file: Normal JSONL subagent message records (assistant messages, tool use, etc.), each line containing a JSON object with fields like
parentUuid,agentId,message,sessionId, etc. - Tail of file: Claude Code's own minified JavaScript bundle source code — internal implementation details including session management, git worktree listing,
AbortControllerlogic, stream processing, etc. This is clearly not intended output.
This suggests Claude Code may be writing its own bundle contents into the task output stream, possibly repeatedly.
Observed data
Location: /private/tmp/claude-<uid>/<project-path>/<session-id>/tasks/
File 1: 232 GB created 21:11:00 modified 21:23:13 (232 GB in ~12 min, ~320 MB/s)
File 2: 46 GB created 21:13:05 modified 21:14:54 ( 46 GB in ~2 min)
Disk state at discovery:
$ df -h /System/Volumes/Data
Filesystem Size Used Avail Capacity
/dev/disk3s5 926Gi 889Gi 10Gi 99%
$ du -sh /private/tmp/claude-<uid>/
278G /private/tmp/claude-<uid>/
Impact
- Complete disk exhaustion — 926 GB drive filled to 99% capacity (10 GB free)
no space left on deviceerrors across the system- All writes on the system were failing, affecting unrelated applications
- The files were still actively growing at time of discovery
Expected Behavior
Task output files should have a size cap or rotation policy. A single task output should never be able to consume more than a reasonable amount of disk space. Potential safeguards:
- Maximum file size limit for task output
- Periodic cleanup of stale temp files
- Monitoring/warning when temp directory usage exceeds a threshold
- Output stream deduplication (the same content should not be written repeatedly)
- The Claude Code JS bundle should never end up in a task output stream
Workaround
Deleting the temp directory resolved the issue in this case:
rm -rf /private/tmp/claude-$(id -u)/
Claude Code recreates what it needs on next launch.
Environment
- Claude Code: 2.1.89
- Model: claude-opus-4-6 (1M context)
- macOS: 26.2 (Build 25C56)
- Architecture: arm64 (Apple Silicon)
- Disk: 926 GB APFS volume
- Configuration: Custom plugin agents, built-in agents, and an MCP server; multiple subagent types active
This issue has 7 comments on GitHub. Read the full discussion on GitHub ↗