[Bug] GC death spiral causes process freeze with unresponsive Ctrl+C during long sessions
Bug Description
---
Title: Claude Code freezes with high CPU, unresponsive to Ctrl+C/SIGTERM - GC death spiral
Description:
Claude Code occasionally freezes completely during long sessions. The process becomes unresponsive to all input including Ctrl+C and SIGTERM, requiring kill -9. This corrupts the terminal state and loses unsaved session context.
Symptoms:
- Process uses 150-180% CPU but makes no progress
- No response to keyboard input or signals
- Only recoverable via SIGKILL
Diagnostic evidence:
Used sample <pid> 1 to capture stack trace. ~40% of samples were in V8 garbage collection:
287 v8::internal::Heap::CollectGarbage
287 v8::internal::Heap::Scavenge()
231 v8::platform::DefaultJobHandle::Join()
Memory footprint was 1.1GB (peak 1.4GB). Process was stuck in a GC death spiral - allocating faster than GC could reclaim.
Reproduction context:
- Long-running session (~10+ minutes on a single task)
- Working on decomp matching with large functions (1500+ bytes)
- Froze during a large streaming response (status showed "34.0k tokens" during thinking)
- Heavy use of subagents (Task tool) and iterative compilation
Frequency: Happening more often lately, multiple times in recent weeks.
Environment: macOS 15.5, Node 23.9.0, Apple Silicon
---
Environment Info
- Platform: darwin
- Terminal: iTerm.app
- Version: 2.1.12
- Feedback ID: eac15baf-cbea-4464-a96e-440988c14f02
Errors
I opened a different session to gather the evidence, so anything attached from current session might not be directly relevant.
[{"error":"MaxFileReadTokenExceededError: File content (89996 tokens) exceeds maximum allowed tokens (25000). Please use offset and limit parameters to read specific portions of the file, or use the GrepTool to search for specific content.\n at P62 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1552:13647)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async Object.call (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1561:996)\n at async file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:4609:1551","timestamp":"2026-01-19T22:21:16.468Z"},{"error":"MaxFileReadTokenExceededError: File content (89996 tokens) exceeds maximum allowed tokens (25000). Please use offset and limit parameters to read specific portions of the file, or use the GrepTool to search for specific content.\n at P62 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1552:13647)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async Object.call (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1561:996)\n at async file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:4609:1551","timestamp":"2026-01-19T22:21:26.078Z"},{"error":"MaxFileReadTokenExceededError: File content (89996 tokens) exceeds maximum allowed tokens (25000). Please use offset and limit parameters to read specific portions of the file, or use the GrepTool to search for specific content.\n at P62 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1552:13647)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async Object.call (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1561:996)\n at async file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:4609:1551","timestamp":"2026-01-19T22:21:26.292Z"},{"error":"Error: Request was aborted.\n at Jj.makeRequest (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:934:3940)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2026-01-19T22:22:53.422Z"}]This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗