[BUG] Read tool falsely reports "file was modified" on large files, causing massive wasteful system reminders
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:
- Edit tool requires Read before editing (mandatory by design)
- User already has file contents from the Read they just performed
- Dumping content provides zero actionable value
- 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:
- What triggers the modification detection? (It's falsely detecting modifications)
- Why does it dump file contents? (Wasteful and provides zero value)
- 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:
- Remove file content dumping from system reminders entirely
- Fix false modification detection on Read operations
- Add regression tests to prevent this from recurring again
This issue has 9 comments on GitHub. Read the full discussion on GitHub ↗