SessionStart hooks break keyboard input on Windows

Resolved 💬 3 comments Opened Feb 4, 2026 by Richesimon Closed Feb 8, 2026

Description

SessionStart hooks cause keyboard input to stop working on Windows. The hooks execute successfully (visible in debug logs), but after they complete, the terminal stdin becomes unresponsive - the cursor appears but no keystrokes register.

Steps to Reproduce

  1. On Windows, create any SessionStart hook in .claude/settings.json:

``json
{
"hooks": {
"SessionStart": [
{
"hooks": [
{
"type": "command",
"command": "node path\\to\\hook.js",
"timeout": 5
}
]
}
]
}
}
``

  1. The hook can be minimal - even console.log('test'); triggers the issue
  1. Start Claude Code: claude
  1. Observe: Claude starts, prompt appears with cursor, but keyboard input is ignored

Environment

  • OS: Windows 10/11
  • Claude Code Version: 2.1.31 (npm global install)
  • Terminal: PowerShell, cmd.exe, Windows Terminal (all affected)
  • Node.js: v20.x

Additional Context

  • The issue occurs with ANY subprocess type: Node.js scripts, batch files (.bat), PowerShell
  • Debug logs show successful hook execution and normal startup sequence
  • Opening a NEW terminal window with hooks disabled works fine
  • macOS is NOT affected - same hooks work correctly

Debug Log Excerpt

2026-02-04T16:23:06.997Z [DEBUG] Hook SessionStart:startup (SessionStart) success:
[Hook output appears correctly]
2026-02-04T16:23:06.997Z [DEBUG] [render] initLayout starting
2026-02-04T16:23:06.997Z [DEBUG] [render] initLayout complete
2026-02-04T16:23:07.032Z [DEBUG] [REPL:mount] REPL mounted, disabled=false
2026-02-04T16:23:07.036Z [DEBUG] [render] first ink render: 1231ms since process start

Everything appears successful, but stdin is dead.

Workaround

Disable SessionStart hooks on Windows:

{
  "hooks": {}
}

PostToolUse and Stop hooks may still work (not tested extensively) since they run after user input.

View original on GitHub ↗

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