Our summary
A coding assistant with shell access can propose deleting files, rewriting shared history or changing a database. Jonathan Mitchell suggests adding a check before execution. In Claude Code, a PreToolUse hook is a small program called before a tool runs, giving another component a chance to stop the action.
The Python example sends the command to TypeSafe and asks Jev to choose safe, risky or destructive. It intends to block destructive commands and risky commands with confidence above 0.7. Other commands pass. The prose suggests asking a person about moderate uncertainty, but the sample does not implement that step.
Treat this as a design sketch, not a tested installation recipe. The article does not demonstrate that its service call and blocking response match current software contracts. Commands sent outside the machine may contain sensitive arguments. Independent permissions and isolation remain necessary: another model can also wrongly label a dangerous command safe.
Key takeaways
- Checking before execution creates a place to stop an action rather than discovering damage afterward.
- The sample’s 0.7 rule and its missing human prompt matter; do not assume the prose describes implemented behavior.
- Verify the hook’s actual blocking behavior and outside data handling before granting an agent powerful tools.