The Hallway Track
Engineering Insights

Quoting Geoffrey Huntley

Simon Willison · Oct 13, 2026 · Engineering Insights

Pre-commit hooks can enforce agent coding conventions by failing commits and injecting corrective prompts

“I write a pre-commit hook that checks the git diff for direct calls to observability modules that bypass my diagnostics module. Boom: fail the commit, inject a prompt telling the agent to use the diagnostics library. All of a sudden it's ten out of ten.”

Geoffrey Huntley describes using pre-commit hooks as a guardrail mechanism for AI coding agents, failing commits that violate conventions and injecting corrective prompts to steer agent behavior. This pattern treats git hooks as a runtime constraint layer for agents, not just humans. It's a practical, low-overhead technique for enforcing architectural conventions in agentic workflows.

coding-agents agentic-engineering git-hooks llms prompt-injection observability

Watch / read the original source →