Skip to content

Windows: Cannot type in terminal until pressing Enter after v2.1.31 update (regression) #22969

Description

@reconunpro

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?

When Claude Code is launched with an initial prompt argument (claude "any prompt"), the terminal input freezes — the user cannot type until pressing Enter to "unstick" it. Launching claude without arguments works fine.

Trigger: Passing a CLI prompt argument

claude "any prompt"    → FREEZES (must press Enter to unstick)
claude                 → WORKS (always)

This is a race condition that triggers more reliably in directories with heavier project context (CLAUDE.md files, .claude/ settings, git repos). In any project directory it freezes 100% of the time. In minimal directories it can occasionally succeed.

What Should Happen?

After processing the initial prompt argument, keyboard input should work immediately without needing to press Enter to activate the input field.

Error Messages/Logs

No error messages — the hook and prompt processing complete successfully.
Debug logs show normal execution; the issue is in stdin/readline state after processing.

Steps to Reproduce

  1. Open any terminal on Windows (PowerShell, Git Bash, cmd)
  2. Navigate to any project directory with a CLAUDE.md file
  3. Run claude "hello world"
  4. Wait for Claude to respond to the initial prompt
  5. Try to type — nothing appears in the input field
  6. Press Enter — keyboard input now works normally

Minimal reproduction (fresh terminal, no hooks/plugins needed):

cd <any-project-directory>
claude "a"
# Stdin is frozen — press Enter to unstick

What's NOT the cause (ruled out with 18+ tests)

Suspected Cause How Ruled Out
SessionStart hooks Disabled all hooks — freeze persists with claude "prompt"
Any hooks/plugins/statusLine Emptied all hooks.json, disabled plugins — freeze persists
Console mode corruption Win32 GetConsoleMode/SetConsoleMode save/restore — freeze persists
Console input buffer FlushConsoleInputBuffer — freeze persists
PowerShell -Command mode Freeze happens with manually typed commands too
Terminal emulator Reproduces in Windows Terminal, standalone PowerShell
Interactive input before claude Red herring — always co-occurred with prompt argument

What DOES work (no freeze)

Command Result
claude (no args) Works — always
claude --resume Works
claude -c Works
claude --verbose Works

Non-prompt flags follow a different code path and don't trigger the race condition.

Claude Model

Claude Opus 4

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.1.30

Claude Code Version

2.1.34 (Claude Code)

Platform

Claude Max (Pro/Team subscription)

Operating System

Microsoft Windows 11 Pro (10.0.26200)

Terminal/Shell

Windows Terminal 1.23.20211.0 / PowerShell 5.1.26100.7705

Additional Information

Node.js version: v24.11.1

Related Issues (all closed as NOT_PLANNED):

Likely root cause: Race condition between Node.js stdin/readline initialization and initial prompt processing on Windows. When claude processes a CLI prompt argument, stdin setup doesn't complete correctly before entering interactive mode.

Workaround: Always launch claude without prompt arguments. Type the initial prompt interactively after claude starts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:tuibugSomething isn't workinghas reproHas detailed reproduction stepsplatform:windowsIssue specifically occurs on WindowsstaleIssue is inactive

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions