Extension host OOM-crashes within seconds to ~1 min of launching 2+ parallel background Agent subagents (Windows)
Summary
The VS Code extension host reliably OOM-crashes ("Extension host terminated unexpectedly" / auto-restart) within seconds to ~1 minute of launching just 2 parallel background Agent subagents from the Claude Code extension. Three independent mitigation attempts (raising the extension host's V8 heap via argv.json's js-flags, setting NODE_OPTIONS=--max-old-space-size=8192 as a persistent env var, and reducing configured MCP server count/weight) have all been tried and confirmed not to fix it.
Environment
- OS: Windows 11 Pro
- VS Code:
1.141.0(commit2a59476c9bfcb90b3ddc372c36762471b7dfad1c),update.mode: "none"set (ruled out the unrelated auto-updater-cycle crash cause separately) - Claude Code extension:
anthropic.claude-code@2.1.296 - Repro happens whether the Claude Code panel is docked in the sidebar or opened as an editor tab
Reproduction steps
- Open a reasonably large repo (ours: ~a few hundred TS/TSX files across a server, client, and CDK infra package).
- In a single Claude Code conversation, invoke the
Agenttool twice in the same turn (2 parallel background subagents), each given a real, moderately heavy read-only research task (e.g. "audit this feature for consistency" / "survey the codebase for X pattern") - not a trivial one-liner. - Watch
%APPDATA%\Code\logs\<session>\window1\renderer.log.
Expected
Both agents run to completion, or at minimum the extension host survives.
Actual
The extension host (LocalProcess, the process hosting Anthropic.claude-code and all other loaded extensions) terminates unexpectedly within seconds to ~1 minute of launch, every time. VS Code auto-restarts it, but any in-flight background Agent work is lost - on the next turn, those agents come back from ListAgents/task notifications as stopped with no completion record and are not resumable ("No reachable agents").
Two independent reproductions today, same signature both times:
Run 1 (3 configured MCP servers removed beforehand, but at the time of this run, claude.ai Microsoft 365 - 50 tool schemas - was still connected): agents launched 17:19:39; renderer.log:
2026-10-13 17:19:46.827 [error] Extension host (LocalProcess pid: 45560) terminated unexpectedly. The following extensions were running: vscode.github-authentication, ..., Anthropic.claude-code, ...
2026-10-13 17:19:46.827 [info] Automatically restarting the extension host.
~7 seconds from launch to crash - the fastest reproduction we've seen.
Run 2 (after disconnecting the claude.ai Microsoft 365 connector and removing two unused plugins, then a full VS Code quit+relaunch to confirm the removal synced): agents launched 17:35:16.505; renderer.log:
2026-10-13 17:35:59.051 [error] Extension host (LocalProcess pid: 25308) terminated unexpectedly. The following extensions were running: ..., Anthropic.claude-code, ...
2026-10-13 17:35:59.052 [info] Automatically restarting the extension host.
~42.5 seconds from launch to crash, with a much lighter MCP footprint.
An earlier incident the same day reproduced with only 3 parallel agents and a ~1-3 minute delay before crashing (same signature), and a separate incident that day crashed with zero Agent subagents running - only a long-running background Bash task (a Docker build / cdk deploy) - suggesting the trigger may be heavy background work in general, not Agent subagents specifically.
Mitigations tried, all confirmed NOT to fix it
argv.json'sjs-flags: "--max-old-space-size=8192", with a full VS Code quit+relaunch. Confirmed via process inspection (Get-CimInstance Win32_Process) that no running process - including the crashed extension host's own PID - ever carried a--max-old-space-sizeorjs-flagsargument. Root cause: modern VS Code spawns the extension host via Electron's "Utility Process" API (--type=utility --utility-sub-type=node.mojom.NodeService), which does not inheritargv.json'sjs-flagsthe way the older child-process-based extension host model did.NODE_OPTIONS=--max-old-space-size=8192set as a persistent user environment variable (setx, confirmedSUCCESS, confirmed present via[Environment]::GetEnvironmentVariable('NODE_OPTIONS','User')at crash time). Reproduced anyway (Run 1 above).- Reducing configured MCP server count/weight - disconnected the heaviest configured MCP connector (
claude.ai Microsoft 365, 50 tool schemas) and removed two unused plugins, confirmed viaclaude mcp list/claude plugin listafter a full restart that the removal synced. Reproduced anyway (Run 2 above), though slower (42.5s vs 7s) - inconclusive whether MCP weight affects time-to-crash without being the root cause.
Notes
- This is a different, confirmed-separate issue from VS Code's own auto-updater apply/rollback cycle (also observed on this machine the same day, fixed independently via
"update.mode": "none") - the extension host OOM happens with the updater setting already correctly in place. - Each crash is non-catastrophic only because we've adopted a workaround of having every background
Agentsubagent checkpoint findings to a scratch file after each investigation section rather than only in its final report - without that, the crash silently loses all in-progress work with no recovery path, sinceListAgentsshows the stopped agents as unreachable afterward. - Happy to provide the full
renderer.logfiles, or reproduce again with any specific diagnostic flags/instrumentation the team wants.
3 Comments
Update: reproduced a 4th time today, this time after a full VS Code reinstall (not just quit+relaunch) - version went
1.141.0→1.141.1via the reinstall.User-level config (which lives in
%APPDATA%\Code\User/ the registry, separate from the install directory) survived as expected:update.mode: none, theNODE_OPTIONSenv var, andargv.jsonwere all still in place and verified before retesting.Identical repro: 2 parallel background
Agentsubagents launched, extension host terminated unexpectedly ~44 seconds later, auto-restarted, same signature as every prior reproduction (Anthropic.claude-codeamong the extensions listed as running in the crashed process).This rules out a corrupted/stale local install as the explanation - the crash reproduces identically on a completely fresh install of the same VS Code version family. Still no mitigation that's worked from the VS Code/Claude Code side; currently working around it by running heavy multi-agent work from a standalone external terminal instead.
Further update: spent some time trying to isolate whether another installed extension (sharing the same extension-host process) was the actual memory hog rather than Claude Code itself, since the crash log's "terminated unexpectedly" line just lists every extension running in that process, not per-extension memory attribution.
Tried uninstalling the two extensions whose install dates best correlated with "something changed recently" (one installed 4 days before the crashes started). First attempt at testing this was invalid - an uninstall doesn't unload an already-running extension host, so the "removed" extension was still present in that crash's own roster. After a genuine full quit+relaunch, confirmed via
code --list-extensionsthat both candidate extensions were truly gone, then reproduced the identical crash again (~30s after launching 2 parallel background Agent subagents) - and confirmed via that crash's own extension list that neither candidate was present.So: ruling out other installed extensions as the cause. Six reproductions now across every variable tested (MCP server weight, full VS Code reinstall, tab vs. sidebar hosting, and now two individually-removed extensions) - all point back to Claude Code's own parallel-agent memory usage inside the shared extension-host process as the actual trigger, not anything else sharing that process.
Important correction to the framing of this issue (the title says "OOM-crashes," which may not be accurate):
Live-polled the actual extension host process's memory (
Get-Process -Id <pid>, sampled every 1s) through a full reproduction cycle. Memory stayed essentially flat the entire time - ~95MB at launch, creeping only to ~118MB by crash time, no spike, nothing resembling an approach to any memory ceiling.renderer.logrecorded "Extension host (pid: 25372) terminated unexpectedly" at a specific timestamp and immediately started a replacement process - but my poller kept successfully reading that same original PID's stats for ~25 more seconds after that log line, still alive, still flat at ~118MB, before my own background shell got torn down by a larger restart event (unrelated to that specific PID).So the OS process VS Code declared "terminated unexpectedly" was still alive and at completely ordinary memory levels for at least 25 seconds after VS Code gave up on it and spawned a replacement. That doesn't look like an OOM-kill (the OS killing a process that exhausted memory) - it looks like the extension host's IPC/heartbeat connection to the main process hung or timed out, with the actual process lingering afterward unaffected.
Caveat: I only tracked one PID's own WorkingSet64. If Claude Code spawns child processes per background Agent subagent (plausible, I haven't confirmed either way), their memory wouldn't show up in the parent's own reading - so I can't fully rule out memory pressure elsewhere in the process tree. But based on what I actually measured, "OOM" doesn't look like the right mechanism - this looks more like an event-loop block or IPC hang triggered by launching parallel background Agent subagents, not memory exhaustion.