[BUG] PreToolUse hooks receive empty stdin on Windows

Resolved 💬 3 comments Opened Jan 11, 2026 by JamesFoxall Closed Jan 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?

Title: PreToolUse hooks receive empty stdin on Windows

Environment:

  • OS: Windows (Git Bash)
  • Claude Code version: [your version]

Description:
PreToolUse hooks configured for Bash tool fire correctly but receive empty stdin.
Documentation indicates hooks should receive JSON with tool_input.command.

Steps to reproduce:

  1. Create .claude/hooks/test.sh that writes stdin to file
  2. Register in settings.json as PreToolUse hook with matcher "Bash"
  3. Run any bash command
  4. Check output file - stdin length is 0

Expected: stdin contains {"hook_event_name":"PreToolUse","tool_name":"Bash","tool_input":{"command":"..."}}
Actual: stdin is empty

Impact: Cannot implement hooks that filter by command content

What Should Happen?

Expected: stdin contains {"hook_event_name":"PreToolUse","tool_name":"Bash","tool_input":{"command":"..."}}
Actual: stdin is empty

Error Messages/Logs

Steps to Reproduce

Steps to reproduce:

  1. Create .claude/hooks/test.sh that writes stdin to file
  2. Register in settings.json as PreToolUse hook with matcher "Bash"
  3. Run any bash command
  4. Check output file - stdin length is 0

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

Claude Code version 2.1.4

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Other

Additional Information

_No response_

View original on GitHub ↗

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