I spent an hour last week debugging a hook that wasn't broken.

Here's the setup: I run Claude Code on Windows, and I'd written a little UserPromptSubmit hook in PowerShell — a keyword router that reads my prompt and, if it sees something like mcp 서버 or 코드 리뷰, injects a hint so Claude pulls up the right skill. Half my prompts are in Korean, so a bunch of the regex patterns had Korean in them.

It worked perfectly for the English rules. The Korean ones? Dead. No match, no error, no log line. The script ran, exited 0, and just... did nothing for half my inputs.

I did all the dumb things first. Echoed the prompt — looked fine. Tested the regex in a PowerShell console — matched fine. Re-read the JSON parsing five times. Added Write-Host debugging everywhere. Nothing.

The actual problem had nothing to do with my code. It was the file encoding.