[BUG] Read tool falsely reports "file was modified" on large files, causing massive wasteful system reminders

Status Closed — not planned
Maintainer reply None cached
Activity 9 comments · opened Oct 15, 2025 · closed Feb 1, 2026

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?

Bug Summary:
When using the Read tool on large files (400+ lines), Claude Code generates a system reminder claiming the file "was modified, either by the user or by a linter" and dumps hundreds of lines of file content. The file was NOT actually modified - verified by filesystem timestamps and git status.

Impact:

  • Wastes tokens by duplicating entire file contents user just read
  • Happens specifically on large files where token cost is highest
  • Makes working with large codebases expensive and frustrating
  • Provides zero value (Edit tool already requires re-reading before edits)

Versions Affected:

  • v2.0.13, v2.0.14, v2.0.15, v2.0.17 (regression, this specific message about the file being modified is from 2.0.17)
  • v2.0.10 did NOT have this issue (system reminders didn't charge tokens) though it DOES dump the file contents under a DIFFERENT reason.
  • Similar issues reported pre-2.0.10, so this is a recurring regression

What Should Happen?

System reminders should NEVER dump file contents because:

  1. Edit tool requires Read before editing (mandatory by design)
  2. User already has file contents from the Read they just performed
  3. Dumping content provides zero actionable value
  4. It's pure redundant information that wastes tokens

If file was actually modified:

  • Show small notification: "File modified since last read - re-read required before editing"
  • Don't dump content (user must re-read anyway per Edit tool requirement)

If file was NOT modified (this bug):

  • Don't show anything OR
  • Fix the false modification detection

Error Messages/Logs

<system-reminder>
  /home/acidtech/omniclaude/docs/ARCHITECTURE.md was modified, either by the user or by a linter.
  This change was intentional, so make sure to take it into account as you proceed (ie. don't revert
  it unless the user asks you to). Don't tell the user this, since they are already aware. Here are
  the relevant changes (shown with line numbers):
      42→│   ├── constants.py       # System constants and limits
      43→│   └── paths.py           # PathManager singleton
      44│├── core/                   # Core Business Logic
      45│   ├── session_manager.py # Session lifecycle management
      46│   └── logging.py         # Centralized logging system
      [... continues for hundreds of lines ...]
  </system-reminder>

  Verification the file was NOT modified:
  - Filesystem timestamp: unchanged
  - Git status: clean
  - All hooks/linters: disabled/uninstalled for testing
  - Nothing touched the file

Steps to Reproduce

Files that trigger false "modified" reminder:

  • ✅ Large files (400+ lines): ARCHITECTURE.md, posttooluse.py (336 lines)
  • ❌ Small files (dozen lines): No false reminder
  • Unknown: Whether file must be git-tracked

Files that DON'T trigger it:

  • Small test .py files (12 lines)
  • Small tracked files

Why This Matters

The searchable string for developers:
"was modified, either by the user or by a linter"

This exact text appears in the system reminder. Developers should be able to search your codebase for this string and find where this message is generated, then identify:

  1. What triggers the modification detection? (It's falsely detecting modifications)
  2. Why does it dump file contents? (Wasteful and provides zero value)
  3. Why was this fixed in 2.0.10 but regressed in 2.0.13+? (Root cause never addressed)

Claude Model

Sonnet (default)

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.0.10

Claude Code Version

2.0.17

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

WSL (Windows Subsystem for Linux)

Additional Information

  • Filed multiple issues across v2.0.13, 2.0.14, 2.0.15, 2.0.17 - no action taken
  • 4 releases with this bug still present
  • This is a recurring regression - similar issues reported before 2.0.10
  • v2.0.10 fixed it (system reminders didn't charge tokens), but 2.0.13+ regressed
  • Makes Claude Code expensive/impractical for codebases with large files

---
Suggested Fix:

  1. Remove file content dumping from system reminders entirely
  2. Fix false modification detection on Read operations
  3. Add regression tests to prevent this from recurring again

View original on GitHub ↗

9 Comments

github-actions[bot] · 12 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/9331
  2. https://github.com/anthropics/claude-code/issues/4464
  3. https://github.com/anthropics/claude-code/issues/9388

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

kolkov · 12 months ago

I think this has been the case for quite some time now, not since 2.0.10... Anthropic is really getting on my nerves with their vibe coding...

acidtech · 12 months ago

Kolkov, I know it happened before in the past. There are old issues pointing to the same problem, BUT I specifically tested 2.0.10 and it does NOT happen(no excessive token usage) though it DOES dump the originalFile: in the jsonl log. So its ANOTHER regression of the same problem you've probably seen before in the past.

github-actions[bot] · 10 months ago

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

vhq5z6hn5w-coder · 9 months ago

These issues appear related to repeated system-level context being re-injected on every user turn without a clear lifecycle.
Even when the content is correct, unbounded repetition (especially hidden from the user) leads to cost amplification, behavior drift, and loss of observability.
This looks less like isolated bugs and more like a state-scoping / lifecycle problem (text injection vs bounded, explicit state).

vhq5z6hn5w-coder · 9 months ago
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

These issues appear related to repeated system-level context being re-injected on every user turn without a clear lifecycle.
Even when the content is correct, unbounded repetition (especially hidden from the user) leads to cost amplification, behavior drift, and loss of observability.
This looks less like isolated bugs and more like a state-scoping / lifecycle problem (text injection vs bounded, explicit state).

github-actions[bot] · 8 months ago

This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.

marcindulak · 8 months ago

This issue was closed incorrectly despite recent human comments. This behavior of the bot is reported at https://github.com/anthropics/claude-code/issues/16497. Please upvote that issue, so maybe it gets noticed.

github-actions[bot] · 8 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.