Claude Code toolkit
A tested safety hook for Claude Code that blocks dangerous commands before they run, plus reusable sub-agents and slash commands.
The problem
An AI assistant that runs commands in your terminal is useful until it runs the
wrong one: rm -rf on the wrong folder, a downloaded script piped straight into a
shell, a push --force to the main branch.
What it does
A hook that Claude Code runs before every tool call: it reads the command and blocks it if it’s dangerous, explaining why so the assistant can adjust. It catches recursive deletes of system paths, downloads piped into a shell, secret files sent over the network, writes to disks and protected paths, force pushes to main branches, while letting the harmless variants through.
The decision logic is separate from the input and output plumbing, so it is covered by unit tests. Example sub-agents and slash commands are included. It is the reusable part of the setup I use every day on an infrastructure repository.