Geoffrey Huntley:用 pre-commit hook 强制 AI 智能体调用诊断库
A quote from Geoffrey Huntley
Geoffrey Huntley 提出,与其反复更新 AGENTS.md 提示词,不如写一个 pre-commit hook 检查 git diff 中绕过诊断模块、直接调用可观测性模块的代码:一旦发现就拒绝提交,并向智能体注入提示词要求其使用诊断库,效果“十全十美”。
正文
当前显示原文,中文全文译文尚未就绪。
13th October 2026
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, nobody should type code by hand anymore. here's what's left.
Recent articles
Hello Python 3.15, goodbye 3.10, and now I can use 3.11 - 12th October 2026; A new feature for my blog, built using my voice - 9th October 2026; Claude Haiku 5.5 - 7th October 2026; We're going to need default hard budget caps on pretty much everything - 3rd October 2026
This is a quotation collected by Simon Willison, posted on 13th October 2026.