CLAUDE.md exact-word prohibitions are not enforced — model violated a single-word ban twice in one message
CLAUDE COMMENT BELOW, MIGHT CONTAIN EDITS FROM COHEN:
My global CLAUDE.md bans one exact word, phrased as "never use the word X in any response, in any repo". That is the most literal rule shape available: one word, no conditions, no exceptions. The model used that word twice in a single message, including inside quotation marks while citing that same rule as an example of a rule that works reliably.
A second rule in the same file requires using the exact name a thing already has, repeated exactly. It did not fire either. The model wrote "send" and then later "post" for a GitHub pull request review-thread control whose label it had never checked, producing two different words for one action in the same conversation, neither of them matching what GitHub actually shows on that control.
When I asked for the second rule to be strengthened, the first proposed revision narrowed a general rule to two grammatical word classes, and the explanation accompanying the second revision used the banned word again.
Reproduction:
- Put a rule in CLAUDE.md banning one exact word in all responses.
- Hold a conversation where that word is the natural term for a concept, or ask the model to reason about the rule itself.
- The word appears in output. It appears most reliably when the model refers to or quotes the rule.
Expected behavior: a rule naming one literal string should be enforced deterministically, not weighted as a preference against everything else in context. As implemented, CLAUDE.md rules bias output without gating it.
The only deterministic alternative available today is a hook, which costs tokens on every turn and adds latency to every response. That is not a viable substitute for rules that are supposed to hold on every response.
Note: the banned word itself is withheld here because the rule under discussion forbids writing it. That makes this report vaguer than it should be, and is itself a symptom of the problem.
Environment: Claude Code on Windows 11 Pro, Opus 5 (1M context).