This hook fires on the PreToolUse event whenever Claude Code is about to run a git command through Bash. It inspects the commit message before it gets recorded.
In practice, it enforces the type(scope): description pattern, accepting types like feat, fix, docs, refactor, test and chore. If the message breaks the format, the commit is blocked.
When to use
- When your team relies on a clean history to auto-generate a changelog.
- When you use semantic versioning and want consistent commits.
How to use
After installing, it runs on its own on every commit attempt. Just write messages in the conventional format and the hook lets the operation through.