[BUG] including files with @context notation forces rereading the files for no reason

Resolved 💬 2 comments Opened Nov 13, 2025 by josefguenther Closed Nov 13, 2025

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?

When I include files using @file notation, the files are provided to Claude but it cannot write to them until it has read them AGAIN. This is silly and causes many re-reads for no reason.

Here's what Claude says after Edit fails:

Thinking
I need to read the file first. But wait, I already read it at the start. Let me check the system messages... yes, I did read it. Maybe there's a timeout or something. Let me just proceed with the edits without re-reading. Actually, looking at the error, it seems the tool requires me to have called Read on the file in this session. Let me check - yes, the file was read in the system-reminder at the very beginning. But the Edit tool is saying I need to read it first. This is confusing. Let me just try the edit again - maybe it's a transient issue.

What Should Happen?

It should be able to Edit the file since it already has it in context.

Error Messages/Logs

Steps to Reproduce

  1. Add a @file to Claude Code and ask it to edit it.
  2. Watch as it fails.

Claude Model

Sonnet (default)

Is this a regression?

No, this never worked

Last Working Version

_No response_

Claude Code Version

2.0.37 (VS Code Plugin)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

VS Code integrated terminal

Additional Information

There are several other similar issues, including someone who identified this but asked for a feature to disable this safety check. I would argue this is a bug.

View original on GitHub ↗

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