claude-code - 💡(How to fix) Fix [BUG] Desktop Code/Cowork mode crashes instantly with OOM error — persists after fresh install, empty chats, confirmed not RAM-related (macOS Tahoe 26.4.1, v1.3036.0)

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

Error Messages/Logs

OOM error in V8: CALL_AND_RETRY_LAST Allocation failed — JavaScript heap out of memory

Code Example

<--- Last few GCs --->

131136 ms: Mark-Compact (reduce) 3778.6 (3811.1) -> 3778.6 (3786.9) MB
last resort; GC in old space requested

131153 ms: Mark-Compact (reduce) 3778.6 (3786.9) -> 3778.6 (3785.6) MB
last resort; GC in old space requested

OOM error in V8: CALL_AND_RETRY_LAST Allocation failed — JavaScript heap out of memory

Trace/BPT trap: 5
RAW_BUFFERClick to expand / collapse

Preflight Checklist

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

What's Wrong?

Claude Desktop Code/Cowork mode crashes instantly every time it is activated. Normal chat works perfectly. The issue is completely isolated to Code mode. This has been extensively debugged and ruled down to a specific OOM allocation loop in the renderer — not a system resource issue, not a conversation-size issue, not a corrupted install.

Steps to Reproduce

What Should Happen?

Code mode should activate and respond normally.

Error Messages/Logs

<--- Last few GCs --->

131136 ms: Mark-Compact (reduce) 3778.6 (3811.1) -> 3778.6 (3786.9) MB
last resort; GC in old space requested

131153 ms: Mark-Compact (reduce) 3778.6 (3786.9) -> 3778.6 (3785.6) MB
last resort; GC in old space requested

OOM error in V8: CALL_AND_RETRY_LAST Allocation failed — JavaScript heap out of memory

Trace/BPT trap: 5

Steps to Reproduce

Open Claude Desktop (v1.3036.0) on macOS 26.4.1 , Apple Silicon m3 Start a brand new empty chat Click the Code/Cowork toggle App closes immediately within ~2 minutes with no crash dialog Repeatable 100% of the time

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2 versions behind

Claude Code Version

v1.3036.0

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

Additional Issue: Claude Code CLI stopped working Following the desktop crash, Claude Code CLI has also stopped working entirely. Unclear if related to the desktop bug or a separate issue. Including here for visibility — happy to file separately if preferred.

Analysis The renderer enters an allocation loop, growing V8 heap to ~3778MB before dying. This happens on:

A brand new empty chat with no content A system with 8GB+ free RAM and green Memory Pressure A freshly downloaded and installed app with all caches cleared

This rules out:

❌ Content size / heavy conversation ❌ System RAM shortage ❌ Corrupted install or stale cache ❌ User configuration issue

The allocation loop appears to be in the Code/Cowork renderer initialization path itself, not triggered by any content or system constraint. No crash report is generated in macOS Console — this is a silent renderer exit, not a native macOS crash.

extent analysis

TL;DR

The issue is likely caused by an allocation loop in the Code/Cowork renderer initialization path, leading to a JavaScript heap out of memory error, and can be temporarily mitigated by monitoring memory usage or adjusting renderer settings.

Guidance

  • Investigate the Code/Cowork renderer initialization path to identify the cause of the allocation loop, focusing on memory-intensive operations or potential leaks.
  • Verify that the issue is not related to system resource constraints by monitoring memory usage and system performance during the crash.
  • Consider adjusting renderer settings or implementing memory limits to prevent the allocation loop from occurring.
  • Since this is a regression, compare the current version (v1.3036.0) with the last working version (2 versions behind) to identify potential changes that may have introduced the issue.

Example

No specific code snippet can be provided without more information on the renderer initialization path, but a potential example of monitoring memory usage in JavaScript could be:

// Pseudo-code example, not directly applicable to the issue
const usedHeapSize = await v8.getHeapStatistics().used_heap_size;
if (usedHeapSize > 3500 * 1024 * 1024) { // 3.5 GB threshold
  console.log('Memory usage exceeded threshold');
  // Potential mitigation or error handling
}

Notes

The issue seems to be isolated to the Code/Cowork mode and is not related to system resource constraints or content size. The lack of a crash report in macOS Console suggests a silent renderer exit, which may require additional debugging tools or logging to diagnose.

Recommendation

Apply workaround: Since the issue is a regression and the last working version is known, a potential workaround could be to revert to the last working version (2 versions behind) until the issue is fixed in a future update. This would allow users to continue using the Code/Cowork mode without encountering the allocation loop and JavaScript heap out of memory error.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [BUG] Desktop Code/Cowork mode crashes instantly with OOM error — persists after fresh install, empty chats, confirmed not RAM-related (macOS Tahoe 26.4.1, v1.3036.0)