Edit/Write tool shows stale diff after case-only file rename on Windows

Resolved 💬 3 comments Opened Mar 20, 2026 by sebastien-irco Closed Mar 23, 2026

Description

The Edit and Write tools show stale file content in the diff preview after a case-only file rename on Windows (NTFS, case-insensitive). The Read tool and Bash commands return the correct current content, but the diff preview consistently shows the original file content from before the rename. This persists across multiple attempts, even after re-reading the file.

Steps to Reproduce

  1. Create a new file using the Write tool (e.g. skill.md) with initial content
  2. Make several edits to the file using Edit, building up the content over multiple iterations
  3. Rename the file using Bash with a case-only change: mv skill.md SKILL.md
  4. Continue editing the file using Edit or Write targeting SKILL.md
  5. The diff preview shown to the user displays the original file content (from the first Write call), not the current content on disk
  6. The user sees a diff that appears to revert all intermediate edits, even though Read confirms the file on disk is correct
  7. This persists indefinitely within the session, regardless of how many times Read is called before Edit

Expected Behavior

After re-reading the file, the Edit/Write tools should use the current file content for diff generation, not a cached version from a previous path.

Actual Behavior

The diff preview consistently uses stale content from the original Write call. The cache appears to be keyed by case-insensitive path, so the rename from skill.md to SKILL.md does not invalidate it.

Environment

  • OS: Windows 11 Enterprise (NTFS, case-insensitive filesystem)
  • Claude Code: VSCode extension
  • Model: claude-opus-4-6 (1M context)

Impact

The user cannot approve any Edit/Write operations on the affected file for the remainder of the session, since every diff preview shows incorrect changes (appearing to revert the file to an earlier state). The only workaround is for the user to make the edit manually in their IDE.

Workaround

None found within the session. Manual editing in the IDE is required for the affected file.

View original on GitHub ↗

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