Renderer SIGTRAP (exitCode 5) on getPrStateForBranch for .claude/worktrees paths — 1.4758.0
Summary
Claude Desktop main webview renderer crashes repeatedly with SIGTRAP (exit code 5). Today my instance crashed 7 times in ~7 hours. Every crash is preceded within 1–2 seconds by LocalSessions.getPrStateForBranch against a path inside .claude/worktrees/*.
Environment
- App version:
1.4758.0(reported as latest by built-in updater) - Platform: macOS Darwin 25.2.0 (arm64)
- Bundle:
com.anthropic.claudefordesktop
Crash signature
From ~/Library/Logs/Claude/main.log:
[info] Main webview render process gone: { reason: 'crashed', exitCode: 5 }
[error] Sentry caught: { type: 'Unknown', value: 'Main webview render process gone', stack: undefined }
From the macOS unified log (/usr/bin/log show):
ControlCenter: (FrontBoard) [com.apple.FrontBoard:Process]
[app<application.com.anthropic.claudefordesktop...>:<PID>]
Process exited: <RBSProcessExitContext| specific, status:<RBSProcessExitStatus| domain:signal(2) code:SIGTRAP(5)>>
Reproduction trigger
Every crash today was preceded by a LocalSessions.getPrStateForBranch call against a pre-existing .claude/worktrees/<name> directory. Excerpt pattern (paths anonymized):
HH:MM:SS LocalSessions.getPrStateForBranch cwd=…/<repo-A>/.claude/worktrees/<worktree-1>
HH:MM:SS+1 Main webview render process gone: { reason: 'crashed', exitCode: 5 }
HH:MM:SS LocalSessions.getPrStateForBranch cwd=…/<repo-A>/.claude/worktrees/<worktree-2>
HH:MM:SS+2 Main webview render process gone: { reason: 'crashed', exitCode: 5 }
HH:MM:SS LocalSessions.getPrStateForBranch cwd=…/<repo-A>/.claude/worktrees/<worktree-1>
HH:MM:SS LocalSessions.startShellPty …
HH:MM:SS+1 Main webview render process gone: { reason: 'crashed', exitCode: 5 }
HH:MM:SS LocalSessions.getPrStateForBranch cwd=…/<repo-B>/.claude/worktrees/<worktree-3>
HH:MM:SS Main webview render process gone: { reason: 'crashed', exitCode: 5 }
Crashes were observed against two distinct local repositories, each via different worktree directories under their respective .claude/worktrees/.
SIGTRAP from a Chromium/V8 renderer typically indicates a V8 fatal assertion or JS heap OOM. The consistent precursor is the getPrStateForBranch IPC call against an existing worktree path.
Frequency
7 renderer crashes within ~7 hours. Each crash auto-restarted the app, which then immediately tried to resume the same worktree session and crashed again — making the app effectively unusable on the affected repositories until manual intervention.
Sentry event IDs
7 Sentry events were captured from this machine. Available on request via private channel.
Additional renderer-side noise (may or may not be related)
claude.ai-web.log shows accumulating zombie state across sessions:
- Repeated
PreviewError: Preview not found for server <UUID>for multiple distinct stale preview-server UUIDs, firing dozens of times per session. - Repeated
Session <id> not found404s onPOST /v1/sessions/<id>/mark_readfor a deleted session that the renderer never stops retrying. - Occasional
Uncaught RangeError: Invalid content for node doc: <>(ProseMirror schema rejection of persisted document state).
These suggest renderer-persistent state isn't being garbage-collected when the underlying server resource disappears, which contributes to memory pressure and may lower the threshold for the V8 fatal during the worktree IPC.
Local mitigation tried
- Cleaned up stale
.claude/worktrees/*directories (mix of tracked and orphan). This alone did not stop the crashes — they were occurring on active, in-use worktrees as well. - Pruned remote-gone branches.
Suggested fix area
LocalSessions.getPrStateForBranch should not be able to crash the renderer regardless of worktree state. Likely candidates:
- IPC reply payload size / shape when a worktree is in an unusual state (detached HEAD, unborn branch, locked, missing upstream).
- Synchronous handling of a
gh/gitsubprocess that returns unexpected output, surfacing as a V8 fatal in the IPC handler. - Renderer holds onto a Promise that rejects after the resource is GC'd, leading to an unrecoverable state when re-entered.
A targeted fix:
- Wrap the renderer-side
getPrStateForBranchconsumer in a defensive boundary that returns a typed error instead of throwing. - Validate IPC payload shape at the boundary and reject malformed payloads with a recoverable error.
Workarounds
- Launching with
--disable-gpumay help (untested in my case). - Avoid opening sessions that point directly into
.claude/worktrees/<name>paths; open at the repo root and let the app create a fresh worktree.
Happy to provide log excerpts privately if useful.
8 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Resolved on my end — confirmed same root cause as #48281
The fix from #48281 (archive oversized
~/.claude/projects/*.jsonltranscripts) resolves this crash. After applying it and restarting, the previously-crashing worktrees open cleanly with no SIGTRAP.What I did
Two-pass archive of
~/.claude/projects/to a backup location outside~/.claude/:.jsonlfiles >10 MB and not modified in the last 24 hours — moved 13 files, ~223 MB..jsonlfiles older than 14 days regardless of size — moved 3,294 files, ~896 MB.| Metric | Before | After |
|---|---|---|
| Largest single project's transcripts (the repo in 100% of crashes) | ~566 MB | ~129 MB |
| Second largest project | ~196 MB | ~89 MB |
| Third largest project | ~229 MB | ~42 MB |
| Total
~/.claude/projects/| ~1.5 GB | ~371 MB |Confirmation that #48281 and this issue are the same underlying bug
Both manifest as renderer SIGTRAP /
exitCode: 5from a V8 OOM abort, even though the surface trigger differs:.claude/worktrees/<name>directory →LocalSessions.getPrStateForBranchIPC fires → renderer is already loading the parent project's transcripts → OOM → SIGTRAP.Same renderer code path, same V8 ~2.7 GB heap ceiling, same crash signal. The worktree-session path is just an additional way to trigger the same OOM, which is why "fixes" that don't address
~/.claude/projects/size (clearingApplication Support/Claude, reinstall,--disable-gpu,--max-old-space-size) don't help — they target the wrong directory.Suggested upstream improvements (still applicable to this issue)
.jsonltranscripts so a single large file or a directory of many files cannot OOM the renderer. Tail-load the last N MB by default and lazy-load older history.LocalSessions.getPrStateForBranchdefensive so it cannot bring down the renderer when called against a worktree path that triggers heavy transcript loading.Closing this on my end since the workaround resolves it. Leaving the issue open in case maintainers want to track the upstream-side fix.
Another occurrence: 2026-05-01 16:59:42 (Claude Code 2.1.121, macOS).
Active session at the time was operating in
/Users/chriscase/Documents/GitHub— heavy git activity across multiple repos with worktrees enabled.Independent corroboration of the worktrees-path hypothesis from this issue's title: during the same session I had
.claude/worktrees/agent-<uuid>directories appearing in the working tree of repos I was committing in. They got accidentally swept up bygit add -Aas embedded git submodules and required a follow-up commit +.gitignoreentry to remove. So the harness is materializing those paths inside the user-facing repo trees, which lines up with the renderer hitting them.Full crash count for the session that hit this:
grep "render process gone" main.logshows 8 occurrences over 2026-04-30 → 2026-05-01 (~36h window), all with the sameexitCode: 5signature.Another occurrence: 2026-05-01 19:00:02 (CLI 2.1.126, renderer still on 2.1.121, macOS).
Active session pattern was identical to the previous report — heavy multi-repo git work with
.claude/worktrees/directories materialized inside the user-facing repo trees. Six PRs across four repos in ~2 hours (broadcast/notification feature slices A→F), with frequent branch switches, stashes, cherry-picks, and rebases across~/Documents/GitHub/abydonian,AbydonianSupport,NexaDeck, andNexaCore..claude/worktrees/directories observed inside repos during the session:abydonian/.claude/worktrees/:agent-a457d41b,agent-a6e05934AbydonianSupport/.claude/worktrees/: presentNexaDeck/.claude/worktrees/: present (multiple includingNexaCore,NexaMix,sleepy-shannon-e453e3)Total renderer crashes in this
main.logsince the issue opened: 6 occurrences on 2026-05-01 alone (~28 total across the log). Crash signature is unchanged: sameexitCode: 5, same SIGTRAP pattern.This continues to be reproducible just by working across multiple repos that the harness has spawned worktrees in. The transcript-archival workaround from #48281 reduces frequency but doesn't eliminate it — confirming wsalem117's analysis that the underlying renderer OOM in
LocalSessions.getPrStateForBranchagainst worktree paths is a separate fixable code path.Suggestion still stands: make
getPrStateForBranchdefensive against worktree paths that trigger heavy transcript loading, and stream-load transcripts so a single large file can't OOM the renderer.4 more occurrences today (2026-05-02), still macOS, still CLI 2.1.126 + renderer 2.1.121, still the same
exitCode: 5SIGTRAP signature on workflows that touch.claude/worktrees/<name>paths.Per-day cadence in this
main.log:| Date | Occurrences |
|---|---|
| 2026-04-29 | 4 |
| 2026-04-30 | 4 |
| 2026-05-01 | 6 |
| 2026-05-02 | 4 (in progress) |
18 crashes in 4 days — averaging better than once every 5–6 hours of active use.
A few observations from continuing to hit this:
.claude/mitigation is partial. I've added.claude/to.gitignoreacross all four repos I work in (so the worktree dirs no longer pollutegit status), and that's reduced but not eliminated the crashes. The renderer is still crashing during heavy git activity in worktree-laden trees, so the trigger surface ingetPrStateForBranch(or whatever the actual offending path is) is independent of whether the worktree dir is tracked vs. ignored.I'd genuinely appreciate any signal from maintainers that this is being looked at — even just a "we see it, ETA Q3" would be useful. Right now it feels like the issue is open in the bug tracker but otherwise invisible to the team. For a paid product this volume of unaddressed crashing on a routine workflow (multi-repo dev with worktrees, which is exactly what Claude Code itself encourages via subagents) is hard to keep absorbing.
Update — crashes stopped after upgrade to 1.6259.1+
Last occurrence of this exact
Main webview render process gone: { reason: 'crashed', exitCode: 5 }signature in mymain.log: 2026-05-02 23:45:29, on app version 1.5354.0. Nine days, nine hours later (today is 2026-05-12) — through normal heavy multi-repo work, worktree churn, and the same.claude/worktrees/materialization pattern that previously reproduced this several times a day — zero recurrences.Version progression in the same
main.logover the gap:| Date | App version | Crashes |
|---|---|---|
| 2026-04-29 → 05-02 | 1.5354.0 | 19 across 4 days |
| 2026-05-03 → 05-05 | 1.5354.0 (no usage gap) | 0 |
| 2026-05-06 | 1.6259.1 | 0 |
| 2026-05-09 | 1.6608.0 | 0 |
| 2026-05-10 → today | 1.6608.2 | 0 |
So between 1.5354.0 and 1.6259.1 (or somewhere downstream) something fixed this. I don't know which release was the actual fix point — if maintainers have a candidate commit/release-note mapping, that'd be useful for confirming.
Not closing on my end yet — want a couple more weeks of clean signal before doing that. But the trend is unambiguous, and given how reliably this used to fire under workflows I've kept doing the same way, I'm reasonably confident it's a real fix rather than a coincidence.
Thanks to whoever shipped the fix. Strongly suggest tagging this issue with the fixing version once identified so users searching the tracker know they need to upgrade past it.
Getting an immediate fix for this in Thursday's desktop release.
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.