[Bug] Edit tool cache not invalidated across conversation sessions

Resolved 💬 3 comments Opened Nov 29, 2025 by scottmdufour-ship-it Closed Jan 29, 2026

Bug Description

Edit Tool Cache Bug: "File has been unexpectedly modified" in Continued Conversations

Summary

The Edit tool fails with error "File has been unexpectedly modified. Read it again before attempting to write it." when attempting to edit files in a resumed conversation (after context limit/summarization), even though the files have not actually been modified.

Root Cause: Edit tool caches file metadata (likely modification time) across conversation sessions and does not invalidate this cache when a conversation is continued after summarization.

Impact: Makes it impossible to edit previously-accessed files in long conversations, forcing workarounds.

---

Environment

  • Claude Code Version: [User to fill in]
  • OS: Windows 10/11
  • Model: Claude Sonnet 4.5 (claude-sonnet-4-5-20250929)
  • Conversation Type: Continued session after context limit reached

---

Reproduction Steps

Prerequisites

  1. Start a conversation
  2. Read and/or edit a file (e.g., docs/myfile.md)
  3. Continue working until context limit is reached
  4. Conversation gets summarized and continued in new session

Steps to Reproduce

  1. In the continued session, attempt to edit the previously-accessed file:

``
Read("docs/myfile.md")
Edit("docs/myfile.md", "old text", "new text")
``

Expected Behavior

Edit should succeed since the file was just read in the current conversation turn.

Actual Behavior

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

Environment Info

  • Platform: win32
  • Terminal: windows-terminal
  • Version: 2.0.55
  • Feedback ID: 05ecc90e-3ce3-49f6-833d-aaa8336f3623

Errors

[]

View original on GitHub ↗

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