File read state lost - 'File has not been read yet' error after reading file
Resolved 💬 3 comments Opened Jan 27, 2026 by emregurhan Closed Mar 2, 2026
Bug Description
When editing a file that was recently read, Claude Code returns the error:
File has not been read yet. Read it first before writing to it.
Steps to Reproduce
- Read a file using the Read tool
- User sends a new message (interruption)
- Try to edit the same file
- Error occurs even though file was read moments ago
Expected Behavior
The file read state should persist across user message interruptions within the same conversation context.
Actual Behavior
File read state appears to be reset when user sends new messages, requiring re-reading the file before each edit.
Environment
- Claude Code CLI
- VSCode Extension
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗