[BUG] Session process restarts orphaning background tasks + lost tool results + MCP disconnect cycles

Status Open
Reported on v2.1.220
Maintainer reply None cached
Activity 0 comments · opened Aug 9, 2026

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?

During long sessions (several hours) with heavy background-task usage, the session
process restarts on its own, with three related symptoms:

  1. SESSION RESTARTS ORPHANING BACKGROUND TASKS — at least 3 occurrences

(Aug 7 ~22:00 BRT; Aug 9 ~00:20 and ~01:00 BRT). After the restart, every running
background task is dead and later notifications report: "No completion record was
found for this background shell command from the previous session… it may have been
running when the previous Claude Code process exited" (some carry __orphan_summary__
markers). Affected: persistent device-log monitors (idevicesyslog), flutter run
benches, emulator boot watchers — all silently killed.

  1. TOOL RESULTS LOST TO INTERNAL ERROR — at least 2 occurrences (Aug 7 and Aug 9).

A tool call returns "[Tool result missing due to internal error]"; retrying the
identical call succeeds. This left a Monitor in an unknown armed/not-armed state.

  1. MCP SERVERS DISCONNECT/RECONNECT MID-CONVERSATION — multiple times on Aug 9:

~39 deferred MCP tools became unavailable ("MCP server disconnected") and returned
minutes later, repeatedly, without user action.

IMPACT: long-running monitors die without firing (silence is indistinguishable from
"nothing happened"); work state must be rebuilt after each restart; lost tool results
interrupt time-sensitive workflows.

Ruled out: permission-classifier denials and 120s foreground timeouts (expected
behavior, not part of this report).

What Should Happen?

Background tasks and monitors should survive for the whole session (or until their
timeout), the session process should not restart on its own, tool calls should always
return a result, and MCP servers should stay connected.

Error Messages/Logs

No completion record was found for this background shell command from the previous
session. It may have been stopped (via the UI, Monitor timeout, or agent teardown —
these leave no transcript marker), or it may have been running when the previous
Claude Code process exited.

[Tool result missing due to internal error]

MCP server disconnected (~39 deferred tools unavailable, then reconnected minutes later)

Steps to Reproduce

  1. Start a desktop-app session and work for several hours continuously.
  2. Launch multiple background tasks: Bash with run_in_background (long-running

watchers, e.g. log tails), and persistent Monitor tasks.

  1. Keep MCP servers active in the session.
  2. Continue normal work — no specific user action triggers it.
  3. Eventually the session process restarts spontaneously: background tasks are

orphaned ("no completion record"), an occasional tool call loses its result
("[Tool result missing due to internal error]"), and MCP servers cycle
disconnect/reconnect.

Claude Model

Other

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.220 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Other

Additional Information

Running in the Claude Code desktop app (not a terminal). Hardware: Apple M5, 16 GB RAM,
Darwin 25.6.0 (macOS 26.5). Sessions are long (multiple hours) and MCP-heavy.

The three symptoms recur across multiple days (Aug 7 and Aug 9, 2026) and appear
linked to session longevity / background-task load rather than any single command.
The orphaned-task notifications and the "[Tool result missing due to internal error]"
message are the app's own wording, quoted verbatim above.

View original on GitHub ↗