TLDR Dev · LAUNCHES & TOOLS
DESTRUCTIVE GIT COMMAND PROTECTION FOR CLAUDE CODE
Summary from the TLDR Dev newsletter
AI agents can execute destructive commands without understanding the consequences. They can do this even if the AGENTS.md file forbids such commands. This post provides a Claude Code hook that blocks certain git commands before they can run. The hook uses regex pattern matching, so clever or obfuscated commands may be able to bypass it.