SessionStart command hooks freeze terminal input on Windows

Resolved 💬 3 comments Opened Feb 6, 2026 by Jerempire Closed Feb 9, 2026

Bug Description

Any SessionStart command hook causes an indefinite terminal input freeze on Windows. The terminal becomes completely unresponsive to keyboard input. The only workaround is to paste from the clipboard, which "unsticks" the input buffer.

This affects all SessionStart command hooks — even the most trivial:

{
  "hooks": {
    "SessionStart": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "echo hello",
            "timeout": 2
          }
        ]
      }
    ]
  }
}

Steps to Reproduce

  1. On Windows, add any SessionStart command hook to ~/.claude/settings.json
  2. Launch claude in Windows Terminal or PowerShell
  3. Wait for the prompt to appear
  4. Try to type — keyboard input is completely frozen
  5. Copy any text to clipboard and paste into terminal — input becomes unstuck

Expected Behavior

Terminal input should work normally after SessionStart hooks complete.

Actual Behavior

Terminal input is indefinitely frozen. No timeout resolves it. Only a clipboard paste operation (which uses a different Windows input code path) unfreezes it.

Environment

  • OS: Windows 11 (build 26200.7623)
  • Terminals tested: Windows Terminal, PowerShell (both affected)
  • Claude Code version: 2.1.33
  • Node.js: installed via npm global

Debugging Notes

Through systematic binary-search testing:

  • All other hook types work fine: PreToolUse, PostToolUse, UserPromptSubmit, PreCompact — none cause the freeze
  • Only SessionStart hooks trigger the bug — even echo hello with a 2s timeout
  • Not related to the hook script content — the issue is in how Claude Code spawns the child process during session initialization
  • Likely cause: The child process spawned for SessionStart hooks interferes with the Windows ConPTY stdin handling. On Windows, spawning a process during terminal initialization can corrupt the console input buffer state. Other hook types fire later (after the terminal is fully initialized) and don't have this issue.

Workaround

Remove all SessionStart command hooks. Move any startup logic to UserPromptSubmit hooks instead (which fire on first user input and work correctly).

View original on GitHub ↗

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