Claude Code Hooks Field Guide — 8 Automation Hooks That Stop AI from Forgetting Things

CLAUDE.md is a suggestion. Hooks are commands. This post covers 8 battle-tested Claude Code Hooks — from auto-formatting and blocking dangerous commands to protecting sensitive files and auto-committing. Copy, paste, done.

Matt Pocock's Git Guardrails: Stop Claude Code from Accidentally Nuking Your Repo with git push --force

Matt Pocock (TypeScript guru, Ralph Loops evangelist) released a Claude Code skill: git-guardrails. It uses a PreToolUse hook to intercept dangerous git commands (push, reset --hard, clean -f, etc.), so you can safely let your AI agent run in YOLO mode inside Docker Sandbox without worrying about it blowing up your git history. One command to install, more reliable than any prompt engineering.