[BUG] SessionStart hooks break stdin on Windows Terminal

Resolved 💬 19 comments Opened Feb 4, 2026 by matt-grain Closed Feb 18, 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?

When using SessionStart hooks on Windows with Windows Terminal, stdin becomes completely unresponsive after the hook executes. The hook completes successfully (debug logs show "Successfully parsed and validated hook JSON output" and "[REPL:mount] REPL mounted, disabled=false"), but the user cannot type any input. The cursor appears but keystrokes are not registered.

This affects ANY hook command, even the most minimal cmd /c echo {}.

What Should Happen?

After the hook completes successfully, stdin should work normally and the user should be able to type prompts in the REPL.

Error Messages/Logs

no error message, claude code hangs at start (stdin stuck)

Steps to Reproduce

  1. Create a project directory with a .claude/settings.json file containing:
{
  "hooks": {
    "SessionStart": [
      {
        "matcher": "startup",
        "hooks": [
          {
            "type": "command",
            "command": "cmd /c echo {}"
          }
        ]
      }
    ]
  }
}
  1. Open Windows Terminal (not WezTerm or other terminals)
  2. Navigate to the project directory
  3. Run claude --debug
  4. Observe that:
  • Claude Code starts normally
  • The hook executes successfully (visible in debug log)
  • The prompt appears with "Try 'fix typecheck errors'" suggestion
  • You cannot type anything - stdin is completely blocked

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.31, still the case with 2.1.37

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Windows Terminal

Additional Information

Additional Information

Debug log shows everything completing successfully:

2026-02-04T14:35:02.486Z [DEBUG] Successfully parsed and validated hook JSON output
2026-02-04T14:35:02.487Z [DEBUG] Hook SessionStart:startup (SessionStart) success: {}
2026-02-04T14:35:03.433Z [DEBUG] [REPL:mount] REPL mounted, disabled=false
2026-02-04T14:35:03.627Z [DEBUG] [render] first ink render: 2264ms since process start

No errors in the log - everything appears successful, yet stdin is broken.

Key findings from investigation:

  1. Affects ANY subprocess: Even cmd /c echo {} causes the issue - not specific to Python or complex hooks
  2. Windows Terminal specific: WezTerm works correctly with the exact same hooks
  3. Other projects work: Windows Terminal works fine in projects without hooks configured
  4. Hook output is valid: JSON is correctly parsed, no errors in processing

Workaround

  • Use vscode plugin
  • Use WezTerm instead of Windows Terminal when working with projects that have SessionStart hooks, somewhat working but still some stdin issues (text appears below the prompt zone)

Possibly related issues

  • #12507 - stdin consumed by shell detection subprocesses (similar stdin inheritance pattern)
  • #22172 - CPU hang with parallel instances and hooks (v2.1.23+ regression)

Possible cause

The hook subprocess may be inheriting stdin handles in a way that doesn't get properly restored on Windows Terminal specifically. This could be related to how Windows Terminal handles ConPTY vs how other terminals (WezTerm) handle terminal I/O.

View original on GitHub ↗

19 Comments

github-actions[bot] · 5 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/22934
  2. https://github.com/anthropics/claude-code/issues/23038
  3. https://github.com/anthropics/claude-code/issues/22969

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

matt-grain · 5 months ago

This is NOT a duplicate of the suggested issues

I've analyzed (with Claude) the suggested duplicates and this issue is distinct:

#22934 - CLI freezes when SessionStart hook errors

  • That issue: Hook errors cause freeze
  • This issue: Hook succeeds but stdin breaks
  • Key difference: Our debug logs show "Successfully parsed and validated hook JSON output" and "Hook SessionStart:startup (SessionStart) success" - no errors at all

#23038 - SessionStart hook hangs in trusted directories

  • That issue: Hangs only in trusted directories, works in untrusted
  • This issue: Hangs everywhere with any hook configured
  • Key difference: We tested with brand new minimal settings.json, same result

#22969 - Cannot type until pressing Enter

  • That issue: Workaround exists (press Enter to activate input)
  • This issue: No workaround - stdin completely blocked, Enter does nothing
  • Key difference: We tried pressing Enter, Ctrl+C, etc. - nothing works

What makes this issue unique:

  1. Affects ANY subprocess - Even cmd /c echo {} causes it. Not specific to Python, Node, or complex hooks
  2. Windows Terminal specific - WezTerm works with identical hooks
  3. Hook succeeds completely - All debug logs show success, JSON parsed correctly, REPL mounted
  4. No workaround in Windows Terminal - Must switch to different terminal emulator

This appears to be a specific interaction between Claude Code's subprocess stdin handling and Windows Terminal's ConPTY implementation that differs from how other terminals (WezTerm) somewhat handle it and vscode plugin works well.

elebumm · 5 months ago

For anyone else running into this issue now, uninstalling the "superpowers" extension was what worked for me.

claude plugin uninstall superpowers

matt-grain · 5 months ago

On my side, this is my own session_start hook. Took me hours to understand why Claude Code was not starting... Fortunately vscode extension works without issue.

elebumm · 5 months ago

@matt-grain good point! I didn't have any hooks configured, just the ones that were in the plugins.

mayhew3 · 5 months ago

Having the same issue. I have custom SessionStart hooks, and Windows CLI doesn't allow me to type anything. This started today on 2.1.31, and downgrading to 2.1.29 allows me to continue. 2.1.30 also doesn't work.

MrErikCodes · 5 months ago

Same issue on 2.1.30 and 2.1.31

matt-grain · 5 months ago
Having the same issue. I have custom SessionStart hooks, and Windows CLI doesn't allow me to type anything. This started today on 2.1.31, and downgrading to 2.1.29 allows me to continue. 2.1.30 also doesn't work.

@mayhew3 : how do you downgrade to a specific version?

kshintome · 5 months ago

@matt-grain
Now you can downgrade.
claude install 2.1.29

finlytics-hub · 5 months ago

It was indeed the superpowers plugin that was resulting in stripped backslashes. disabling it worked for me. output from the debug logs:

2026-02-05T01:07:35.848Z [DEBUG] Hook SessionStart:startup (SessionStart) error:
/bin/bash: C:Usersasadm.claudepluginscacheclaude-plugins-officialsuperpowers4.1.1/hooks/session-start.sh: No such file or directory
MrErikCodes · 5 months ago
It was indeed the superpowers plugin that was resulting in stripped backslashes. disabling it worked for me. output from the debug logs: `` 2026-02-05T01:07:35.848Z [DEBUG] Hook SessionStart:startup (SessionStart) error: /bin/bash: C:Usersasadm.claudepluginscacheclaude-plugins-officialsuperpowers4.1.1/hooks/session-start.sh: No such file or directory ``

Question then is, is it Anthropic thats going to fix this? Or the Superpowers? :D

dcox79 · 5 months ago

Had this happen to me with 2 different plugins now, Superpowers and Claude-mem

matt-grain · 5 months ago
Had this happen to me with 2 different plugins now, Superpowers and Claude-mem

that will happen with any plugin using prompt injection at session_start hook

matt-grain · 5 months ago

I still get the issue with v2.1.37, and you?

mayhew3 · 5 months ago

Still happening for me on 2.1.37 as well.

muckinger · 4 months ago

Maybe same bug as mine mentioned in https://github.com/anthropics/claude-code/issues/26586
Happens to me first after installing Superpowers (uninstalled it) and now again after installing https://github.com/PeonPing/peon-ping/ :-(

dalito · 4 months ago

I do no longer observe the issue. 2.1.42 fixed it for me (now on 2.1.45).

matt-grain · 4 months ago

yes! finally fixed!

github-actions[bot] · 4 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.