[BUG] Write/Edit tools hang indefinitely when target file is deleted from disk while open in VS Code
Open 💬 0 comments Opened Jun 25, 2026 by MrRousek
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Title: Write/Edit tools hang indefinitely when target file is deleted from disk while open in VS Code
---
Environment
- Claude Code: VSCode Extension
- OS: Windows 10
- Model: claude-sonnet-4-6
Steps to Reproduce
- Open a file in VS Code (file exists on disk)
- Delete the file from disk without closing the VS Code tab
- Ask Claude Code to edit or write to that file
- Observe Claude Code hanging with no response
Expected BehaviorWrite/Edit tool returns a clear FileNotFoundException error immediately. Claude reports to the user that the file no longer exists on disk.
Actual Behavior
ide_opened_filecontext in the system prompt still shows the file as open — Claude assumes the file exists- First
Readcall succeeds from cache (returns content without hitting disk) - Subsequent
Readreturns"Wasted call — file unchanged since your last Read"— cache hit again, disk not checked Write/Editcall hangs indefinitely with no timeout and no error message- User sees Claude silent for several minutes with no indication of what is wrong
Root Cause (two separate defects)
Readtool does not invalidate its cache when the underlying file is deleted from disk — stale cache gives false confidence the file existsWrite/Edittool has no timeout and does not surface a file-not-found error — it simply hangs
Workaround
Close the file tab in VS Code before deleting it from disk, or ask Claude to write to a different path.
What Should Happen?
-
Error Messages/Logs
-
Steps to Reproduce
-
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
last
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_