You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Session resume freezes with 100% CPU due to redundant progress events in session files #22149
Claude Code freezes with 100% CPU when attempting to resume conversations. The UI becomes unresponsive and the process must be killed.
Root Cause Analysis
Investigation revealed that session .jsonl files grow to hundreds of megabytes due to progress events storing the entire conversation history in normalizedMessages on every event.
Evidence from a 193MB session file:
500 lines total
426 progress events = 191.6 MB (99.9% of file)
Actual conversation (user/assistant/system) = 0.16 MB
Each progress event contains full normalizedMessages array (2264 messages in longest case)
Individual lines up to 1.4 MB each
The duplication pattern:
Early events: progress with ~140 messages → 0.72 MB
Middle events: progress with ~500 messages → 0.85 MB
Late events: progress with ~2264 messages → 1.44 MB
Every progress event duplicates the entire conversation history up to that point.
Impact
Session files grow to 100MB-400MB for long conversations
Resume picker must parse all these files → 100% CPU freeze
Storage waste: 99.9% of session files is redundant data
Expected behavior
progress events should either:
Not include normalizedMessages (it's redundant - the conversation is already stored in user/assistant events)
Store only a delta/reference
Be excluded from session files entirely (they're only needed for live streaming UI)
Third Finding: Duplicate subagent transcripts in task results
The Bug
When a Task tool completes, the subagent's full conversation transcript is stored twice in the parent session - once in toolUseResult.task.output and again in toolUseResult.task.result.
Evidence
Task result structure:
output: 768.1 KB ← full subagent transcript
result: 768.1 KB ← IDENTICAL copy
Confirmed: output === result (same data stored twice)
In one session with 16 subagent calls:
Total embedded transcript size: 21.4 MB
~10.7 MB is duplicate data
Expected Behavior
Either:
Store the transcript once (remove result or output)
Or have result contain only a summary/reference, not the full transcript
Combined Impact
All three issues compound in long sessions with subagents:
progress events duplicate full history (exponential)
saved_hook_context duplicates per message (quadratic)
task.output/task.result duplicate transcripts (2x per subagent)
A session that should be ~2MB can easily grow to 200MB+.
claude code has become unusable and its got nothing to do with my CLAUDE.md or .claude folders
works correctly from home folder, and works correctly when .claude/projects/ is cleared, but do not see anything if you try /resume from inside claude code, or --continue or --resume from terminal. Also orphan claude processes stay in memory for new native install on mac. release channel is latest, not stable and version is 2.1.27
Other issues i saw: Haiku being used for something denied tool calls, and malformed json in responses which at least for a few hours i have not been able to trace to anything in my repo.
Same problem here — progress events storing the entire conversation history on every tick, making session files unusable. Your analysis nailed it: 426 progress events = 191.6MB out of 193MB total. 99.9% waste.
Built Cozempic specifically for this. The progress-collapse strategy detects consecutive progress tick messages and collapses them into a single entry. On a session like yours it would take that 193MB down to a few MB.
pip install cozempic
cozempic init
cozempic init auto-wires a guard daemon that starts on every session and prunes this bloat continuously — so the file never gets large enough to cause the freeze in the first place. For an existing bloated session that's already stuck:
Then claude --resume should work again without the 100% CPU freeze.
Would appreciate if you could try this on one of your affected sessions and let me know if it resolves the resume freeze. If there are progress patterns I'm not catching, I want to know so I can add them.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.
Activity
github-actions commentedon Jan 31, 2026
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
asem89 commentedon Jan 31, 2026
Additional Finding: saved_hook_context duplication
While investigating, I found a second source of session bloat:
The Bug
saved_hook_contextentries (for SessionStart hooks) are written once per historical message instead of once per session.Evidence
A session with 619 messages that was resumed ~9 times had:
saved_hook_contextentries (should be ~9)Pattern
Space Impact
Expected Behavior
SessionStart hook context should be saved once per session start, not once per message in history.
asem89 commentedon Jan 31, 2026
Third Finding: Duplicate subagent transcripts in task results
The Bug
When a Task tool completes, the subagent's full conversation transcript is stored twice in the parent session - once in
toolUseResult.task.outputand again intoolUseResult.task.result.Evidence
In one session with 16 subagent calls:
Expected Behavior
Either:
resultoroutput)resultcontain only a summary/reference, not the full transcriptCombined Impact
All three issues compound in long sessions with subagents:
progressevents duplicate full history (exponential)saved_hook_contextduplicates per message (quadratic)task.output/task.resultduplicate transcripts (2x per subagent)A session that should be ~2MB can easily grow to 200MB+.
asem89 commentedon Jan 31, 2026
Comprehensive Audit Results (GPT-5.2 Analysis)
A deep audit of ~/.claude/projects (~488 MB, 1,476 JSONL files) revealed 5 additional storage bugs beyond the original 3.
Storage Breakdown
user79.4%,assistant18.2%, other ~2.4%toolUseResult~226 MB (largest),message~155 MBAdditional Bugs Found
Bug 4: Tool results stored redundantly (JSONL + message)
userevents often contain BOTH:toolUseResult.stdoutmessage.content[].tool_result.contentEvidence: In 20k sampled events, output was duplicated in 96-97% of cases.
Bug 5: Tool output triple-stored (JSONL + message + file)
Tool output appears in:
tool-results/toolu_*.txt(full file)toolUseResult.stdout(full inline)message.tool_result.content(often full)Evidence: 81.2% of
tool-results/*.txtbytes were duplicated in JSONL.Bug 6: Full file contents stored inline
toolUseResultstores:originalFile: ~87 MB across 2,547 occurrencesfile: ~41 MB across 5,383 occurrencesThese are full file snapshots, not diffs, even though the filesystem has the file.
Bug 7: Subagent streaming rewrites full transcript each update (O(N²))
For
local_agenttasks withstatus: running:task.outputis the full transcript-so-farEvidence:
Bug 8: Bash progress duplicates output fields
For
bash_progressevents (571 sampled):outputandfullOutputalways existfullOutputis ~3.87x largerRecommended Fixes (by ROI)
{toolUseId, sha256}elsewheremessage.tool_resultduplication - pick one canonical location{path, pre_hash, post_hash, diff}subagents/*.jsonlANDtask.output/resultsaved_hook_context- store once globally, reference by hashSummary Table
nikhilgikiai commentedon Jan 31, 2026
claude code has become unusable and its got nothing to do with my CLAUDE.md or .claude folders
works correctly from home folder, and works correctly when .claude/projects/ is cleared, but do not see anything if you try /resume from inside claude code, or --continue or --resume from terminal. Also orphan claude processes stay in memory for new native install on mac. release channel is latest, not stable and version is 2.1.27
Other issues i saw: Haiku being used for something denied tool calls, and malformed json in responses which at least for a few hours i have not been able to trace to anything in my repo.
dicksontsai commentedon Jan 31, 2026
2.1.27 could be related to #22042 rather than progress events. Progress events were fixed last week according to Claude Code oncall records.
junaidtitan commentedon Feb 10, 2026
Same problem here — progress events storing the entire conversation history on every tick, making session files unusable. Your analysis nailed it: 426 progress events = 191.6MB out of 193MB total. 99.9% waste.
Built Cozempic specifically for this. The
progress-collapsestrategy detects consecutive progress tick messages and collapses them into a single entry. On a session like yours it would take that 193MB down to a few MB.cozempic initauto-wires a guard daemon that starts on every session and prunes this bloat continuously — so the file never gets large enough to cause the freeze in the first place. For an existing bloated session that's already stuck:Then
claude --resumeshould work again without the 100% CPU freeze.Would appreciate if you could try this on one of your affected sessions and let me know if it resolves the resume freeze. If there are progress patterns I'm not catching, I want to know so I can add them.
github-actions commentedon Mar 11, 2026
Closing for now — inactive for too long. Please open a new issue if this is still relevant.
github-actions commentedon Mar 19, 2026
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.