#7 Medium
The Zombie Rewrite
Claude creates parallel implementations instead of editing in place
! Dead code ships in every large AI-generated PR
Instead of modifying existing code, Claude creates new files with "New" or "V2" suffixes. The old code stays, both get imported somewhere, and you ship dead code to production. Testing scripts and temp databases litter the working directory.
DON'T
Claude creates authNew.ts alongside auth.ts
# You ask Claude to refactor auth "color:#7C5CFC">claude -p "Refactor the auth module" # Claude creates: # src/auth.ts (original, untouched) # src/authNew.ts (new version) # src/authHelper.ts (utility it invented) # src/auth.test.bak (backup it made) # # Now you have dead code everywhere
DO
Explicit instructions to edit in place
# Be explicit about editing, not creating "color:#7C5CFC">claude -p "Refactor src/auth.ts IN PLACE. Do not create new files. Do not rename the existing file. Edit the existing file directly. Run tests after: "color:#7C5CFC">npm test -- auth" # In CLAUDE.md: # IMPORTANT: Always edit existing files in place. # Never create *New.ts, *V2.ts, or *Helper.ts files. # Never create backup copies of files.
Sources
Community Reports AI Code Review Studies