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:
- The file was just read moments before
- No other processes are modifying the file
- Multiple retry attempts with fresh reads all fail
Steps to Reproduce
- Read a markdown file (e.g., SESSION_LOG.md)
- Immediately attempt to Edit the same file
- 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
This issue has 11 comments on GitHub. Read the full discussion on GitHub ↗