CLAUDE.md 'Rules' are treated as suggestions, not enforced
Problem
Claude Code allows users to define rules in CLAUDE.md and ~/.claude/rules/, but Claude treats these as suggestions rather than binding rules. Claude will ignore them when it "feels confident" about an answer.
Example
User has a rule: "Always search Graphiti (personal knowledge base) before answering knowledge questions"
What happens:
- User asks a knowledge question
- Claude answers directly from training data - ignoring the rule
- User has to manually remind Claude to follow the rule
- Only then does Claude comply
Why This Matters
- Users invest significant time crafting rules to customize Claude's behavior
- The word "rules" implies they will be followed
- Currently, the only way to enforce behavior is through hooks
- But hooks can only intercept tool calls, not pure text responses
Current Workarounds (All Inadequate)
- PreToolUse hooks: Only trigger on tool calls, not on text-only responses
- Stop hooks: Can block completion, but adds overhead to every response
- System reminders: Claude ignores these too when "confident"
Proposed Solutions
Option A: Rename "rules" to "preferences" or "suggestions" to set correct expectations
Option B: Add a mechanism to make specific rules binding (e.g., !!rule syntax = must follow)
Option C: Add a PreAssistantResponse hook type that can intercept/block responses before they're sent
Option D: Built-in rule enforcement where Claude is architecturally required to check rules before responding
Environment
- Claude Code version: 2.1.12
- Model: Claude Opus 4.5
- OS: macOS
User Impact
User quote: "I've spent weeks trying to teach Claude to follow rules. It just ignores them. If they're not actually rules, don't call them 'Rules'."
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗