Claude Code Edited the Wrong File
Claude Code changed a file you didn't intend (lookalike name or it followed an import chain). Revert with git, then lock the boundary with permissions.deny Edit rules in .claude/settings.json.
Articles tagged with #Wrong edit
Claude Code changed a file you didn't intend (lookalike name or it followed an import chain). Revert with git, then lock the boundary with permissions.deny Edit rules in .claude/settings.json.
Composer rewrote 10+ files and broke working code. Revert fast with a Cursor checkpoint or git, then bound the prompt and mode so it stays surgical.
You @ one file and Cursor answers about a different same-named file. Fix the @-picker, stale index, and symlink causes with full-path references and a resync.
Claude Code + Codex (or two parallel sessions) edited the same function and produced a merge conflict. Isolate scopes with git worktrees, abort the broken merge, and resolve as a human — never let an agent merge.