Diagnosing and Fixing 'Extension Host Terminated Unexpectedly' in VS Code
Learn how to diagnose and resolve 'Extension Host Terminated Unexpectedly' errors in VS Code using Process Explorer, Extension Bisect, and host logs.
15 Dec 2025, 08:43 UTC

The Problem: Extension Host Crashes
When you see the notification "Extension Host Terminated Unexpectedly", your editor's UI remains responsive, but all extension-driven functionality—such as IntelliSense, git integration, and language formatting—stops working. This happens because VS Code runs extensions in a separate process (the Extension Host) to ensure that a buggy plugin cannot freeze the entire application window.
The primary takeaway: This is rarely a bug in VS Code itself and almost always a result of a specific extension exhausting system resources or triggering a fatal process error.
Quick Diagnostic Reference
| Symptom | Likely Cause | Primary Diagnostic Tool |
|---|---|---|
| Gradual slowdown followed by crash | Memory leak in a language server | Process Explorer |
| Crash immediately upon opening a large folder | Indexing loop or recursive file scan | Log (Extension Host) |
| Intermittent crashes during typing | Buffer conflict between two extensions | Extension Bisect |
Step-by-Step Resolution Path
1. Identify the Resource Culprit
Before disabling plugins, determine if the crash is caused by memory exhaustion or a logic error. Open the integrated Process Explorer to see real-time resource consumption.
- Navigate to Help > Open Process Explorer.
- Look for the
extensionHostprocess. - Observation: If the memory usage for the host process climbs steadily without plateauing, a specific extension is leaking memory. If CPU spikes to 100% and stays there, an extension is likely stuck in an infinite loop.
2. Analyze the Host Logs
The Extension Host maintains a dedicated log that captures stack traces immediately preceding a crash.
- Open the Output panel (
Ctrl+Shift+UorCmd+Shift+U). - Select Log (Extension Host) from the dropdown menu on the right.
- Search for keywords like
FATAL ERROR,Out of Memory, or specific extension IDs (e.g.,vscode.typescript-language-features).
3. Isolate the Failing Extension
Manually disabling extensions is inefficient. Use the built-in Extension Bisect tool, which uses a binary search algorithm to find the problematic plugin.
- Open the Command Palette (
Ctrl+Shift+PorCmd+Shift+P). - Run
Developer: Start Extension Bisect. - VS Code will disable half of your extensions. It will then ask if the issue still occurs.
- Follow the prompts to narrow down the list until the single offending extension is identified.
Fixes Based on Findings
Scenario A: High Latency/CPU in a Specific Plugin
If Developer: Show Running Extensions reveals a plugin with high activation time or constant lag, check for workspace-specific settings that might be triggering excessive indexing.
Action: Add large data folders or build artifacts to your files.exclude or search.exclude settings in settings.json to prevent the extension from scanning them.
Scenario B: Out of Memory (OOM) Crashes
If the logs explicitly mention memory limits, you can increase the memory allocated to the extension host via the command line. Note that this is a workaround, not a permanent fix for a leak.
Command (Run from Terminal):
code --max-memory=4096
Note: Replace 4096 with the desired MB of RAM. This requires the code CLI to be installed in your PATH.
Scenario C: Conflict Between Two Extensions
If the crash only happens when two specific extensions (e.g., two different Prettier/Linting plugins) are active, they may be fighting for control over the same document buffer.
Action: Disable one of the conflicting plugins or configure their enabled settings to apply only to specific languages.
Verification and Limitations
To verify the fix, restart VS Code and monitor the Process Explorer for 10 minutes while performing the task that previously triggered the crash. If the memory usage remains stable and the Log (Extension Host) remains clear of fatal errors, the issue is resolved.
Limitations: Extension Bisect may not find the cause if the crash requires a very specific sequence of events or a specific combination of three or more plugins. In these rare cases, you must rely on the stack traces in the Host Log to report the bug to the extension maintainer.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.