win-hooks
Health Pass
- License — License: MIT
- Description — Repository has a description
- Active repo — Last push 0 days ago
- Community trust — 23 GitHub stars
Code Pass
- Code scan — Scanned 3 files during light audit, no dangerous patterns found
Permissions Pass
- Permissions — No dangerous permissions requested
This is a utility tool that automatically patches Claude Code plugin hooks to work on Windows. It scans installed plugins, detects Unix-specific scripts, and creates cross-platform polyglot wrapper files so that Windows users don't encounter execution errors.
Security Assessment
Overall Risk: Low. The tool operates locally and modifies local JSON configuration and script files within the user's plugin directory. It executes shell commands internally to facilitate its patching pipeline (leveraging Git Bash), but it does not make external network requests. The automated code scan checked 3 files and found no dangerous patterns or hardcoded secrets. Furthermore, the tool requests no elevated or dangerous system permissions.
Quality Assessment
The project is healthy. It uses the permissive MIT license and its repository has a clear description. It is actively maintained, with the most recent code push occurring today. While still an early-stage project with 23 GitHub stars, the concept is straightforward, the codebase is small, and it shows a low surface area for vulnerabilities. The fact that it automatically backs up original files (as `.bak`) before patching is a good quality metric, ensuring safe recovery if something goes wrong.
Verdict
Safe to use.
Linux? Nah. Win-ux! ✴ Auto-patches Claude Code plugin hooks for Windows compatibility
win-hooks
"Linux? Nah. Win-ux!"
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.
The Problem
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.
Quick Start
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.
What happens under the hood
Every time Claude Code starts, win-hooks runs a pipeline:
scan plugins → patch hooks.json → fix settings.json paths → verify & auto-repair
- Scans
~/.claude/plugins/installed_plugins.jsonfor all installed plugins - Detects
.shscripts, missing binaries, and Unix-only commands - Creates a polyglot
.cmdentry point and extensionless bash wrappers - Patches each plugin's
hooks.json(originals backed up as.bak) - Verifies patched files — strips BOM from JSON and scripts, normalizes CRLF, validates JSON, disables recursive wrappers
- Skips anything already compatible — safe to run a thousand times
How It Works
The Polyglot Trick
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}" "$@"
- Windows:
cmd.exeignores the heredoc, runs the batch portion, finds Git Bash, delegates - macOS/Linux: bash treats
:as a no-op, skips to the shell portion, runs natively - Result: One file. Both platforms. Zero friction.
Wrapper Architecture
plugin/
├── 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.
Commands
| Command | Description |
|---|---|
/win-hooks:fix |
Manually trigger the patcher (auto-runs at session start) |
/win-hooks:status |
Show compatibility status of all installed plugins |
Plugin Updates
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.
Requirements
- Windows 10/11 with Git for Windows
- Claude Code CLI (includes Node.js, used for JSON validation)
Bonus: win-hooks auto-creates a
python3alias if onlypython.exeexists — so other plugins that callpython3won't break either.
Components
Project structure| 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, script BOM, recursive wrappers |
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 |
| Pattern | Verdict | Reason |
|---|---|---|
.cmd in command |
COMPATIBLE | Already Windows-native |
.sh in command |
INCOMPATIBLE | Needs bash wrapper |
python3 / node prefix |
COMPATIBLE | Interpreter handles it |
.py in command |
COMPATIBLE | Python file association works |
| Bare command not in PATH | INCOMPATIBLE | Missing binary |
Built for the Windows developers who refuse to switch to Mac just to vibe code.
License
MIT — Use it, fork it, vibe with it.
Reviews (0)
Sign in to leave a review.
Leave a reviewNo results found