Edit tool falsely claims 'File has been unexpectedly modified' on Opus 4.5
Resolved 💬 4 comments Opened Dec 1, 2025 by eldoclimber Closed Feb 8, 2026
Environment
- Claude Code with Opus 4.5 (claude-opus-4-5-20251101)
- Platform: win32 (MSYS_NT-10.0-26100)
Steps to Reproduce
- Check file hash and modify time:
md5sum file && stat file - Use Read tool to read the file
- Immediately check hash and modify time again (identical - file unchanged)
- Use Edit tool with valid old_string that exists in the file
- Edit fails with 'File has been unexpectedly modified'
Evidence
- File:
H:/skydiving-manifest/src/ManifestApp.Client/Pages/Login.razor - MD5 hash before Read:
fe48316a07481bc25545326baa745bac - MD5 hash after Read:
fe48316a07481bc25545326baa745bac(identical) - Modify time before:
2025-11-30 23:32:47.746767100 -0700 - Modify time after:
2025-11-30 23:32:47.746767100 -0700(identical) - Only Access time changed (expected behavior for a read operation)
Observed Behavior
The Edit tool rejects the edit claiming the file was modified, even though:
- The file content hash is identical
- The file modify timestamp is identical
- No external processes modified the file (VS Code closed, File Explorer closed)
Expected Behavior
Edit should succeed since the file contents match what was read.
Additional Context
- User reports this issue started occurring with Opus 4.5
- Issue is reproducible across multiple files in the same session
- The Write tool also fails with 'File has not been read yet' immediately after a successful Read
- Workaround using bash heredoc (
cat > file << 'EOF') works, suggesting the issue is in the Edit/Write tool's internal state tracking, not file system permissions
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗