Quoting Geoffrey Huntley Geoffrey Huntley described a technique for enforcing coding-agent behavior by writing a pre-commit hook that checks the git diff for direct calls to observability modules that bypass his diagnostics module, failing the commit and injecting a prompt telling the agent to use the diagnostics library. Huntley said the approach took the agent from a persistent drift problem to "ten out of ten," arguing that introspecting and updating AGENTS.md still leaves a delta that drifts over time. If the agent isn't using my diagnostics library, I could introspect and update AGENTS.md, but there's still a delta, and it'll drift. Instead, 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 https://ghuntley.com/agency/ , nobody should type code by hand anymore. here's what's left. Tags: coding-agents https://simonwillison.net/tags/coding-agents , generative-ai https://simonwillison.net/tags/generative-ai , git https://simonwillison.net/tags/git , agentic-engineering https://simonwillison.net/tags/agentic-engineering , ai https://simonwillison.net/tags/ai , geoffrey-huntley https://simonwillison.net/tags/geoffrey-huntley , llms https://simonwillison.net/tags/llms