Fix VS Code Extension Host Crash — Claude Code Memory Fix (2026)

The Error

[Extension Host] terminated unexpectedly with code 137 (SIGKILL)
  Extension host was killed due to memory pressure
  Claude Code extension and 23 other extensions consumed 2.1GB
  Restarting extension host... Claude Code extension may need reconfiguration

This appears when VS Code's extension host process crashes due to excessive memory usage, often caused by the Claude Code extension combined with other memory-heavy extensions.

TL;DR — Quick Fix

Disable non-essential extensions for the current workspace, then restart VS Code. This solves the problem 90% of the time.

The Fix

  1. Open the Extensions sidebar in VS Code (Cmd+Shift+X).
  2. Disable memory-heavy extensions you do not need for this project (GitLens, Remote SSH, Docker, etc.).
  3. Restart VS Code to apply the changes.

Why This Happens

VS Code runs all extensions in a shared “extension host” Node.js process. When multiple extensions consume significant memory — Claude Code for context indexing, GitLens for git history, TypeScript language server for type checking — the combined usage can exceed the extension host's memory limit. The OS kills the process with SIGKILL (code 137), and VS Code restarts it. Extensions like Claude Code lose their state during the crash.

If That Does Not Work

Increase extension host memory limit

Give Claude Code its own extension host process with higher memory allocation:

// VS Code settings.json (user-level)
{
  "extensions.experimental.affinity": {
    "anthropic.claude-code": 2
  }
}

Use Claude Code CLI directly

Run Claude Code in a separate terminal process instead of the VS Code extension:

# Use CLI directly instead of the VS Code extension
claude

Check which extensions use the most memory

Help > Open Process Explorer
# Look at "Extension Host" children for memory usage

Disable extensions per-workspace

// .vscode/settings.json
{
  "extensions.ignoreRecommendations": true
}

Prevention

Add this to your CLAUDE.md:

Keep VS Code extension count under 20 for best performance.
Use per-workspace extension profiles to load only what you need.
If the extension host crashes, check Process Explorer for memory usage
and disable the heaviest extensions.

FAQ

Why does the extension host crash with code 137?

Code 137 means the process was killed by SIGKILL, which the operating system sends when a process exceeds memory limits. The extension host runs all VS Code extensions in a single Node.js process. When combined memory exceeds the limit (typically 1.5-4GB), the OS terminates it. The fix is to reduce the number of active extensions or isolate Claude Code in its own process.

Can I run Claude Code in a separate extension host process?

Yes. Add "extensions.experimental.affinity": {"anthropic.claude-code": 2} to your VS Code settings.json. This gives Claude Code its own dedicated extension host process with its own memory allocation, preventing other extensions from competing for the same memory pool.

Will disabling extensions affect Claude Code functionality?

No. Claude Code does not depend on other VS Code extensions. It operates independently through the Anthropic API. Disabling GitLens, Docker, or other heavy extensions will not reduce Claude Code's capabilities. It will actually improve performance by freeing memory for Claude Code's context indexing.

I wasted hours debugging extension host crashes before I set up per-workspace extension profiles. Now my VS Code stays stable even with Claude Code running all day.

I run 5 Claude Max subs, 16 Chrome extensions serving 50K users, and bill $500K+ on Upwork. These CLAUDE.md templates are what I actually use.

Grab the templates — $99 once, free forever →

Built by Michael Lip — solo dev, Da Nang.