claude-code - 💡(How to fix) Fix [Bug] Rewind/Compact prevents re-reading unchanged files removed from context [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#46749Fetched 2026-04-12 13:34:04
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Timeline (top)
labeled ×3commented ×1

Root Cause

Bug Description When using rewind or compact, if claude reads a file that was read before in the compacted/rewinded section, but is no longer in context because of the rewind/compact, the read tool doesn't read it due to "unchanged since last read". But the file is no longer in context. Looks like whatever mechanism tracks already read files doesn't get reset on compact or rewind.

RAW_BUFFERClick to expand / collapse

Bug Description When using rewind or compact, if claude reads a file that was read before in the compacted/rewinded section, but is no longer in context because of the rewind/compact, the read tool doesn't read it due to "unchanged since last read". But the file is no longer in context. Looks like whatever mechanism tracks already read files doesn't get reset on compact or rewind.

Side note: claude occasionally but not reliably works around this by using cat/sed instead

Environment Info

  • Platform: linux
  • Terminal: kitty
  • Version: 2.1.101

extent analysis

TL;DR

Resetting the mechanism that tracks already read files after compact or rewind operations may resolve the issue with claude not reading files due to "unchanged since last read".

Guidance

  • Investigate the implementation of the "unchanged since last read" mechanism to understand how it tracks files and how it can be reset after compact or rewind operations.
  • Verify if using cat/sed instead of the read tool consistently works around the issue, and if so, consider using this as a temporary workaround.
  • Check the documentation for claude version 2.1.101 to see if there are any known issues or configuration options related to file tracking and compact/rewind operations.
  • Test the behavior with different file scenarios to understand the conditions under which the issue occurs.

Example

No code snippet is provided as the issue does not contain sufficient information about the implementation details of claude.

Notes

The issue may be specific to the combination of claude version 2.1.101 and the linux platform, and may not occur in other environments.

Recommendation

Apply workaround: using cat/sed instead of the read tool, as it occasionally works around the issue, until a proper fix for the file tracking mechanism is implemented.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [Bug] Rewind/Compact prevents re-reading unchanged files removed from context [1 comments, 2 participants]