Edit tool fails with 'File has been unexpectedly modified' immediately after Read

Resolved 💬 11 comments Opened Nov 25, 2025 by ManuelMRosa Closed Jan 31, 2026

Description

When attempting to edit a file immediately after reading it, the Edit tool fails with:

File has been unexpectedly modified. Read it again before attempting to write it.

This happens even when:

  1. The file was just read moments before
  2. No other processes are modifying the file
  3. Multiple retry attempts with fresh reads all fail

Steps to Reproduce

  1. Read a markdown file (e.g., SESSION_LOG.md)
  2. Immediately attempt to Edit the same file
  3. Error occurs even though file content hasn't changed

Environment

  • Claude Code version: Latest
  • Model: claude-opus-4-5-20250929
  • OS: Windows 10/11
  • File type: Markdown (.md)

Expected Behavior

Edit should succeed when file content matches what was just read.

Actual Behavior

Edit fails repeatedly claiming file was modified, even with immediate retry after fresh read.

Workaround

None found - had to abandon the edit operation.

---
Generated with Claude Code

View original on GitHub ↗

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