Renderer SIGTRAP (exitCode 5) on getPrStateForBranch for .claude/worktrees paths — 1.4758.0

Resolved 💬 8 comments Opened Apr 28, 2026 by wsalem117 Closed May 19, 2026

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 found 404s on POST /v1/sessions/<id>/mark_read for 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 / git subprocess 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 getPrStateForBranch consumer 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-gpu may 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.

View original on GitHub ↗

This issue has 8 comments on GitHub. Read the full discussion on GitHub ↗