[Bug] Claude Code plugin hooks.json ParserErrors on Windows when hooks run in PowerShell

Author: arjunderCreated Sep 29, 2026Updated Sep 29, 2026
Labelsneeds triage

What happened?

On Windows, when Claude Code runs hooks through PowerShell, all three hooks in the Claude Code plugin's hooks.json (SessionStart, PostToolUse, Stop) fail before the launcher starts, so the design detector never runs.

The plugin manifest ships only the POSIX guard:

[ ! -f "${CLAUDE_PLUGIN_ROOT}/skills/impeccable/scripts/impeccable" ] || "${CLAUDE_PLUGIN_ROOT}/skills/impeccable/scripts/impeccable" hook

PowerShell can't parse [ ! -f ... ], so every run fails like this:

Failed with non-blocking status code: ParserError:
Line |
   1 |  [ ! -f "${env:CLAUDE_PLUGIN_ROOT}/skills/impeccable/scripts/impeccabl .
     |   ~

In 5 days of normal use I had about 620 of these failures: 578 PostToolUse, 42 Stop and 16 SessionStart. Each one added about 0.4s after every Edit/Write.

Claude Code runs hooks with PowerShell here because of this fallback in its hooks docs: the per-hook shell field "Defaults to "bash", or to "powershell" on Windows when Git Bash isn't installed." In my case Git for Windows is installed, but through scoop (~/scoop/apps/git/current/bin/bash.exe), and Claude Code didn't detect it. So this also affects machines that have Git Bash in a non-standard location.

This looks separate from the existing Windows hook issues:

  • #452 / #453 and #604 / #605 fixed the hooks that the CLI installer writes to .claude/settings.local.json. Those are generated on the user's machine, so the installer can pick a form that works on Windows.
  • #848 (Codex) and #859 / #833 (Grok Build) are the same class of bug in other hosts.
  • The prebuilt Claude Code plugin manifest (plugin/hooks/hooks.json, built by buildClaudeCompatibleHooks(matcher, CLAUDE_PLUGIN_SCRIPTS, …) in scripts/lib/transformers/hooks.js) is built once for every platform and gets neither a Windows form nor a shell setting. As far as I can tell, no issue covers it.

Steps to reproduce

  1. On Windows, with no Git Bash that Claude Code can detect, install the plugin with /plugin install impeccable@impeccable (4.4.0; main at 114ea1d ships the same hooks.json).
  2. Start a Claude Code session and let Claude edit any file.
  3. Each PostToolUse (and SessionStart / Stop) hook fails with the ParserError above. The session transcript records them as hook_non_blocking_error attachments.

Expected behavior

The hooks run impeccable.cmd hook on Windows whichever shell Claude Code picks, and they exit 0 when the launcher is missing, the same way the POSIX guard does on macOS and Linux.

Provider & environment

  • Provider: Claude Code (plugin install from the impeccable marketplace)
  • Provider version: Claude Code 2.1.284 (Claude Desktop, Windows)
  • OS: Windows 11 Home (10.0.26200), PowerShell 7; Git for Windows installed through scoop and not detected by Claude Code
  • Impeccable: plugin 4.4.0, impeccable.cmd --version reports 4.0.0

Additional context

The launcher itself works fine on Windows. Running the same event through impeccable.cmd directly exits 0 and returns the expected additionalContext:

{"hookSpecificOutput":{"hookEventName":"PostToolUse","additionalContext":"[impeccable@1] Design hook scanned src/App.tsx. No deterministic design-quality issues found. ..."}}

As a local workaround, I replaced all three commands in the cached plugin hooks.json with a PowerShell-only guard. That fixed it on my machine, but it would break macOS and Linux, and the next plugin update will overwrite it:

if (Test-Path "${CLAUDE_PLUGIN_ROOT}/skills/impeccable/scripts/impeccable.cmd") { & "${CLAUDE_PLUGIN_ROOT}/skills/impeccable/scripts/impeccable.cmd" hook }

Unlike Codex, Claude Code has no commandWindows sibling, so one shared manifest needs another way to work on both platforms. The options I can see, all using features in the Claude Code hooks docs:

  • Use exec form (command plus args, which skips the shell entirely) pointing at a small entry point that works on every platform.
  • Use the per-hook shell field. "shell": "bash" on its own would still fail on machines without Git Bash, though.
  • Use one command that parses under both sh and PowerShell.

I don't know which fits the launcher's "never needs Node" design best, so I'll leave that to you.

Willing to work on a fix?

Happy to test a fix on this Windows setup, but I won't open a PR without maintainer approval.