[BUG] CRITICAL BUG: Claude Code keyboard input blocked after crash - Windows 11 24H2

Status Closed — not planned
Maintainer reply None cached
Activity 12 comments · opened Aug 29, 2025 · closed Jan 17, 2026

Bug Report: Claude Code - Critical Keyboard Input Blocking After System Events

Priority: CRITICAL
Status: REPRODUCIBLE
Impact: Complete application unusability
Date: August 29, 2025
Reporter: ing.nestorgil@gmail.com

Executive Summary

Claude Code suffers from a critical bug where keyboard input becomes completely blocked after certain system events. The issue persists across restarts and standard reinstallations, requiring specialized recovery procedures. This represents a complete loss of functionality for affected users.

Environment Details

  • OS: Windows 11 Home 24H2
  • Claude Code Version: 1.0.96
  • Node.js Version: v24.4.1
  • NPM Version: 11.4.2
  • Terminal: Windows CMD and VS Code integrated terminal

Problem Description

Initial Trigger

The bug manifests when Claude Code crashes or freezes during complex operations (specifically observed during Nuxt.js with PostgreSQL integration development work).

Symptoms

After the initial crash/freeze:

  1. claude command launches normally
  2. Welcome message displays correctly
  3. Complete keyboard unresponsiveness - no input is accepted
  4. Application appears functional but input interface is completely non-functional
  5. No error messages are displayed

Persistence Characteristics

  • Survives complete system restarts
  • Survives standard npm uninstall/reinstall cycles
  • Affects all terminal types (CMD, PowerShell, VS Code integrated terminal)
  • Other applications and npm packages work normally

Root Cause Analysis

Through extensive debugging, the issue was traced to corrupted .cmd files generated by npm during the installation process:

Corrupted File Content

@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
  SET "_prog=%dp0%\node.exe"
) ELSE (
  SET "_prog=node"
  SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%"  "%dp0%\node_modules\@anthropic-ai\claude-code\cli.js" %*

The critical issue: Line endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% contains an invalid goto #_undefined_# statement that causes the script to fail silently, preventing proper input handling.

Reproduction Steps

  1. Install Claude Code in the specified environment
  2. Work on complex projects (triggers observed during intensive development sessions)
  3. Experience a crash or freeze during operation
  4. Restart Claude Code - input will be completely blocked
  5. Standard reinstallation will NOT resolve the issue

Failed Solutions Attempted

  • Complete system restart
  • Standard npm uninstall/reinstall
  • Cache cleaning with npm cache clean --force
  • Process killing (taskkill /F /IM node.exe)
  • Different terminal environments
  • Directory changes

Working Solution

Only this complete cleanup resolves the issue:

# 1. Force uninstall
npm uninstall -g @anthropic-ai/claude-code --force

# 2. Manual removal of corrupted files
del "C:\Users\[USERNAME]\AppData\Roaming\npm\claude"
del "C:\Users\[USERNAME]\AppData\Roaming\npm\claude.cmd"

# 3. Deep cache cleaning
rd /s /q "%APPDATA%\npm\node_modules\@anthropic-ai" 2>nul
rd /s /q "%APPDATA%\npm-cache" 2>nul
npm cache clean --force

# 4. Reinstall
npm install -g @anthropic-ai/claude-code

# 5. Manual correction of .cmd file (if still corrupted)
# Replace corrupted content with proper batch script

Secondary Issue Discovery

Even after successful recovery, the application exhibits intermittent hanging behavior:

  • Starts correctly and shows welcome message
  • Accepts initial input
  • Randomly becomes unresponsive during operation
  • Does not respond to Esc, Ctrl+C, or any keyboard input
  • Requires force-closing the terminal window

System-Specific Factors

This bug appears to be related to:

  1. Windows 11 24H2 - potentially newer Windows version incompatibility
  2. Node.js v24.4.1 - very recent Node.js version, possible compatibility issues
  3. npm's .cmd file generation - systematic corruption in file creation process

Impact Assessment

  • Productivity Loss: Complete inability to use Claude Code until specialized recovery
  • Data Risk: Potential work loss if crashes occur during important sessions
  • User Confidence: Fear of recurring crashes affects usage patterns
  • Support Burden: Complex recovery process requires technical expertise

Recommendations for Development Team

Immediate Actions

  1. Investigate .cmd file generation - Why does npm create corrupted wrapper scripts?
  2. Add integrity checks - Detect and auto-repair corrupted installation files
  3. Improve crash recovery - Better handling during complex operations
  4. Version compatibility testing - Test with Node.js v24.x and Windows 11 24H2

Long-term Improvements

  1. Self-diagnostic tools - Allow users to detect/fix corrupted installations
  2. Alternative installation methods - Reduce dependency on npm's .cmd generation
  3. Enhanced error handling - Prevent silent failures in wrapper scripts
  4. Documentation updates - Include this recovery procedure in troubleshooting guides

Workaround for Affected Users

Until this is resolved, affected users should:

  1. Use Claude via VS Code extension
  2. Use claude.ai web interface
  3. Consider downgrading Node.js to LTS version (20.x)
  4. Keep the manual recovery script available for emergencies

Technical Evidence

Corrupted .cmd File Location

C:\Users\[USERNAME]\AppData\Roaming\npm\claude.cmd

Process Verification Commands

tasklist | findstr node
tasklist | findstr claude
where claude

Installation Verification

npm ls -g @anthropic-ai/claude-code
claude --version

Contact Information

Reporter: ing.nestorgil@gmail.com
Environment: Production development setup
Availability: Available for additional testing/debugging as needed

---

Note: This bug represents a critical failure mode that makes Claude Code completely unusable in affected configurations. The combination of Windows 11 24H2 + Node.js 24.4.1 appears to be a particularly problematic environment that warrants immediate investigation.

View original on GitHub ↗

12 Comments

OSCRobin · 1 year ago

I have the same with similar setup (Node, W11, npm).

LouisZCode · 11 months ago

Happening also to me, any update on the fix?

harshh-jainn · 11 months ago

facing this as well on linux

TheColonel2688 · 11 months ago

for the record, this is happening to me on a Win10 VM running Win 10 22h2, build 19045.6332

node.js version v22.20.0

stewartbourke487 · 11 months ago

Happening to me too on Windows 11 25H2 version, and CC 2.0.2 running inside terminal windows in VS 2026

AaronMeyers · 11 months ago

happens to me running Windows 11 24H2, Node 22.14.0. very frustrating.

BenNewman100 · 10 months ago

Yeah, this is happening even with the native Windows install that uses a Claude.exe file.

Version 2.0.24
Windows 11 25H2

(it is now happening in VS Code Terminal as well... I can't use Claude code at all now

@NestorEdgardo Maybe you should update your Claude-generated bug report, because it's misleading. It has nothing to do with the .cmd file since the same thing happens when using the binary version.

LucaSilva-r · 10 months ago

Same issue with me. Working with dev containers in wsl. After typing for a while the whole terminal locks up, can't do anything to unfreeze it and have to kill the process manually

github-actions[bot] · 8 months ago

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.

gbmerrall · 8 months ago

Issue is still occurring.

github-actions[bot] · 7 months ago

This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.

github-actions[bot] · 7 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.