claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[Bug] Claude Code freezes intermittently on Windows Terminal

Open isaac-bender opened this issue 1 year ago • 8 comments

Bug Description I'm running Claude Code in Windows Terminal. Recently, it's been freezing for several seconds at a time. It seems to have started happening within the past few days. I tried removing everything in the cache older than a couple of days and it didn't seem to help. I've added my project dir and claude's cache dir to antivirus exceptions, rebooted, /cleared, tried all the obvious stuff.

Environment Info

  • Platform: win32
  • Terminal: windows-terminal
  • Version: 2.0.50
  • Feedback ID: 9e22e670-4bfe-4ea9-9e68-9956e06aa8b8

Errors

[]

isaac-bender avatar Nov 24 '25 05:11 isaac-bender

2.0.50 is very buggy, causing lag and it seems to edit entire file instead of targeted edits. Multiple bugs were reported on this.

So the workaround is to rollback to 2.0.49

Steps:

  1. Windows Search for: Edit the System Environment variables -> Environment Variables -> New system variable -> name: DISABLE_AUTOUPDATER value: 1.

  2. npm install -g @anthropic-ai/[email protected]

Image

dmm-l-mediehus avatar Nov 24 '25 11:11 dmm-l-mediehus

I am in version 2.0.53

I am having a similar problem. Claude will freeze in thinking mode for several minutes or hours when.

  1. I do not enter anything into the keyboard for a long time.
  2. Change focus outside of terminal.

It does not come out of this mode until I reestablish windows focus and hit a key on the keyboard.

This happens multiple times a day. I have had it happen on both Opus and Sonnet

Environment Platform: win64 10 22H2 Memory 32GB Memory Processor: Intel i7-7700 4.2G/Hz Terminal: windows-terminal Version: 2.0.50

archserver avatar Nov 25 '25 04:11 archserver

I am in version 2.0.53

I am having a similar problem. Claude will freeze in thinking mode for several minutes or hours when.

  1. I do not enter anything into the keyboard for a long time.
  2. Change focus outside of terminal.

It does not come out of this mode until I reestablish windows focus and hit a key on the keyboard.

This happens multiple times a day. I have had it happen on both Opus and Sonnet

Environment Platform: win64 10 22H2 Memory 32GB Memory Processor: Intel i7-7700 4.2G/Hz Terminal: windows-terminal Version: 2.0.50

You said you were in 2.0.53, but your last line mentions 2.0.50. Check it up again

dmm-l-mediehus avatar Nov 25 '25 08:11 dmm-l-mediehus

Same, on a Mac running inside a Jetbrains IDE terminal window. The animations stop, everything stops.. Just for a few seconds. But every few seconds.

npomfret avatar Nov 25 '25 11:11 npomfret

Same here on Windows 10 using claude-code 2.0.47-2.0.53, but only when using WSL. Powershell or CMD have these periodic freezes for some reason.

From what I can see it shouldn't be related to the terminal, but instead to the shell or something else. Getting same results for all 3 shells using both Windows Terminal and ConEmu (via Cmder), and others have the problem on Mac -> bash/sh being the common denominator?

Additionally, observed that when I start claude and begin typing, then as soon as it freezes, a python process will jump to the top in my CPU sorted taskmanager. If I keep typing, the freezing will however resolve and seem to fully stop after about ~30 seconds.

For the time being I just use CMD, check the difference compared to WSL here: (edit: saw it too late, but enabling thinking in CMD makes no difference) Image

JulianVallee avatar Nov 25 '25 17:11 JulianVallee

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

github-actions[bot] avatar Dec 26 '25 10:12 github-actions[bot]

This still happens

JanWerder avatar Dec 26 '25 12:12 JanWerder

I am getting this issue on WSL and native. Using a Snapdragon X Elite X1E78100 with claude code version 2.1.7

Badbird5907 avatar Jan 14 '26 21:01 Badbird5907

Major input lag and cancel freezing. I noticed I can repro the lag every time when I ESC a working response, even on a clean chat.

  • Windows dominates Mac by about 75% for coding; I get that Anthropic favors Mac, but this should get more attention for the overwhelming majority of folks using Windows (likely using Windows Terminal)
  • Works fine with wsl and pwsh7 standalone terminals

dylanh724 avatar Jan 21 '26 07:01 dylanh724

Actually... I'm also now experiencing this on Wezterm. I'm starting to wonder if it's the binary version. When I first started (on node version), I didn't get this for months.

dylanh724 avatar Jan 21 '26 08:01 dylanh724

So I noticed this the moment I migrated to the new "native" binary version, prior to that things worked fine

wackoisgod avatar Feb 02 '26 10:02 wackoisgod

So I noticed this the moment I migrated to the new "native" binary version, prior to that things worked fine

Me too. But when I went back to npm, the issue persisted. I wonder if it's the middle are that allowed for either lib to work that caused it.

dylanh724 avatar Feb 02 '26 13:02 dylanh724

Still Happening — Feb 10, 2026 (Bun Canary v1.3.9-canary.51)

This is still actively occurring on the latest build. Adding my reproduction data from #21576 and #21266 to consolidate the trail.

Environment: Windows 11, PowerShell, Bun Canary v1.3.9-canary.51 (d5628db2), Opus 4.6

My Reproduction Pattern (4 occurrences since Jan 27)

Every instance involves either long-running sub-agent tasks or shell-invoking commands (gh). The TUI silently drops back to the raw PowerShell prompt — no crash, no error, just gone. Sub-agent output is lost.

Latest repro (today): 3 parallel sub-agents running verification gates (~11 minutes in). CC dropped to PS prompt mid-execution. All sub-agent results lost.

Previous repros:

  • 54-minute task — garbled escape sequences ([0[I) leaked into PS prompt
  • After gh commands — input captured by PowerShell instead of CC
  • During task list rendering — focus loss, menu unresponsive

Confirming Community Pattern

Agree with @dylanh724 and @wackoisgod that this correlates with the Bun binary migration. The terminal control handoff during long subprocess execution seems to be the weak point — CC delegates to a child process and never reclaims stdin/stdout.

Related issues: #21576, #21266, #18109

ThatDragonOverThere avatar Feb 10 '26 16:02 ThatDragonOverThere

5th Reproduction — Feb 19, 2026: New Pattern — Context Pressure Trigger

Dropped to PowerShell again, this time with an interesting new data point: context was at 2% remaining when it happened.

Two parallel sub-agents were active (one just completed, one still running edits). The TUI vanished mid-execution — active agent's work lost. No crash, no error.

This suggests the terminal escape may be triggered by auto-compaction firing during active sub-agent execution, not just long task duration. The compaction mechanism may be killing the TUI's terminal control while sub-agents are still holding stdin/stdout.

Details in #21576 (5th repro). Still no official response on any of the Windows TUI issues.

ThatDragonOverThere avatar Feb 19 '26 21:02 ThatDragonOverThere

Do you guys have lingering disabled MCP added? All of you? @ThatDragonOverThere , @wackoisgod , @Badbird5907 , @JanWerder @JulianVallee , @npomfret , @dmm-l-mediehus , etc?

Turns out that disabled MCP is still infinite-loop checked and, if logged out or disconnected (again - even if disabled), it'll check every single character typed (and even longer on ESC).

Still testing, but so far my input lag is gone on Windows 11 (wsl, pwsh, windows terminal)

EDIT: Anthropic needs to respect the disabled mcp options

EDIT 2: Ah, it was working for an entire hour without input lag - alas, it's back, apologies for the pings

dylanh724 avatar Feb 20 '26 06:02 dylanh724

Do you guys have lingering disabled MCP added? All of you? @ThatDragonOverThere , @wackoisgod , @Badbird5907 , @JanWerder @JulianVallee , @npomfret , @dmm-l-mediehus , etc?

Turns out that disabled MCP is still infinite-loop checked and, if logged out or disconnected (again - even if disabled), it'll check every single character typed (and even longer on ESC).

Still testing, but so far my input lag is gone on Windows 11 (wsl, pwsh, windows terminal)

EDIT: Anthropic needs to respect the disabled mcp options - seems like we're affected by this bug. If disabled, why even check if it's still connected - or dig into it at all?

No, I am using a clean install of cc.

Badbird5907 avatar Feb 20 '26 06:02 Badbird5907

Does anyone have the capability to rename the title to [Bug] Claude Code freezes intermittently in Win11/wsl? It's not just Windows Terminal.

dylanh724 avatar Feb 20 '26 07:02 dylanh724

6th Personal Reproduction — Feb 21, 2026

Another drop to PowerShell. This time during a bash command that was actively executing (python column analysis, ~3s in). Claude had been whirlpooling for ~14 minutes. TUI just vanished — running command output lost, session dead.

That's 6 reproductions in 3 weeks. Roughly daily. Still zero Anthropic response on any of the Windows TUI issues (#21576, #21266, #18109, this one).

Details in #21576 (latest comment).

ThatDragonOverThere avatar Feb 22 '26 00:02 ThatDragonOverThere

SEVERITY ESCALATION — Feb 21, 2026: 3 escapes in one session → COMPUTER CRASHED

Three PowerShell escape events in rapid succession today, followed by a full system crash requiring hard reboot.

Hypothesis: Each TUI escape leaves orphaned processes (Bun runtime, sub-agents, bash children) running in the background. Three orphaned process trees in one session likely exhausted system resources (32 GB RAM machine running ML pipelines).

This is now 9 personal reproductions in 24 days. The bug is accelerating — went from ~weekly to 3x in a single session. Combined with the autonomous file deletion (#27507) and permission bypass (#27002), the Windows CLI is actively dangerous for production use.

10+ community reporters. Zero Anthropic response. 2+ months.

Full details in #21576 (latest comment).

ThatDragonOverThere avatar Feb 22 '26 06:02 ThatDragonOverThere

Smoking Gun Found — Feb 22, 2026: Orphaned Process Confirmed

10th reproduction. This time with hard evidence of the orphaned process:

(TradingAlertsLive) PS C:\Users\Cassie> [I[O[I[O[I[O[I[O[I[O[I[O[I[O[I[O[I[O[

Those are CSI focus in/out escape sequences ([I = focus gained, [O = focus lost). They accumulated overnight — each time the terminal window gained or lost focus (screen saver, monitor sleep/wake), the dead Bun process dumped another pair.

This confirms: After the TUI escape, the Bun process keeps running in the background. It doesn't exit. It doesn't clean up. It keeps receiving terminal events and dumping escape codes into the orphaned PS prompt.

This explains the computer crash from yesterday (3 escapes → 3 orphaned Bun processes → resource exhaustion on 32 GB machine running ML training).

@dylanh724 @wackoisgod — since you traced this to the Bun migration, the [I[O focus event handling in Bun's ConPTY layer is likely where the bug lives.

Details in #21576 (10th repro).

ThatDragonOverThere avatar Feb 22 '26 15:02 ThatDragonOverThere