Fix wandering coding agents with a DOMAIN_INVARIANT.md file of domain rules

0xkarasy · x · 2026-10-18

Quoting a dev's rant about Claude Code forcing test-account QA sign-in on localhost, 0xkarasy notes that 100% of the time it's Codex that invents hypothetical edge-case scenarios that get documented, while Claude goes wild on thought experiments. His fix: maintain a DOMAININVARIANT.md — a file spelling out the domain's 'rules of the game' (what's prohibited, what's required before actions) to ground the agent. He links a classic DDD piece arguing domain invariants are the foundation of correct modeling.

Original post →

More from coding & agent

coding & agent channel →