Extension host memory leak in Remote-WSL leads to renderer OOM crash

Resolved 💬 1 comment Opened Jun 2, 2026 by webshaker Closed Jul 6, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

What happened

When using the Claude Code VS Code extension in a Remote-WSL2 workspace (Ubuntu) on Windows, the extension host process on the WSL side grows continuously and never releases memory.

Observed in VS Code's Process Explorer: the WSL extension-host climbed steadily from ~300 MB to 2.8 GB and kept rising during a normal Claude Code session, increasing slowly and linearly over time.

After ~11 minutes, the Windows-side renderer crashes. From main.log:

What Should Happen?

The extension host memory usage should stay bounded during a session and be released over time (e.g. when sessions are closed), instead of growing continuously. It should not climb to several GB and eventually cause the renderer process to crash with an out-of-memory error.

Error Messages/Logs

Steps to Reproduce

[error] CodeWindow: renderer process gone (reason: oom, code: -536870904)
[info] Extension host with pid 25288 exited with code: 0, signal: unknown.

The Windows-side renderer (window process) itself stays small (~435 MB) — the memory growth is entirely in the WSL extension-host.

Steps to reproduce

  1. Open a Remote-WSL2 workspace (Ubuntu) in VS Code on Windows.
  2. Use Claude Code normally.
  3. Watch the WSL extension-host in Process Explorer (Developer: Open Process Explorer) — memory grows continuously and is never released.
  4. After ~11 minutes the renderer crashes with reason: oom.

Expected behaviour

Extension host memory should stay bounded during a session.

Workaround

Running Reload Window resets the extension host memory, but the leak returns and the process starts growing again.

Environment

  • VS Code Remote-WSL, Ubuntu (WSL2) on Windows
  • Host: 47 GB RAM — no system-level OOM (dmesg and journalctl -k show no OOM killer, free -h shows 42 GB free)
  • Claude Code CLI version: 2.1.160
  • Claude Code VS Code extension version: 2.1.160
  • Relevant settings: claudeCode.preferredLocation: panel, claudeCode.useTerminal: true

main.log

<img width="1231" height="980" alt="Image" src="https://github.com/user-attachments/assets/96ff9057-de1b-4352-81ce-e8561ffc74aa" />

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.160

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗