← Back to catalog
HookTesting↓ 807

Run Tests After Changes

Runs quick tests automatically after each code edit.

Installation
npx claude-code-templates@latest --hook post-tool/run-tests-after-changes --yes

This hook fires on the PostToolUse event, right after an Edit change. It checks whether a package.json exists in the project.

When it does, it runs the test:quick script silently and reports whether the tests passed or need attention. This helps catch breakages early during development.

When to use

  • When you want immediate test feedback on every change.
  • When the project has a fast test suite configured.

How to use

After installing, it runs the tests on its own after each edit. Define a test:quick script in package.json so the hook has something to run.