[BUG] Windows: hooks using stdin freeze sessions indefinitely, cmd.exe windows pop up

Resolved 💬 3 comments Opened Apr 10, 2026 by elivitan Closed Apr 14, 2026

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?

On Windows, any hook (PreToolUse, UserPromptSubmit, Stop) that runs a node script reading from stdin freezes the entire Claude Code session permanently.

What happens:

  1. Hook spawns node.exe which reads stdin via process.stdin.on('end', ...)
  2. On Windows, stdin is never properly closed to the child process
  3. The node process hangs forever waiting for EOF
  4. Claude Code waits for the hook to complete → entire session freezes
  5. Session shows "Stewing..." / "Wibbling..." / "Crafting..." but never progresses, consumes no tokens
  6. Claude Desktop re-animates killed sessions via --resume, creating zombie sessions

Additional issue: Every hook invocation opens a visible cmd.exe window on Windows because windowsHide: true is not passed when spawning hook processes. This causes constant black CMD windows popping up during work.

Impact: All stdin-based hooks are unusable on Windows, making the hook system effectively broken on this platform. Users who set up hooks get permanently frozen sessions that keep respawning.

What Should Happen?

  1. Hooks should receive stdin properly and close it so the hook process can exit
  2. Hook processes should spawn with windowsHide: true so no cmd.exe windows appear
  3. If a hook process hangs, Claude Code should time it out (e.g. 10 seconds) instead of freezing the entire session forever

Error Messages/Logs

Steps to Reproduce

  1. On Windows 10, add a PreToolUse hook to ~/.claude/settings.json that runs a node script reading stdin
  2. Use Claude Code normally — the session freezes on the first tool call
  3. Session shows "Stewing..." / "Wibbling..." forever, no tokens consumed
  4. Kill the session — Claude Desktop re-animates it via --resume, it freezes again
  5. Each hook invocation also opens a visible cmd.exe window

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.92

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Terminal.app (macOS)

Additional Information

Running Claude Desktop (Microsoft Store, UWP) v1.1617.0 on Windows 10 Home 10.0.19045. User profile path contains Hebrew characters which adds complexity but the core issue is stdin not closing for hook child processes regardless of path encoding.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗