[Bug] Claude does not verify file edits applied correctly — blind edit-and-proceed

Resolved 💬 13 comments Opened Mar 10, 2026 by VoxCore84 Closed May 7, 2026

Blind File Edits — No Post-Edit Verification

Phase: Execution (Phase 3 in the failure chain documented in #32650)

Description

When Claude uses file editing tools (string replacement, line-targeted edits, regex-based modifications) to apply code changes, it does not read the file back afterward to verify the edit applied correctly. It assumes the tool succeeded and proceeds to the next step or reports completion.

Failure modes include:

  1. Target block not found — the edit tool silently fails to match (e.g., whitespace differences, the code was already modified, or the match string is ambiguous). Claude doesn't notice the file is unchanged.
  2. Wrong block matched — in files with similar patterns, the edit matches an unintended location. Claude doesn't verify which occurrence was modified.
  3. Partial application — a multi-part edit where some replacements succeed and others don't. Claude reports the full edit as complete.

Expected Behavior

After applying a file edit, Claude should:

  1. Read back the modified section of the file
  2. Verify the intended change is present
  3. Verify no unintended changes were introduced (especially for regex-based edits)
  4. Only then proceed to the next step or report success

This is the file-editing equivalent of the "per-step verification gate" described in #32293 — each edit is a step that should be verified before proceeding.

Why This Is Distinct

  • #32289 covers generating incorrect code (the artifact itself is wrong)
  • #32293 covers lack of verification between sequential steps (like SQL files)
  • This issue covers lack of verification of the edit operation itself — the code may be correct but the application may have failed silently

Impact

In a large codebase (~2M LOC), files often contain similar patterns (boilerplate, repeated structures, template instantiations). A regex or string replacement intended for one function can silently match another. Without read-back verification, these misapplied edits become latent bugs that surface much later — often in a completely different session, making them extremely difficult to trace back to the faulty edit.

Related Issues

  • #32293 — No per-step verification gates
  • #32289 — Generates incorrect code and reports complete
  • #32295 — Silently skips verification steps
  • #32650 — Meta-issue (Phase 3 addition)

Environment

  • Claude Code 2.1.71
  • Windows 11
  • Large C++ codebase (~2M LOC)

View original on GitHub ↗

This issue has 13 comments on GitHub. Read the full discussion on GitHub ↗