A git pre-push hook that checks AI-written changes
By the AgentReceipt team · Updated 13 November 2026
The cheapest place to catch a problem is before the code leaves your computer. A git pre-push hook does exactly that.
What a pre-push hook does
Git runs a pre-push hook just before it sends commits to a remote. If the hook exits with an error, the push stops. It is local, so it needs no server and nobody else has to set anything up.
Set it up
The --pre-push option installs a hook that runs agentreceipt check --hook before each push. The check is quiet when all is well and stops the push when a session broke a rule that is set to block.
npm install -g @agent-receipt/cli cd your-repo agentreceipt init --pre-push
Choose how strict it is
Use agentreceipt check --fail-on block to stop only on blocking findings, --fail-on warn to stop on warnings too, or --fail-on never to report without stopping.
agentreceipt check --fail-on warn