Extension host memory leak in Remote-WSL leads to renderer OOM crash
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
- Open a Remote-WSL2 workspace (Ubuntu) in VS Code on Windows.
- Use Claude Code normally.
- Watch the WSL
extension-hostin Process Explorer (Developer: Open Process Explorer) — memory grows continuously and is never released. - 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 (
dmesgandjournalctl -kshow no OOM killer,free -hshows 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
<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_
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗