Skip to content

Geoffrey Huntley uses a pre-commit hook to constrain AI agents

What happened

AI digest

On 13 October 2026, Simon Willison reported on an approach proposed by Geoffrey Huntley: use a pre-commit hook to inspect the git diff, and reject the commit as soon as code bypasses the diagnostics module and calls the observability module directly, while injecting a prompt into the AI agent requiring it to use the diagnostics library instead. Huntley argues that updating AGENTS.md alone still leaves deviations and gradual drift; after adopting this hook-plus-prompt approach, the agent's performance immediately reached a full ten out of ten. The report does not mention earlier related developments or any contradicting claims.

Written by AI from the reports · updated 3 d ago

Timeline

Follow the reports to see the event from each side.

Oct 13
  1. Simon Willison
    Quoting Geoffrey Huntley

    Geoffrey Huntley proposes using a pre-commit hook to inspect the git diff, reject commits that call observability modules directly and bypass the diagnostics module, and inject a prompt telling the AI agent to use the diagnostics library instead. He argues that updating AGENTS.md alone still leaves a delta and will drift, whereas this approach made the agent's performance instantly ten out of ten.

Heat of this event

Current heat 3·Peak in the comparable range 10(Oct 13 23:00)·Change over 24 hours in the comparable range -51%

02.557.510Oct 1323:00Oct 1414:00Oct 1506:00Oct 1521:00

The trend compares only the same accounts observed without a break, so its range can be narrower than the current heat count. Move the pointer or tap the chart to see each hour; with a keyboard, use the left and right arrow keys.