Keep interface constraints in code or agents will stomp all over them next session

zeeg · x · 2026-10-14

The author shares a hands-on lesson for AI coding agents: when modifying a codebase, the agent follows whatever patterns it already knows, even if those patterns are wrong for the tricky case at hand.

One fix is to annotate the wrong patterns in code as wrong, steering the agent toward the right approach. More broadly: if you have a constrained, well-articulated public interface—one you deliberately forced constraints onto—you need to encode that in the code itself (comments, deterministic rules, etc.). Otherwise the agent will stomp all over it in the next conversation, which matters increasingly for software reliability.

Related event: Developers: Lock Interface Constraints in Comments to Keep AI Agents From Breaking Code(2 posts)→

Original post →

More from coding & agent

coding & agent channel →