claude-code - 💡(How to fix) Fix [BUG] Frequent session freezes / connection drops on Claude Code (VS Code extension) under

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Sessions freeze / hang very frequently during normal use. The UI appears to stall mid-turn, and in some cases the underlying connection drops with a "socket closed" type error. This happens multiple times within a single working session, sometimes seconds apart, badly disrupting the workflow.

Error Message

"socket closed" type error. This happens multiple times within a single "socket closed" type error. This happens multiple times within a single

Error Messages/Logs

Root Cause

Sessions freeze / hang very frequently during normal use. The UI appears to stall mid-turn, and in some cases the underlying connection drops with a "socket closed" type error. This happens multiple times within a single working session, sometimes seconds apart, badly disrupting the workflow.

Fix Action

Fix / Workaround

Notes / mitigations tried

  • WSL "mirrored" networking mode is NOT a viable workaround: enabling it broke the WSL environment entirely, so it had to be reverted. Please do not suggest mirrored mode as a fix.
  • Tuning keepalive-related environment variables in ~/.claude/settings.json was attempted as a mitigation, with limited effect.

Notes / mitigations tried

  • WSL "mirrored" networking mode is NOT a viable workaround: enabling it broke the WSL environment entirely, so it had to be reverted. Please do not suggest mirrored mode as a fix.
  • Tuning keepalive-related environment variables in ~/.claude/settings.json was attempted as a mitigation, with limited effect.
RAW_BUFFERClick to expand / collapse

Preflight Checklist

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

What's Wrong?

Title: Frequent session freezes / connection drops on Claude Code (VS Code extension) under WSL2

Versions

  • Claude Code CLI: 2.1.150
  • Surface: VS Code native extension (vscode-server / WSL remote)
  • Model: Opus 4.8 (1M context) — claude-opus-4-8[1m]
  • Node: v22.18.0
  • npm: 10.9.3
  • Bun: bundled inside the CLI (not on PATH)
  • WSL: 2.7.3.0
  • WSL kernel: 6.6.114.1-microsoft-standard-WSL2 (x86_64)
  • WSLg: 1.0.73 | MSRDC: 1.2.6676 | Direct3D: 1.611.1-81528511
  • Distro: Ubuntu 22.04.5 LTS
  • Windows: 10.0.26200.7840
  • WSL networking: NAT mode (mirrored mode is NOT usable — see notes)

Summary

Sessions freeze / hang very frequently during normal use. The UI appears to stall mid-turn, and in some cases the underlying connection drops with a "socket closed" type error. This happens multiple times within a single working session, sometimes seconds apart, badly disrupting the workflow.

Frequency

Very high — repeated stalls within the same session, multiple times per hour.

Suspected cause

Appears related to the keepalive / socket handling of the underlying runtime (Bun) when running through the WSL2 networking stack. Long-lived connections seem to drop unexpectedly.

Expected behavior

Sessions should stay responsive and connections stable across a normal working session in WSL2, without repeated freezes or dropped sockets.

Actual behavior

The session freezes repeatedly; work is interrupted and has to be resumed, sometimes losing the in-progress turn.

Notes / mitigations tried

  • WSL "mirrored" networking mode is NOT a viable workaround: enabling it broke the WSL environment entirely, so it had to be reverted. Please do not suggest mirrored mode as a fix.
  • Tuning keepalive-related environment variables in ~/.claude/settings.json was attempted as a mitigation, with limited effect.

Impact

Severe day-to-day productivity impact. Requesting prioritization for WSL2 stability.

What Should Happen?

Title: Frequent session freezes / connection drops on Claude Code (VS Code extension) under WSL2

Versions

  • Claude Code CLI: 2.1.150
  • Surface: VS Code native extension (vscode-server / WSL remote)
  • Model: Opus 4.8 (1M context) — claude-opus-4-8[1m]
  • Node: v22.18.0
  • npm: 10.9.3
  • Bun: bundled inside the CLI (not on PATH)
  • WSL: 2.7.3.0
  • WSL kernel: 6.6.114.1-microsoft-standard-WSL2 (x86_64)
  • WSLg: 1.0.73 | MSRDC: 1.2.6676 | Direct3D: 1.611.1-81528511
  • Distro: Ubuntu 22.04.5 LTS
  • Windows: 10.0.26200.7840
  • WSL networking: NAT mode (mirrored mode is NOT usable — see notes)

Summary

Sessions freeze / hang very frequently during normal use. The UI appears to stall mid-turn, and in some cases the underlying connection drops with a "socket closed" type error. This happens multiple times within a single working session, sometimes seconds apart, badly disrupting the workflow.

Frequency

Very high — repeated stalls within the same session, multiple times per hour.

Suspected cause

Appears related to the keepalive / socket handling of the underlying runtime (Bun) when running through the WSL2 networking stack. Long-lived connections seem to drop unexpectedly.

Expected behavior

Sessions should stay responsive and connections stable across a normal working session in WSL2, without repeated freezes or dropped sockets.

Actual behavior

The session freezes repeatedly; work is interrupted and has to be resumed, sometimes losing the in-progress turn.

Notes / mitigations tried

  • WSL "mirrored" networking mode is NOT a viable workaround: enabling it broke the WSL environment entirely, so it had to be reverted. Please do not suggest mirrored mode as a fix.
  • Tuning keepalive-related environment variables in ~/.claude/settings.json was attempted as a mitigation, with limited effect.

Impact

Severe day-to-day productivity impact. Requesting prioritization for WSL2 stability.

Error Messages/Logs

Steps to Reproduce

Just try to use Claude for 2 minutes!!!!!

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

2.1.150 (Claude Code)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

WSL (Windows Subsystem for Linux)

Additional Information

No response

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

Sessions should stay responsive and connections stable across a normal working session in WSL2, without repeated freezes or dropped sockets.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING