
Your CLAUDE.md Rules Aren't Being Enforced. Here's What Actually Works.
A user on GitHub spent ~$30 over two days because Claude Code ignored a cost rule written clearly in their CLAUDE.md. The rule said "use cheap models for bulk operations." Claude read the rule, acknowledged it in conversation, ran a code review — and still shipped code that made 774 Sonnet API calls at full price. The code review agent didn't flag it either. This isn't a bug. It's a category error. CLAUDE.md is a suggestion, not a constraint CLAUDE.md rules are part of the system prompt. Claude reads them, intends to follow them, and mostly does — until it doesn't. The failure mode isn't "Claude refuses to read CLAUDE.md." It's: Long sessions where early context fades and recent task context dominates Complex multi-step operations where following the immediate subtask overrides background rules Code review agents that check structure and correctness, not cross-reference against policy documents Think of it this way: CLAUDE.md is like a company handbook. Hooks are like door locks. The h
Continue reading on Dev.to
Opens in a new tab


