// resources@askgeorge.ai

You commented HOOKS

Make Claude Code prove it’s done

This is the setup from the reel. Every time Claude Code finishes a reply, it runs your tests. If they fail, Claude isn’t allowed to stop: it gets the failures back and keeps working.

1. Add the hook

Open (or create) .claude/settings.json in your project and add this:

{
  "hooks": {
    "Stop": [{
      "hooks": [{
        "type": "command",
        "command": "npm test 1>&2 || exit 2"
      }]
    }]
  }
}

Not using npm? Swap npm test for your own test command, like pnpm test, pytest or go test ./.... Keep the 1>&2 || exit 2 part.

2. Why it works

3. Check it’s on

Break one test on purpose, then ask Claude Code for any small change. When it finishes, the hook runs, the test fails, and you’ll see Claude pick the failure back up instead of saying it’s done. Fix the test back afterwards.

Good to know

Full details: the Claude Code hooks reference.