[BUG] Task .output files incorrectly receiving full session JSONL log stream — 500+ GB temp file generated (v2.1.69)

Resolved 💬 3 comments Opened Mar 5, 2026 by ocean-views-228 Closed Mar 9, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Summary

In Claude Code v2.1.69, task .output files in /private/tmp/claude-[uid]/ are being connected to the full session JSON log stream instead of capturing only subagent stdout/stderr. This caused a single task output file to grow to 500+ GB, consuming all available disk space.

Environment

  • CC Version: 2.1.69
  • OS: macOS (Apple Silicon MacBook Pro)
  • Trigger: Multi-subagent session with 5+ concurrent subagents

Affected Location

/private/tmp/claude-[uid]/[project-path]/tasks/[task-id].output
Size: 500+ GB
Type: UTF-8 plain text (JSONL)

What Happened

During a multi-subagent session with 5+ subagents running concurrently (research, writing, and generation tasks), one task generated an .output file that grew unbounded until the disk reached 0 bytes free.

Inspection confirmed the file contained the full session JSON log stream — every API request, response, token count, and cache metadata for the entire conversation — not just the subagent's stdout/stderr as expected. Multiple subagent outputs were concatenated with === agentId.output === markers visible throughout.

All temp output files are written to /private/tmp/claude-[uid]/[project-path]/tasks/ with no size cap or cleanup mechanism.

Impact

  • Disk completely full (0 bytes free)
  • No automatic detection or alerting from Claude Code
  • No self-cleanup by Claude Code
  • Other tasks in the same session produced 0B .output files, so the bug appears to affect specific task configurations — likely tasks with multiple concurrent subagents

Workaround

Installed a launchd agent running every 30 minutes to detect and delete any .output file exceeding 500 MB in /private/tmp/claude-[uid]/.

Expected Behavior

Task .output files should capture only subagent stdout/stderr, not the full session JSONL log stream. A maximum file size cap and/or periodic cleanup of /tmp task output files should be enforced by Claude Code.

Suggested Fix

  1. Decouple task .output file writes from the session log stream
  2. Add a size cap on .output files (e.g. 100 MB) with a warning when exceeded
  3. Implement cleanup of stale task output files in /tmp on session exit

What Should Happen?

Task .output files should contain only subagent stdout/stderr. They should not receive the full session JSONL log stream, and should have a size cap with automatic cleanup on session exit.

Error Messages/Logs

Steps to Reproduce

Start a Claude Code session in any project
Run a task that spawns 5+ concurrent subagents
Let the session run for an extended period
Check /private/tmp/claude-[uid]/[project-path]/tasks/ — one or more .output files will be growing unboundedly
On a long enough session, the file will consume all available disk space

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.69

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

The bug was discovered after macOS reported 667 GB of "System Data." A launchd cleanup agent was installed as a workaround. Other tasks in the same session produced 0B .output files, suggesting the bug is triggered by specific multi-subagent configurations.

View original on GitHub ↗

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