Watch This If Your Coding Agent is Ignoring Your Rules (You Need Hooks)

Watch This If Your Coding Agent is Ignoring Your Rules (You Need Hooks)

More

Summary

Cole Medin makes the case that hooks are the most underutilized primitive in AI coding workflows — and this video is the deep-dive tutorial his audience has been requesting. Hooks are deterministic automations that fire on specific agent lifecycle events (pre-file-read, post-tool-call, conversation stop, and others), and unlike rules or skills written in CLAUDE.md or agents.md files, they do not depend on the LLM choosing to follow instructions. That distinction — probabilistic guidance versus guaranteed execution — is the central concept Medin builds the entire video around.

The practical anchor is a stop hook configured in Claude Code’s settings.json that runs the full test suite every time the agent reports it is done. If any tests fail, the hook returns an error and forces the agent to resume and fix the failures before handing control back to the user. Medin walks through the JSON configuration, the Python script behind the hook, and a live demo showing the agent being blocked mid-conversation and forced to iterate. He connects this to Anthropic’s own work reducing the Claude Code system prompt size by 80% — the direction of travel is toward extracting process logic out of the prompt and into deterministic infrastructure.

The video covers all major hook event types, provides a framework for deciding when something in your rules file should graduate into a hook, and mentions the open-source Anton agent inside the Cowork platform as a practical routing example. Compatible with Claude Code, Codex, and Pix.


📺 Source: Cole Medin · Published August 27, 2026
🏷️ Format: Tutorial Demo

1 Item

Channels

1 Item

People