Auto-patches Claude Code plugin hooks for Windows compatibility
npx claudepluginhub lilmgenius/win-hooksAutomatically patches Claude Code plugin hooks for Windows compatibility. Fixes .sh scripts, missing binaries, and Unix-only commands that fail on Windows.
Don't let Windows kill your vibe coding flow.
Every Claude Code plugin assumes you're on macOS or Linux.
If you're on Windows, your sessions start with a wall of red errors.
win-hooks fixes that. Automatically. Every session.
You're on Windows. You install a shiny new Claude Code plugin. You start a session. Then:
SessionStart hook error: /bin/bash: command not found
PreToolUse hook error: scripts/check.sh: No such file or directory
PostToolUse hook error: semgrep: command not found
Stop hook error: ...
Every. Single. Plugin. Written on a Mac. Tested on Linux. Shipped with .sh scripts that Windows has never heard of.
You didn't choose the wrong OS. The ecosystem just forgot about you.
Install win-hooks once. Forget about it forever.
claude plugin marketplace add LilMGenius/win-hooks
claude plugin install win-hooks
That's it. Next session, win-hooks silently patches every broken plugin before you even notice. No config. No flags. No manual fixing.
Every time Claude Code starts, win-hooks runs a pipeline:
scan plugins → patch hooks.json → fix settings.json paths → verify & auto-repair
~/.claude/plugins/installed_plugins.json for all installed plugins.sh scripts, missing binaries, and Unix-only commands.cmd entry point and extensionless bash wrappershooks.json (originals backed up as .bak)The core innovation is a .cmd file that is simultaneously valid batch and valid bash:
: << 'CMDBLOCK'
@echo off
REM Windows cmd.exe runs this part → finds Git Bash → delegates
"C:\Program Files\Git\bin\bash.exe" "%HOOK_DIR%%~1" %2 %3 %4 %5 %6 %7 %8 %9
exit /b %ERRORLEVEL%
CMDBLOCK
# bash runs this part → executes directly
exec bash "${SCRIPT_DIR}/${SCRIPT_NAME}" "$@"
cmd.exe ignores the heredoc, runs the batch portion, finds Git Bash, delegates: as a no-op, skips to the shell portion, runs nativelyplugin/
├── hooks/
│ ├── hooks.json ← patched to point to _hooks/
│ └── hooks.json.bak ← original backup
├── _hooks/ ← win-hooks creates this
│ ├── run-hook.cmd ← polyglot entry point
│ ├── setup ← extensionless bash wrapper
│ └── check-tool ← extensionless bash wrapper
└── scripts/
└── setup.sh ← original (untouched)
Wrappers live in a dedicated _hooks/ directory — original plugin files are never modified or overwritten.
| Command | Description |
|---|---|
/win-hooks:fix | Manually trigger the patcher (auto-runs at session start) |
/win-hooks:status | Show compatibility status of all installed plugins |
When a plugin updates, its install path changes and patches are lost. This is by design. Restart Claude Code → win-hooks re-detects and re-patches automatically. Zero maintenance.
Bonus: win-hooks auto-creates a
python3alias if onlypython.exeexists — so other plugins that callpython3won't break either.
| Component | Purpose |
|---|---|
hooks/hooks.json | SessionStart hook — triggers auto-patching |
hooks/patch-all | Orchestrator — platform check → run pipeline |
hooks/run-hook.cmd | Polyglot template — copied to each patched plugin |
scripts/find-incompatible | Scanner — detects incompatible hooks across all plugins |
scripts/apply-patches | Patcher — creates wrappers and updates hooks.json |
scripts/verify | Health check — validates JSON, BOM, CRLF, wrapper integrity |
scripts/fix-backslash-paths | Converts C:\... to C:/... in settings.json hooks |
commands/fix.md | /win-hooks:fix command definition |
commands/status.md | /win-hooks:status command definition |
skills/diagnose/ | Diagnostic skill for hook errors |
Matt Pocock's skills for real engineering, as an installable Claude Code plugin.
Plugins by Alex Newman (thedotmack)
Ultra-compressed communication mode for Claude Code. Cuts 65% of output tokens (measured) while keeping full technical accuracy.