用 Jev 做 shell 命令安全审查钩子
在 Claude Code 执行前用 Jev 判断命令是否该拦截,154 条测试中危险命令召回 26/27,中位耗时 347ms。

i built a safety hook that screens every shell command before claude code is allowed to run it. the idea is simple: before execution, jev looks at the command and answers one question: "should this command be stopped?" then deterministic code decides what happens next. low risk > run silently uncertain > ask for approval high risk > block i tested it on 154 labeled shell commands, with 77 held out from anything jev had seen. on that held-out set: regex denylist: 15 / 27 dangerous commands caught 2 / 50 safe commands falsely flagged jev: 26 / 27 dangerous commands caught 1 / 50 safe commands falsely flagged median decision time: 347ms cost: about $0.016 per 1,000 commands the interesting part isn't just that jev caught more dangerous commands. it's why. regex rules understand strings. they don't understand intent. `rm -rf node_modules` and a destructive `rm -rf` can look almost identical syntactically. `cat .env`, `echo $ API_KEY`, `git stash drop`, `gh repo delete` all represent different kinds of risk that quickly turn into a giant pile of brittle pattern matching. a semantic decision layer can judge the action in context instead. and i think this is a much more useful way to think about ai safety inside coding agents. you don't need the main model to stop and "think harder" before every command. you need a fast judgment layer sitting between reasoning and execution. claude code decides what it wants to do. jev evaluates whether that action deserves friction. deterministic code owns the actual boundary. that's the architecture i'm becoming more interested in: reasoning model > proposes action fast model > evaluates risk code > enforces policy human > handles ambiguity the smarter coding agents get, the more important this layer becomes. because the real production problem isn't just whether an agent can write good code. it's whether you can give it enough autonomy to be useful without giving it unlimited authority.