Geoffrey Huntley on using pre-commit hooks to keep coding agents in line
In a quote highlighted on Simon Willison's blog, Geoffrey Huntley describes how he keeps a coding agent using his diagnostics library: if the agent bypasses it, he writes a pre-commit hook that checks the git diff for direct calls to observability modules that skip the diagnostics module. The hook fails the commit and injects a prompt telling the agent to use the diagnostics library, which he says turns the outcome into "ten out of ten." He notes that introspecting and updating AGENTS.md instead still leaves a delta that will drift, and the quote sits alongside his view that nobody should type code by hand anymore.
It illustrates a low-cost, repeatable pattern for teams using coding agents: enforce project conventions with automated checks rather than relying on prompts alone.