
Opus 5: watch out for contradicting instructions
TL;DR: if two instructions in your CLAUDE.md contradict, Opus 5 picks whichever one sits lower in the file (or more accurately: whichever is more recent) and drops the other.
longer version:
opus 5 wont flag a contradiction or split the difference. It picks one rule, commits to it, and you find out which rule was followed by reading the actual diff. In Opus 5 position decides which one it keeps: the rule lower in the file (read most recently) governs, the earlier one is ignored, so the rule you put first is sitting in the weakest spot from this perspective.
Now the fun(?) part: older models used to waver* between two fighting instructions, and that was a tell that something was off. Opus 5 however works a bit differently, it will confidently resolve the contradiction (mostly wrongly) and commit way harder to it, so the telltale goes away. The built in model level judge is just confidently wrong (well, debatable, it's not the model is wrong, the instructions are contradicting).
these rarely look like "do X" right above "dont do X". Usually present as:
- same subject under two headings (Testing vs CI)
- different words for the same thing (never use mocks vs wrap calls in a fake)
- a general rule and an exception written like a new topic
- root CLAUDE.md vs a nested src/CLAUDE.md
you can catch it more easily by reading from top to bottom. Grab two rules that touch the same thing (tests, deps, what ships without review) and ask: can both be true at once? if not, opus 5 will chose for you and you're not gonna like it.
*waver: two contradicting instructions leave the distribution over next actions relatively flat, with neither strongly peaked, so which instruction gets sampled swings with temperature and tiny context shifts. It is sampling variance: a flat distribution resolves to a different winner each run.
Disclaimer: I'm working on deterministic instruction diagnostics and evals, the observed behaviors are coming from controlled experiments, the frequent "hiding" places are coming from a large corpus analysis (source: https://www.reddit.com/r/ClaudeCode/comments/1srm2vv/we_analyzed_12356_repos_with_claudemd_files/ )