You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
/clear does not terminate previous stdio MCP server child processes (unlike /mcp reload ) #4697
area:mcpMCP server configuration, discovery, connectivity, OAuth, policy, and registryarea:sessionsSession management, resume, history, session picker, and session state
When reloading MCP servers with /mcp reload, the CLI correctly terminates the existing stdio MCP server child process before starting a new one. However, running /clear (start fresh session) spawns a new stdio MCP server process without terminating the previous session's MCP server process, leaking orphaned processes over time.
Steps to reproduce
Start a session with a stdio-based MCP server configured (e.g. a custom *.exe MCP server).
Confirm the server process is running (e.g. via Task Manager / Get-Process).
Run /clear.
Observe: a new instance of the MCP server process starts, but the previous one is still running.
Repeat /clear multiple times — orphaned process count grows unbounded.
Contrast with /mcp reload, which correctly stops the old process before starting the new one.
Expected behavior
/clear should terminate/clean up MCP server child processes from the previous session (or reuse them) before/while starting the new session's servers, matching the behavior of /mcp reload.
Actual behavior
Old MCP stdio server processes are left running indefinitely after /clear, accumulating over repeated use (observed 22+ orphaned exe instances in one session).
Thanks for the report. This has the same root cause as #4049: a new session from /clear or /new starts its own MCP host while the previous session's host and its stdio processes stay alive. We'll track it there, so I'm closing this one as a duplicate.
area:mcpMCP server configuration, discovery, connectivity, OAuth, policy, and registryarea:sessionsSession management, resume, history, session picker, and session state
Activity
hstaudacher commentedon Nov 18, 2026
Thanks for the report. This has the same root cause as #4049: a new session from
/clearor/newstarts its own MCP host while the previous session's host and its stdio processes stay alive. We'll track it there, so I'm closing this one as a duplicate.robgurr commentedon Nov 18, 2026
Sounds good (thanks for the update).