claude-code
claude-code copied to clipboard
Edit tool fails with 'File has been unexpectedly modified' immediately after Read
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