[BUG] No hook is working on Windows

Status Closed — not planned
Maintainer reply None cached
Activity 6 comments · opened Oct 27, 2025 · closed Jan 17, 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?

I've tested out several combinations of hooks, but None of them works.

Tested .claude/settings.json files:

{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Write|Edit",
        "hooks": [
          {
            "type": "command",
            "command": "echo 'bla bla bla'"
          }
        ]
      }
    ]
  }
}
{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Write|Edit",
        "hooks": [
          {
            "type": "command",
            "command": "isort 'tool_input.file_path'"
          }
        ]
      }
    ]
  }
}
{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Write|Edit",
        "hooks": [
          {
            "type": "command",
            "command": ".claude/hooks/formatter.py"
          }
        ]
      }
    ]
  }
}

Everytime I got error:
[error] [Window] [Extension Host] [DEBUG] Hook output does not start with {, treating as plain text

I am using VS Code plugin. Could you explain me what I am doing wrong?
I've tried downgrade Claude extension as suggested in other issues, but it doesn't work either.

What Should Happen?

Hooks should trigger

Error Messages/Logs

[error] [Window] [Extension Host] [DEBUG] Hook output does not start with {, treating as plain text

Steps to Reproduce

Described above

Claude Model

None

Is this a regression?

No, this never worked

Last Working Version

_No response_

Claude Code Version

2.0.27

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

VS Code integrated terminal

Additional Information

_No response_

View original on GitHub ↗

6 Comments

github-actions[bot] · 11 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/10385
  2. https://github.com/anthropics/claude-code/issues/9758
  3. https://github.com/anthropics/claude-code/issues/3983

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

github-actions[bot] · 10 months ago

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

StarenseN · 10 months ago

### Additional Diagnostics: Windows Hooks - stdin Not Received

Environment:

  • Claude Code: v2.0.65
  • OS: Windows 11
  • CLI: PowerShell (Admin mode)
  • Plugin: claude-mem v7.2.3 (thedotmack)
  • Bun: installed at ~/.bun/bin/bun.exe

Symptoms:

  • Hooks ARE registered and fire (PostToolUse triggers on every tool call)
  • Worker service IS running and healthy (port 37778)
  • But only 2 observations captured across 11+ sessions

Testing Performed:

  1. Manual stdin piping works:

echo '{"session_id":"test","tool_name":"Bash","tool_input":"{}","tool_response":"ok"}' | bun save-hook.js

Output: [INFO] → PostToolUse: Bash {workerPort=37778} ✅

  1. Hook returns proper JSON: {"continue":true,"suppressOutput":true}
  1. Worker health responds: {"status":"ok"}
  1. Tried --debug hooks flag - No improvement

Conclusion:
The hook script works perfectly when stdin data is manually piped. The worker receives and processes data correctly.

The issue is that Claude Code on Windows does not pass stdin data to hook commands.

  • Expected: Hook receives JSON payload via stdin
  • Actual: Hook fires but stdin is empty/not passed

This appears to be a Windows-specific subprocess communication issue.

github-actions[bot] · 9 months ago

This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.

marcindulak · 9 months ago

This issue was closed incorrectly despite recent human comments. This behavior of the bot is reported at https://github.com/anthropics/claude-code/issues/16497. Please upvote that issue, so maybe it gets noticed.

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