claude-code - 💡(How to fix) Fix [BUG] Title: Desktop app OOM crash on launch (~5s) when sidebarMode: "code" is set on 8 GB Mac [3 comments, 3 participants]

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…
GitHub stats
anthropics/claude-code#48273Fetched 2026-04-16 07:04:30
View on GitHub
Comments
3
Participants
3
Timeline
10
Reactions
0
Timeline (top)
labeled ×6commented ×3cross-referenced ×1

Error Message

<--- Last few GCs ---> [2059:0x11c00640000] 8645 ms: Incremental Mark-Compact (reduce) 2046.4 (2055.7) -> 2045.6 (2054.5) MB [2059:0x11c00640000] 8665 ms: Incremental Mark-Compact (reduce) 2046.8 (2054.7) -> 2046.1 (2053.7) MB [2059:0415/101412.569811:ERROR:electron/shell/common/node_bindings.cc:185] OOM error in V8: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory [0415/101412.613251:WARNING:third_party/crashpad/crashpad/util/process/process_memory_mac.cc:94] mach_vm_read(0x16b168000, 0x8000): (os/kern) invalid address (1) Trace/BPT trap: 5

Root Cause

Root cause (confirmed via bisection): The preference "sidebarMode": "code" in ~/Library/Application Support/Claude/claude_desktop_config.json triggers OOM in the renderer on launch. Removing that single key makes the app launch and stay open (though without the Code tab UI auto-loaded).

Fix Action

Fix / Workaround

Workaround: Edit ~/Library/Application Support/Claude/claude_desktop_config.json and remove "sidebarMode": "code" (or change to "chat"). App then launches but tabs at top (Chat/Cowork/Code) are not visible — falls back to a stripped-down chat-only mode.

Code Example

<--- Last few GCs --->
[2059:0x11c00640000]     8645 ms: Incremental Mark-Compact (reduce) 2046.4 (2055.7) -> 2045.6 (2054.5) MB
[2059:0x11c00640000]     8665 ms: Incremental Mark-Compact (reduce) 2046.8 (2054.7) -> 2046.1 (2053.7) MB
[2059:0415/101412.569811:ERROR:electron/shell/common/node_bindings.cc:185] OOM error in V8: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
[0415/101412.613251:WARNING:third_party/crashpad/crashpad/util/process/process_memory_mac.cc:94] mach_vm_read(0x16b168000, 0x8000): (os/kern) invalid address (1)
Trace/BPT trap: 5

---

(node:2059) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 change listeners added to [jin]. MaxListeners is 10.
Error occurred in handler for '$eipc_message$_..._claude.buddy_$_BuddyBleTransport_$_reportState': No handler registered

---

### What Should Happen?

The app should launch and remain open with the full UI (Chat / Cowork / Code tabs visible at the top), regardless of which sidebarMode is set. Loading the Code tab's session/worktree list should be lazy or paginated so it doesn't exceed V8's heap limit on launch — particularly on 8 GB Macs where the app currently becomes unusable as session history accumulates.


### Error Messages/Logs
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?

[Desktop App] OOM crash on launch (~5s) when sidebarMode: "code" is set on 8 GB Mac

Environment:

  • macOS Tahoe 26.4.1 (build 25E253)
  • MacBook Air, M2, 8 GB RAM
  • Claude desktop app (latest, fresh reinstall)

Symptom: App window opens, then quits cleanly after ~5 seconds. No .ips crash report generated. Reproducible across reinstalls.

Root cause (confirmed via bisection): The preference "sidebarMode": "code" in ~/Library/Application Support/Claude/claude_desktop_config.json triggers OOM in the renderer on launch. Removing that single key makes the app launch and stay open (though without the Code tab UI auto-loaded).

Crash output (from launching binary directly via Terminal):

<--- Last few GCs --->
[2059:0x11c00640000]     8645 ms: Incremental Mark-Compact (reduce) 2046.4 (2055.7) -> 2045.6 (2054.5) MB
[2059:0x11c00640000]     8665 ms: Incremental Mark-Compact (reduce) 2046.8 (2054.7) -> 2046.1 (2053.7) MB
[2059:0415/101412.569811:ERROR:electron/shell/common/node_bindings.cc:185] OOM error in V8: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
[0415/101412.613251:WARNING:third_party/crashpad/crashpad/util/process/process_memory_mac.cc:94] mach_vm_read(0x16b168000, 0x8000): (os/kern) invalid address (1)
Trace/BPT trap: 5

V8 heap pinned at the ~2 GB default ceiling. Launching with NODE_OPTIONS="--max-old-space-size=4096" did not resolve, suggesting the actual hydration cost on launch substantially exceeds 4 GB (likely the full Code tab session/worktree state being loaded eagerly).

Adjacent warnings emitted before the crash:

(node:2059) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 change listeners added to [jin]. MaxListeners is 10.
Error occurred in handler for '$eipc_message$_..._claude.buddy_$_BuddyBleTransport_$_reportState': No handler registered

Workaround: Edit ~/Library/Application Support/Claude/claude_desktop_config.json and remove "sidebarMode": "code" (or change to "chat"). App then launches but tabs at top (Chat/Cowork/Code) are not visible — falls back to a stripped-down chat-only mode.

Suggested investigation:

  • Lazy-load Code tab session list (don't hydrate all sessions/worktrees on launch).
  • Cap session list size with pagination/virtualization.
  • Raise default V8 heap for Electron renderer, or detect OOM and offer a recovery mode.
  • Investigate the BuddyBleTransport listener leak — may be an adjacent contributor.
  • For low-RAM Macs (8 GB), consider a "lite mode" toggle that disables eager hydration.

Impact: On 8 GB Macs (the standard MacBook Air config), the app becomes unusable as session history grows. Users have to manually edit the JSON config to recover, which is not discoverable.




### What Should Happen?

The app should launch and remain open with the full UI (Chat / Cowork / Code tabs visible at the top), regardless of which sidebarMode is set. Loading the Code tab's session/worktree list should be lazy or paginated so it doesn't exceed V8's heap limit on launch — particularly on 8 GB Macs where the app currently becomes unusable as session history accumulates.


### Error Messages/Logs

```shell

```

### Steps to Reproduce

**Reproduction:**
1. Use the desktop app for several weeks of active Claude Code sessions (so session/worktree history accumulates).
2. update to latest version
3. App quits at ~5s with the OOM above.

### Claude Model

Opus

### Is this a regression?

Yes, this worked in a previous version

### Last Working Version

one version ago from 1.2581.0

### Claude Code Version

1.2581.0

### Platform

Anthropic API

### Operating System

macOS

### Terminal/Shell

Other

### Additional Information

_No response_

extent analysis

TL;DR

The most likely fix is to implement lazy-loading for the Code tab session list to prevent excessive memory usage on launch, especially on low-RAM Macs.

Guidance

  1. Lazy-load Code tab sessions: Modify the code to load the Code tab's session/worktree list only when the tab is selected, rather than on app launch.
  2. Cap session list size: Implement pagination or virtualization to limit the number of sessions loaded at once, preventing the app from exceeding V8's heap limit.
  3. Investigate BuddyBleTransport listener leak: Address the potential memory leak caused by the BuddyBleTransport listener to prevent additional memory usage.
  4. Consider a "lite mode" toggle: Offer a toggle to disable eager hydration for low-RAM Macs, allowing users to choose between performance and features.
  5. Raise default V8 heap or detect OOM: Increase the default V8 heap size for the Electron renderer or implement a mechanism to detect OOM errors and offer a recovery mode.

Example

No code snippet is provided as the issue does not contain sufficient code context.

Notes

The provided information suggests that the issue is specific to the Claude Code desktop app on macOS, particularly on 8 GB Macs. The suggested fixes may need to be adapted for other platforms or configurations.

Recommendation

Apply a workaround by editing the ~/Library/Application Support/Claude/claude_desktop_config.json file to remove or change the "sidebarMode": "code" setting, and consider implementing lazy-loading for the Code tab session list to prevent future occurrences.

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] Title: Desktop app OOM crash on launch (~5s) when sidebarMode: "code" is set on 8 GB Mac [3 comments, 3 participants]