Engineering brief
Why your AI coding agent keeps ignoring your rules—and how to fix
At a glance
- Relevance
- Practical value
- Warnings
- None
Rules only guide AI coding agents; they don't guarantee behavior. Hooks—deterministic scripts triggered by agent events—enforce what rules cannot.
Rules are probabilistic; hooks are deterministic. This is the missing governance layer for AI agents.
Summary
The core argument is that engineering teams over-rely on rules for AI coding agents, but rules only guide probabilistic LLMs. Hooks—deterministic scripts triggered by agent events—provide actual guarantees. The speaker demonstrates that bloating rules degrades agent performance, citing a study where self-evolved rules made agents worse.
The practical taxonomy is clear: pre-tool hooks block actions (security gates), post-tool hooks log activity (observability), and stop hooks enforce completion criteria (e.g., mandatory test passes). The most actionable insight is the 'rule audit' framework: classify each rule as encoding judgment (keep as rule) or naming a process/extracting a guarantee (convert to hook).
The speaker walks through concrete implementations: blocking .env file reads, forcing file coupling checks before edits, and running tests on conversation end. These are not speculative—they use exit codes (0=pass, 2=block) that agents interpret as feedback, not crashes.
The tradeoff is clear: hooks add setup complexity but remove failure modes from probabilistic agent behavior. For teams scaling agent usage, the recommendation is to audit rules now, extract process guarantees into hooks, and accept that this requires initial engineering investment.
Watch the video
This video is blocked due to your privacy settings. To watch this video, please accept YouTube marketing cookies.
Related breakdowns
Stop over-constraining your AI agents: prune rules, keep conventions.
The creator of Claude Code says to delete your AI layer every six months. The real advice: prune rules that fix reasoning gaps, but keep conventions that…
Kimi K3's Benchmark Hides a 36% Failure Rate in Real Workflows
Custom benchmarks show Kimi K3 fails on false premises and hidden invariants 36% of the time—4.5x more than Opus. The solution: a hybrid workflow that…
Why Full Autonomy Is the Wrong Goal for AI Coding
A five-level autonomy framework reveals Level 3—human-in-the-loop delegation—as the safest coding setup. The dark factory is technically possible but risky.
Get TL;DW
Too Long; Didn't Watch.
A concise breakdowns of the AI and devtools videos that actually matter for engineering leaders.
Free. Weekly. No hype.
Video and thumbnails remain the property of their respective creators. tldw.news provides editorial analysis, commentary, and discovery links to original content.