[BUG] Claude Desktop: MCP plugin subprocesses survive app quit (orphan process leak, macOS)

Status Open
Maintainer reply None cached
Activity 0 comments · opened Aug 2, 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?

<html><head></head><body><h1>Claude Desktop: MCP plugin subprocesses survive app quit (orphan process leak, macOS)</h1>
<h2>Summary</h2>
<p>When Claude Desktop is quit, Bun subprocesses spawned for local MCP plugins are not
terminated. They are reparented to launchd (PPID 1) and continue running indefinitely,
consuming CPU. Killing them requires manual intervention from a terminal.</p>
<h2>Environment</h2>
<ul>
<li>OS: macOS &lt;!-- FILL IN: version, e.g. 15.3 --&gt;</li>
<li>Claude Desktop version: &lt;!-- FILL IN: Claude &gt; About Claude --&gt;</li>
<li>Runtime: Bun</li>
<li>Plugin directory: <code>/Users/&lt;user&gt;/.claude/plugins/</code></li>
<li>Plugins installed: <code>telegram</code>, <code>fakechat</code> (locally installed, not bundled)</li>
</ul>
<h2>Steps to reproduce</h2>
<ol>
<li>Install a local MCP plugin whose server runs under Bun (observed with the <code>telegram</code>
and <code>fakechat</code> plugins in <code>~/.claude/plugins/</code>).</li>
<li>Launch Claude Desktop and allow the plugin servers to start.</li>
<li>Fully quit the app — Claude &gt; Quit Claude, or Cmd+Q (not just closing the window).</li>
<li>In a terminal, run <code>ps -ef | grep bun</code>.</li>
</ol>
<h2>Expected behavior</h2>
<p>Quitting the app sends SIGTERM to each spawned plugin subprocess and reaps it. No Bun
processes belonging to Claude remain after exit.</p>
<h2>Actual behavior</h2>
<p>The Bun processes are still running. Observed state:</p>

PID | Role
-- | --
19864 | telegram plugin
19866 | telegram plugin server (server.ts)
60028 | fakechat plugin

<p>PID 19866 had accumulated <strong>over 34 minutes of CPU time</strong> since 5:37 PM, and was still
running after the app was quit. At least one Bun process in the <code>ps</code> output showed PPID 1,
confirming reparenting to launchd.</p>
<p>Only <code>killall -9 bun</code> cleared them.</p>
<h2>Impact</h2>
<ul>
<li>Sustained high CPU and fan noise with no visible application running.</li>
<li>The cause is not discoverable from the UI — the app appears closed.</li>
<li>Processes accumulate across app restarts, so repeated launch/quit cycles compound the load.</li>
</ul>
<h2>Notes / open questions</h2>
<ul>
<li>Two distinct issues may be in play. The <strong>failure to reap children on exit</strong> is the
Desktop bug reported here. The fact that one server burned 34 minutes of CPU while
nominally idle may be a separate defect in the plugin itself (tight polling or retry
loop) — being reported separately to the plugin author.</li>
<li>A possibly related report exists for Claude Code on Windows: "[Windows] Bun console
window..." (GitHub, Jan 2026).</li>
</ul>
<h2>Supporting output</h2>
&lt;!-- Paste the output of the following, captured while the orphaned processes are alive: --&gt;
<pre><code>ps -ef | grep bun
ps -p &lt;PID&gt; -o ppid=,lstart=,etime=,time=,command=
</code></pre></body></html>

What Should Happen?

Quitting Claude Desktop should terminate the MCP plugin subprocesses it spawned. On quit, the app should send SIGTERM to each child process and reap it, so no Bun processes belonging to Claude remain running afterward. Currently they survive the quit, get reparented to launchd, and keep consuming CPU until killed manually from a terminal.

Error Messages/Logs

Steps to Reproduce

<ol>
<li>Install a local MCP plugin whose server runs under Bun (observed with the <code>telegram</code>
and <code>fakechat</code> plugins in <code>~/.claude/plugins/</code>).</li>
<li>Launch Claude Desktop and allow the plugin servers to start.</li>
<li>Fully quit the app — Claude &gt; Quit Claude, or Cmd+Q (not just closing the window).</li>
<li>In a terminal, run <code>ps -ef | grep bun</code>.</li>
</ol>

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

Claude 1.24012.9 (03c61d) 2026-07-24T04:59:17.000Z

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Other

Additional Information

_No response_

View original on GitHub ↗