[BUG] Claude Code process exits with code 143 (SIGTERM) every exactly 5 minutes in Desktop app & VS Code extension — terminal CLI unaffected
Bug description
Claude Code child process spawned by the Desktop app (and VS Code extension) is killed with SIGTERM (exit code 143) at exactly 300-second intervals. The terminal CLI (claude in shell) works perfectly — the issue is exclusive to the Desktop app and VS Code extension wrapper.
Evidence from logs (~/Library/Logs/Claude/main.log)
Crash pattern — exact 5-minute intervals
2026-05-25 17:13:57 → crash
2026-05-25 17:18:58 → crash (gap: 300s)
2026-05-25 17:23:58 → crash (gap: 300s)
2026-05-25 17:28:58 → crash (gap: 300s)
2026-05-25 17:38:58 → crash (gap: 300s after manual restart)
2026-05-25 17:43:58 → crash (gap: 300s)
2026-05-25 17:48:58 → crash (gap: 300s)
2026-05-25 17:53:59 → crash (gap: 300s)
2026-05-25 17:58:59 → crash (gap: 300s)
2026-05-25 18:03:59 → crash (gap: 300s)
Same pattern observed on May 4, May 15, and May 22 — not a one-time occurrence.
Error from main.log
[error] Session local_8de989a6-... query error: Claude Code process exited with code 143 {
stack: 'Error: Claude Code process exited with code 143
at d4i.getProcessExitError (.../app.asar/.vite/build/index.js:459:8311)
at ChildProcess.i (.../app.asar/.vite/build/index.js:459:11562)
at Object.onceWrapper (node:events:631:26)
at ChildProcess.emit (node:events:521:24)
at ChildProcess._handle.onexit (node:internal/child_process:295:12)'
}
CycleHealth shows it's a timer, not response timeout
Some queries complete successfully in 60–93s, while others get killed at the exact 5-minute mark regardless of progress:
17:23:12 healthy cycle (68s, hadFirstResponse=true) ← OK
17:26:33 healthy cycle (64s, hadFirstResponse=true) ← OK
17:51:16 healthy cycle (93s, hadFirstResponse=true) ← OK
17:28:58 unhealthy cycle (62s, reason=system_error) ← killed at 5-min mark
17:58:59 unhealthy cycle (34s, reason=system_error) ← killed at 5-min mark
Not macOS Jetsam / OOM
- macOS system log (
log show) shows zero Jetsam/memorystatus/kill entries for Claude processes memory_pressurereports 39–48% free after closing background apps- Crash persists regardless of memory state
Not OAuth/auth issue
Logs showed [remoteManagedSettings] fetch returned 401 concurrently, but re-login fixed the 401 errors while 143 crashes continued unchanged at the same 5-minute interval.
Reproduction steps
- Open Claude Desktop app (v1.8555.2) on macOS
- Start or resume a Claude Code session (tested with ~115 transcript messages, 126 tools, 11 MCP servers, 4 plugins)
- Use the session normally — send messages, run tools
- Observe: process exits with code 143 every exactly 300 seconds
- Session auto-resumes but crashes again at the next 5-minute mark
- Run the same session via terminal CLI (
claude --resume <session-id>) → no crash
Expected behavior
The Claude Code child process should not be killed by a 300-second timer while actively processing or idle. The process should remain alive until explicitly terminated by the user or by a legitimate resource constraint.
System information
- Claude Desktop app: v1.8555.2
- Claude Code CLI: v2.1.149
- macOS: 26.5 (Build 25F71)
- Chip: Apple M3
- RAM: 16 GB
- Model: claude-opus-4-6 with
--effort max
Session details
- Session had 115 transcript messages at time of crashes
- 126 tools loaded, 11 MCP servers, 4 plugins (skills, remote, 2 local LSP)
- CLI session ID:
a9c4e41e-c8d3-491b-8124-54833635b2d1
Possibly related
- #45717 — Bash tool timeout SIGTERM propagation kills parent process
- #53136 —
claude --print -pexits 143 after ~14 tool round-trips
Workaround
Use the terminal CLI instead of Desktop app / VS Code extension for long or heavy sessions.
Showing cached comments. Read the full discussion on GitHub ↗
5 Comments
🔧 Solution Proposed
Here's a detailed technical analysis and proposed fix for this issue.
---
Solution: Claude Code SIGTERM Every 5 Minutes in Desktop/VSCode
Issue
https://github.com/anthropics/claude-code/issues/62202
Root Cause Analysis
The 5-minute exact SIGTERM pattern in Desktop and VSCode but NOT in terminal CLI points to a host-environment lifecycle management issue, not a Claude Code internal bug.
Likely Cause: Electron/VSCode Terminal Lifecycle Timeout
Both Electron (Desktop) and VSCode manage terminal child processes through their own lifecycle APIs:
BrowserWindowidle timeout: Electron has a default behavior where background windows/tabs can be throttled or terminated after a period of inactivity. ThebackgroundThrottlingsetting controls this.terminal.integrated.persistentSessionReviveProcessand related settings that manage terminal process lifecycle. When a terminal tab is hidden or the window loses focus, VSCode may send SIGTERM to idle processes.Evidence Chain
terminal.integrated.inactiveTimeoutor Electron's background throttling thresholdProposed Fix
Option A: Prevent Host-Initiated Termination (Claude Code Side)
Option B: Host Environment Configuration (User-Facing Workaround)
Document the following workarounds:
VSCode:
Electron Desktop:
Option C: SIGHUP/SIGTERM Resilience with Auto-Recovery
Verification Steps
process.uptime()continues past 300 secondsImpact Assessment
Estimated Value: $3,000–$5,000
I'm having exact same issue
Corroborating this from a different machine — still reproducing as of 2026-06-30, and it is not stale. Same 300s
SessionIdleManagerreaper, but the costly variant: it kills an autonomous/buildorchestrator session and takes its background sub-agents (Task tool /run_in_background) and git worktrees down with it (SIGTERM / exit 143). An orchestrator blocked on its children emits no actionable output, so the idle clock treats it as idle and reaps exactly the longest, most expensive runs.Over 8 days (2026-06-23 → 06-30) on one machine I logged ≥26 reap-and-recover events (counting only deaths that forced an explicit continuation prompt — a floor), including ~8 process deaths in a single overnight build. Quantified the token/compute waste too: a directly-measured re-priming floor of 1.76M tokens/week just to rebuild context in the continuations, and a modelled ~$1.3–2.6K/week of reap-attributable compute for a single developer (reaps also convert cheap cache-reads into 12.5× cache-writes).
Filed a detailed write-up with the full evidence + cost breakdown at #72472. Flagging here so this open issue isn't auto-closed as stale — it's a live, daily, and costly bug.
Clarification on my comment above: the dollar figures (~$1.3–2.6K/week, and all $ in #72472) are computed at published Opus list price, not amounts actually billed — they're a derived, list-price illustration of scale. The token counts are the firm, directly-measured figures; actual cost depends on plan and bundling.
Also reproducing this daily on macOS. Adding my environment details for tracking:
Environment
Symptoms
Claude Code process exited with code 143Ruled out locally
Workaround confirmed
claudein ghostty) does not reproduce the issue, consistent with the original report.