[BUG] SessionStart hooks break stdin on Windows Terminal
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
- Create a project directory with a
.claude/settings.jsonfile containing:
{
"hooks": {
"SessionStart": [
{
"matcher": "startup",
"hooks": [
{
"type": "command",
"command": "cmd /c echo {}"
}
]
}
]
}
}
- Open Windows Terminal (not WezTerm or other terminals)
- Navigate to the project directory
- Run
claude --debug - 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:
- Affects ANY subprocess: Even
cmd /c echo {}causes the issue - not specific to Python or complex hooks - Windows Terminal specific: WezTerm works correctly with the exact same hooks
- Other projects work: Windows Terminal works fine in projects without hooks configured
- 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.
19 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
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
"Successfully parsed and validated hook JSON output"and"Hook SessionStart:startup (SessionStart) success"- no errors at all#23038 - SessionStart hook hangs in trusted directories
#22969 - Cannot type until pressing Enter
What makes this issue unique:
cmd /c echo {}causes it. Not specific to Python, Node, or complex hooksThis 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.
For anyone else running into this issue now, uninstalling the "superpowers" extension was what worked for me.
claude plugin uninstall superpowersOn 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.
@matt-grain good point! I didn't have any hooks configured, just the ones that were in the plugins.
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.
Same issue on 2.1.30 and 2.1.31
@mayhew3 : how do you downgrade to a specific version?
@matt-grain
Now you can downgrade.
claude install 2.1.29It was indeed the superpowers plugin that was resulting in stripped backslashes. disabling it worked for me. output from the debug logs:
Question then is, is it Anthropic thats going to fix this? Or the Superpowers? :D
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
I still get the issue with v2.1.37, and you?
Still happening for me on 2.1.37 as well.
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/ :-(
I do no longer observe the issue. 2.1.42 fixed it for me (now on 2.1.45).
yes! finally fixed!
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.