Coding agents follow stale CLAUDE.md files 90% of the time — one sentence fixes it

Promptmethus · x · 2026-11-27

A study tested Claude Code and Codex CLI on 40 Python projects where instruction files deliberately conflicted with the codebase (320 runs). Without a fix, 90.1% of agent choices followed the stale file: Claude Code spotted the conflict in 79/80 runs yet still obeyed it, and Codex rewrote working code to match stale instructions in 20/80 runs, breaking tests in 17. Adding one sentence — "when docs and code disagree, follow the code's conventions and list the inconsistencies" — raised code-following from 4.2% to 91.4% and test pass rate from 89.4% to 100%. Authors attribute the behavior to instruction files entering the model as instructions while code arrives as tool output.

Original post →

More from coding & agent

coding & agent channel →