What version of the Codex App are you using (From “About Codex” dialog)?
26.313.41514 Codex build: 1043
What subscription do you have?
Pro
What platform is your computer?
macOS: 26.3.1 (25D2128) - Hardware: Apple M2 Max - RAM: 64 GB
What issue are you seeing?
Codex appears to leave behind stale MCP helper process trees from older sessions. Over time these accumulate and cause large CPU/RAM spikes.
The recurring offenders on my machine are mostly:
node ... xcodebuildmcp mcp
node ... apple-docs-mcp
- orphaned
npm exec ... parents for those helpers
I have seen this happen repeatedly across multiple days. The stale processes are not descendants of the current live Codex app session.
I also observed the same pattern on an earlier Codex version:
- Codex version seen on earlier incidents:
26.305.950
Actual behavior
After using Codex with MCP-backed tooling and then closing/restarting/abandoning sessions, old helper trees remain running in the background.
Over time this leads to many node processes consuming large amounts of RAM and CPU.
What steps can reproduce the bug?
I do not have a minimal deterministic repro yet, but the issue happens repeatedly after normal Codex use with MCP-backed tools over multiple sessions/days.
My rough repro pattern is:
- Use Codex with MCP-backed tools, especially Xcode-related flows.
- Close Codex, restart it, or leave/abandon sessions.
- Repeat over time.
- Observe many lingering
node helpers from older sessions.
- Activity Monitor shows a large number of
node processes and high RAM/CPU usage.
Examples I captured:
March 10, 2026
28 stale xcodebuildmcp helpers
- about
12.4 GB RAM used by those stale helpers
March 11, 2026
49 stale xcodebuildmcp helpers
- about
15.45 GB RAM
100 stale apple-docs-mcp helpers
- about
1.44 GB RAM
March 17, 2026
26 stale xcodebuildmcp helpers
- about
11.69 GB RAM
66 stale apple-docs-mcp helpers
- about
2.72 GB RAM
On March 17, system free memory was around 32% before cleanup and returned to 86% after killing only the stale Codex helper trees.
What is the expected behavior?
Expected behavior
When Codex closes, crashes, or abandons a session, its MCP helper process trees should be cleaned up automatically.
At minimum:
- old MCP helper trees should not survive indefinitely
- a new Codex session should not leave old helper trees detached
- helpers should be tied to the current live Codex app/app-server lifecycle
Additional information
The stale processes were not part of the current live Codex process tree. I had to do tree-aware cleanup to avoid killing the current active Codex helpers.
This seems broader than only XcodeBuildMCP. I also saw the same stale-process pattern with apple-docs-mcp.
If useful, I can also provide:
- Activity Monitor screenshots
- sanitized
ps output
- the cleanup script I used to identify stale helpers while preserving the current live Codex session
What version of the Codex App are you using (From “About Codex” dialog)?
26.313.41514 Codex build:
1043What subscription do you have?
Pro
What platform is your computer?
macOS:
26.3.1 (25D2128)- Hardware:Apple M2 Max- RAM:64 GBWhat issue are you seeing?
Codex appears to leave behind stale MCP helper process trees from older sessions. Over time these accumulate and cause large CPU/RAM spikes.
The recurring offenders on my machine are mostly:
node ... xcodebuildmcp mcpnode ... apple-docs-mcpnpm exec ...parents for those helpersI have seen this happen repeatedly across multiple days. The stale processes are not descendants of the current live Codex app session.
I also observed the same pattern on an earlier Codex version:
26.305.950Actual behavior
After using Codex with MCP-backed tooling and then closing/restarting/abandoning sessions, old helper trees remain running in the background.
Over time this leads to many
nodeprocesses consuming large amounts of RAM and CPU.What steps can reproduce the bug?
I do not have a minimal deterministic repro yet, but the issue happens repeatedly after normal Codex use with MCP-backed tools over multiple sessions/days.
My rough repro pattern is:
nodehelpers from older sessions.nodeprocesses and high RAM/CPU usage.Examples I captured:
March 10, 2026
28stalexcodebuildmcphelpers12.4 GBRAM used by those stale helpersMarch 11, 2026
49stalexcodebuildmcphelpers15.45 GBRAM100staleapple-docs-mcphelpers1.44 GBRAMMarch 17, 2026
26stalexcodebuildmcphelpers11.69 GBRAM66staleapple-docs-mcphelpers2.72 GBRAMOn March 17, system free memory was around
32%before cleanup and returned to86%after killing only the stale Codex helper trees.What is the expected behavior?
Expected behavior
When Codex closes, crashes, or abandons a session, its MCP helper process trees should be cleaned up automatically.
At minimum:
Additional information
The stale processes were not part of the current live Codex process tree. I had to do tree-aware cleanup to avoid killing the current active Codex helpers.
This seems broader than only XcodeBuildMCP. I also saw the same stale-process pattern with
apple-docs-mcp.If useful, I can also provide:
psoutput