News ·
Quoting Geoffrey Huntley
Simon Willison quotes Geoffrey Huntley's tip: use git pre-commit hooks that fail commits and inject prompts to steer coding agents, instead of relying on AGENTS.md instructions that drift.
Simon Willison posted a quotation from Geoffrey Huntley about controlling coding agents. Huntley notes that when an agent doesn't use his diagnostics library, editing AGENTS.md leaves a gap that will drift over time.
His alternative is a pre-commit hook that inspects the git diff for direct calls to observability modules bypassing his diagnostics module. If found, the commit fails and a prompt is injected telling the agent to use the diagnostics library. He reports this approach works perfectly: "All of a sudden it's ten out of ten."
For developers building with AI, this is a practical pattern for enforcing conventions with agents: instead of relying on instructions that models may ignore or that go stale, put enforcement in the commit pipeline where failures feed back directly to the agent as prompts.
References
- Simon Willison · simonwillison.net
Read the full story at Simon Willison ↗Like, save or discuss on Buzz


