A /review slash command that makes Claude Code check its own diff before you commit A developer published a custom Claude Code slash command, `/review`, defined in a `.claude/commands/review.md` file that runs `git diff --staged` and reports leftover debug output, incomplete renames, weakened or skipped tests, and changes touching secrets, auth, or config before a commit lands. The command restricts itself to read-only git commands via `allowed-tools`, so the review cannot modify files, and it ends with either "OK to commit" or a short fix list. The author recommends committing the commands folder so a team shares the command and pairing it with a Stop hook that prompts a review when a session ends with uncommitted changes. 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 https://justly-mia-429.rehost.page/ . The free sample is enough to try the pattern today.