[BUG] Session resume hangs due to progress entry bloat from subagents
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report
- [x] I am using the latest version of Claude Code
What's Wrong?
Session with heavy subagent usage becomes unrecoverable. Attempting to restore or continue the conversation causes Claude Code to hang with high CPU usage. The session file grew to 270MB due to redundant data in progress entries.
Related: #19199 covers bash_progress bloat (many small events). This issue covers subagent progress bloat (fewer but much larger events due to embedded normalizedMessages).
What Should Happen?
Session should remain recoverable regardless of subagent usage. Progress entries should not cause O(n²) file growth.
Error Messages/Logs
No error - terminal goes blank, then hangs indefinitely with high CPU. Process persists even after killing terminal.
Steps to Reproduce
- Multi-turn conversation with subagents via Task tool (e.g., parallel haiku agents)
- Session uses compaction during the conversation
- Press ESC ESC to open session picker
- Select the session, choose "Restore conversation without code"
- Terminal goes blank - everything disappears
- Kill the terminal - process remains running
- New terminal with
claude -calso hangs
Root cause analysis:
Session JSONL files contain type: "progress" entries for subagent streaming. Each entry embeds the full normalizedMessages array:
- 72 user-visible messages
- 23 subagents spawned
- 3,540 progress entries logged
- Each late-session entry: ~1MB (full conversation state)
- Session file: 270MB (250MB from progress alone)
Claude Model
Opus (main) + Haiku (subagents)
Is this a regression?
I don't know
Claude Code Version
2.1.14 (Claude Code)
Platform
Other (Claude Code Max subscription)
Operating System
macOS
Terminal/Shell
iTerm2
Additional Information
Suggested fix: Progress entries should either:
- Not include
normalizedMessages(derive from message history if needed) - Store incremental updates only (delta, not full history)
- Compress or deduplicate repeated state
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗