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

  1. Read a file using the Read tool
  2. User sends a new message (interruption)
  3. Try to edit the same file
  4. 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

View original on GitHub ↗

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