diagnoselisted
Install: claude install-skill LilMGenius/win-hooks
# Win-Hooks Diagnostics
Diagnose and fix Claude Code plugin hook compatibility issues on Windows.
## Common Error Patterns
### "JSON Parse error: Unrecognized token ''" / ":: command not found" / "#!/bin/bash: No such file or directory" / "<<(을)를 지정된 경로를 찾지 못했습니다"
**Root cause**: UTF-8 BOM (EF BB BF) in any hook file. In hooks.json it causes JSON parse errors; in `run-hook.cmd` it breaks bash's `:` builtin AND it pushes the leading `:` off line-start so cmd.exe stops recognizing it as a label and instead parses the polyglot's `<<` heredoc opener as redirection (mojibake: `<<��(��) ������� �ʾҽ��ϴ�`); in wrapper scripts it breaks shebang parsing. Typically caused by Windows editors or PowerShell `Out-File`.
**Fix**: Run `/win-hooks:fix` — `verify --fix` strips BOM from every file in `hooks/`, `_hooks/`, and any file referenced from `hooks.json` (e.g., `scripts/run-hook.cmd` shipped by ralph-loop).
### "Hook load failed: JSON Parse error"
**Root causes** (check in order):
1. UTF-8 BOM in hooks.json
2. CRLF line endings causing parser issues
3. Corrupted hooks.json from interrupted patching
4. Invalid JSON syntax from bad text replacement
**Fix**: Run `/win-hooks:fix` which runs the full pipeline including `verify --fix`.
### "SyntaxError" from python3/node on a .py/.js hook file
**Root cause**: Plugin ships bash wrapper scripts with `.py`/`.js` extension that call the interpreter on themselves (e.g., `pretooluse.py` is `#!/bin/bash` but contains `python3 pretooluse.py`).