Guardrails for a codebase agents write
7 May 2026
tebis was written with coding agents, and I reviewed and decided. Two patterns showed up in its history.
The first was review that polished the wrong things. On 22 April I ran at least five review rounds in one day. The first audit “surfaced 21 items”; the fifth fixed autoreply edge cases and added a DNS-rebinding check. A week later a dynamic slot map got a cap of 256 entries. On 6 May I removed the slot map and the rate limiter as “premature optimizations”, and dropped autoreply as “over-engineered, replaced by hooks”. That commit added 1,772 lines and removed 2,300.
The second was drift. A feature commit, Add /tts command, added 464 lines and removed 1,361. The fix two days later says it “deleted ~900 lines of invariant/CVE/platform-quirk context from 30+ files it had no business touching.” Those comments were the reasons behind the code.
What lasted was writing rules down. CLAUDE.md now has a section that starts “past AI passes drifted in predictable ways. Hold the line.” It sets three rules: a comment that explains a reason gets one or two lines, a commit holds one logical change, and nothing gets two implementations.