Git hooks generator

← All tools

Generate pre-commit, pre-push, or commit-msg hooks — plain .git/hooks/ scripts or Husky with optional lint-staged. A safety heuristic rejects common destructive custom commands.

Hook

Setup

Checks to run

Blocked

Hook script

lint-staged config

Install steps

About this tool

Git hooks run scripts before commits or pushes — catch lint errors and failing tests before they hit the remote. Husky makes hooks shareable via .husky/ in the repo; lint-staged runs checks only on staged files so pre-commit stays fast. See Git hooks for AI engineering for how to use these as guardrails for AI coding agents.

The custom-command check blocks common destructive patterns such as rm -rf, force push, and hard reset. It is a warning heuristic, not a shell parser. Review generated hooks before installing them. Bypass flags are for emergencies, not everyday workflow.

Read more

Free books, courses, and software

Get my programming books, course editions, and complete software.

Get the download library →