Most bad commits from an agent aren't wrong code. They're leftover debug prints, a half-renamed variable, or a test that got skipped "for now". A one-file custom slash command catches most of that before it lands.
Create .claude/commands/review.md in your repo:
---
description: Review the staged diff before committing
allowed-tools: Bash(git diff:*), Bash(git status:*)
---
Run `git diff --staged` and review only what changed.
Report, in this order:
1. Leftover debug output, commented-out code, or TODOs added in this diff.
2. Renames or signature changes that weren't applied everywhere.
3. Tests that were skipped, deleted, or weakened.
4. Anything that touches secrets, auth, or config files.
Do not edit files. End with "OK to commit" or a short list of what to fix.
Now /review in a session runs it. Because allowed-tools only lists read-only git commands, the review can't quietly "fix" things behind your back.
/review after.
Commit the .claude/commands/ folder so the whole team gets the same command. Pair it with a Stop hook that reminds you to run /review when a session ends with uncommitted changes.
I ship this command alongside a Bash allow-list, .env deny rules, safety hooks, and a short CLAUDE.md in Vildanden Agent Config. The free sample is enough to try the pattern today.