[BUG] Frequent crashes when running agents requiring repeated --resume cycles (Sonnet 4.5)

Resolved 💬 5 comments Opened Oct 5, 2025 by jsbattig Closed Jan 9, 2026

[BUG] Frequent crashes when running agents requiring repeated --resume cycles (Sonnet 4.5)

Description

Claude Code crashes repeatedly during agent execution, requiring continuous use of --resume to make any progress. After resuming, the session runs for a few steps before crashing again, creating an endless crash-resume-crash cycle that makes agent-based workflows nearly unusable.

Environment

  • Claude Code Version: 2.0.1
  • Platform: Linux (Rocky Linux, kernel 5.14.0-570.37.1.el9_6.x86_64)
  • Architecture: x86_64
  • Model: claude-sonnet-4-5-20250929
  • Agent Usage: Heavy use of custom agents via Task tool (tdd-engineer, code-reviewer, systems-architect-spec-writer, etc.)
  • Agents Configured: 24 custom agents in ~/.claude/agents/

Symptoms

  1. Start Claude Code session with agent-based workflow
  2. Main context delegates to agent via Task tool
  3. Claude Code crashes - session terminates unexpectedly
  4. Use claude --resume to continue session
  5. Session resumes, agent completes a few more steps
  6. Claude Code crashes again - another unexpected termination
  7. Use claude --resume again
  8. Cycle repeats indefinitely - crash → resume → few steps → crash → resume

Crash Pattern

Frequency: Multiple crashes per agent task
Predictability: Consistent - happens with most agent invocations
Timing: Unpredictable - can crash at any point during agent execution
Recovery: Only via --resume - normal error handling doesn't help

Impact

Severity: Critical - Agent workflows essentially broken

  • Cannot complete agent tasks without 5-10 crash-resume cycles
  • Productivity destroyed - simple tasks require constant intervention
  • Context fragmentation - each resume loses some working context
  • Session state uncertainty - unclear what completed vs what crashed mid-operation
  • User exhaustion - babysitting crash-resume loops instead of productive work

Agent Execution Context

Custom Agent System:

  • 24 specialized agents (tdd-engineer, code-reviewer, elite-code-reviewer, systems-architect-spec-writer, etc.)
  • Agents recently updated to be self-contained with embedded standards
  • Heavy use of Task tool for agent delegation
  • Multi-step workflows involving agent → agent communication

Typical Crash Scenario:

  1. User: "Implement feature X using TDD"
  2. Main context: Task(tdd-engineer, ...)
  3. tdd-engineer: Starts implementation, writes tests
  4. CRASH - session terminates
  5. claude --resume
  6. tdd-engineer: Continues, implements code
  7. CRASH - session terminates again
  8. claude --resume
  9. tdd-engineer: Runs tests
  10. CRASH - yet another termination
  11. ... repeat until task eventually completes

Related Issues - Crash Epidemic (Oct 2-3, 2025)

This appears to be part of a systemic agent stability crisis with Sonnet 4.5:

Identical Timeframe - All Oct 2-3, 2025:

  • #8706 - "Resource Exhaustion and Crashes with Claude Sonnet 4.5 in Agents" (100% crash rate)
  • #8883 - "TDD Orchestrator crashes with heap out of memory"
  • #8829 - "VSCode crashes when running parallel agents and subagents"
  • #8737 - "Memory Leak Causing Mac System Crash During Extended Sub-Agent Sessions"
  • #8722 - "VS Code crashes with OOM error: 700MB+ conversation history"

Common Patterns Across All Reports:

  • ✅ Agent execution triggers crashes
  • ✅ Sonnet 4.5 specific (Opus works fine per #8706)
  • ✅ Memory exhaustion / heap out of memory
  • ✅ Reported this week (Oct 2-3, 2025)
  • ✅ Multiple platforms affected (Linux, Windows, macOS)
  • ✅ No resolution available yet

Regression Information

Timeline:

  • Prior Sonnet versions (3.5, 4.0): Agents worked reliably
  • Sonnet 4.5 (sonnet-4-5-20250929 released Sept 29): Immediate widespread agent crashes

Evidence:

  • Issue #8548 (Sept 30): User reports "Sonnet 4 did not have this issue last night"
  • Issue #8706 (Oct 2): "Does not occur with Opus model in the same setup"
  • Multiple reports within 48 hours of Sonnet 4.5 release

Conclusion: This is a confirmed Sonnet 4.5 regression affecting agent stability.

Expected Behavior

When running agent-based workflows:

  1. Agent should execute task without crashing
  2. If resource issues occur, should fail gracefully with error message
  3. Should not require multiple --resume cycles to complete simple tasks
  4. Memory usage should remain bounded during agent execution
  5. Session should remain stable throughout multi-agent workflows

Actual Behavior

  • Unpredictable crashes during agent execution
  • No error messages before crash (silent failure)
  • Requires constant user intervention with --resume
  • Tasks that should take minutes require hours of crash recovery
  • Session state becomes fragmented across multiple resume cycles

Potential Root Causes (Based on Related Issues)

  1. Memory Leaks in Agent Context Management (#8737, #8722)
  • Conversation history accumulates unbounded
  • Agent context not properly garbage collected
  • Each agent invocation adds to memory without cleanup
  1. Resource Exhaustion with Sonnet 4.5 (#8706)
  • Sonnet 4.5 agents consume excessive disk I/O and memory
  • Model-specific issue (Opus doesn't have problem)
  • 100% reproducible with agent tasks
  1. Heap Allocation Failures (#8883)
  • JavaScript heap out of memory during TDD/agent orchestration
  • GC allocation failures under agent load
  • 4GB+ memory consumption before crash
  1. Parallel Agent Instability (#8829)
  • VSCode crashes when running parallel agents
  • Sub-agent delegation compounds the issue

Attempted Workarounds

Tried:

  • Using --resume after each crash (works but endless cycle)
  • Reducing agent complexity (doesn't prevent crashes)
  • Clearing cache/state between sessions (no effect)

Not Yet Tried (Based on Community Reports):

  • Switch to Opus model (per #8706 - would solve but defeats purpose of using Sonnet 4.5)
  • Manually cleaning conversation history before agent sessions
  • Reducing number of parallel agent invocations

System Resource Observations

During Normal Agent Execution:

  • Memory: [Would need to monitor during next crash]
  • Disk I/O: [Would need to monitor during next crash]
  • CPU: [Would need to monitor during next crash]

Note: Crashes occur before monitoring tools can capture peak resource usage - need instrumentation in place before next session.

Request for Fix

Priority: Critical - Sonnet 4.5 with agents is effectively unusable

Needed:

  1. Memory leak fix for agent context management
  2. Bounded resource usage during agent execution
  3. Graceful degradation instead of crashes
  4. Proper cleanup of agent contexts after task completion
  5. Error messages before crash (not silent failures)

Additional Context

This issue makes advanced Claude Code workflows (TDD orchestration, multi-agent collaboration, epic implementation) completely impractical with Sonnet 4.5. Users are forced to either:

  • Use Opus (slower, more expensive) to avoid crashes
  • Suffer through endless crash-resume cycles
  • Abandon agent-based workflows entirely

Given that 5 similar issues were filed within 48 hours of Sonnet 4.5 release, this appears to be a critical regression affecting the agent system's core stability.

View original on GitHub ↗

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