[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_
8 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Also affected — M4 MacBook Pro 14-inch, 32GB RAM, so this isn't limited to 8GB machines. Filed a separate report at #48276 before spotting this one. Same symptom: crashes on launch when Claude Code/Cowork loads, chat-only mode works. macOS Tahoe 26.4.1, Claude Desktop 1.2581.0. Happy to provide any additional diagnostic info.
chat-only mode functions for me if tweaking in terminal to not have the choice between chat / cowork and code. otherwise it does not work even for chat mode. Still seems like the new update created the issue, to bad there is no rollback to previous version option
Did to find a solution for this issue?
unfortunately no solution but to wait for a fix/update release...
There’s some solution in here but I haven’t tried it yet https://github.com/anthropics/claude-code/issues/48281
thanks that worked.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.