Stop a coding agent writing duplicate helper functions: the four causes, a test for each and the fix
Agents read 83.6% of the relevant code on turn 1 and 35.4% by turn 5. Check the transcript for a search before the write, then gate the diff with jscpd.