[BUG] Title: Desktop app OOM crash on launch (~5s) when sidebarMode: "code" is set on 8 GB Mac
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] 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
BuddyBleTransportlistener 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
Steps to Reproduce
Reproduction:
- Use the desktop app for several weeks of active Claude Code sessions (so session/worktree history accumulates).
- update to latest version
- 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_
This issue has 8 comments on GitHub. Read the full discussion on GitHub ↗