[BUG] Read tool outputting stale data
Claude Code Bug Report
Environment
- Platform (select one):
- [x] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [ ] Other: <!-- specify -->
- Claude CLI version: 1.0.43 (Claude Code)
- Operating System: macOS 15.5 (Darwin 24.5.0)
- Terminal: Terminal app
Bug Description
Claude Code's Read tool and bash commands are not (always) showing the actual current state of files that have been modified during the session. This seems to be a rare scenario, but when this happened the tools repeatedly showed a version of the file which is not reflected in the file system.
Steps to Reproduce
- Use Claude Code to edit a file and add debug print statements (e.g.,
print("DEBUG: some message")) - Later in the session Claude Code suggested an edit to remove these statements from the file
- The edits to remove the statements were NOT visible in the file system
- According to the read tool the edits were successfully removed, and I was not able to get Claude to see that his edits hadn't actually been made!
- Having tried multiple times to get Claude to re-read the file and pointing out to him that the code is still there, I concluded that the problem was not with the model but with the tool or a subsystem which is caching file data and has become out of sync with the OS file system
Actual Behavior
- The Read tool shows the file content without the recently added debug statements
- Bash grep commands return no results when searching for debug print statements
- External Git clients and text editors show the debug code is actually present in the file
- This creates a discrepancy where Claude Code cannot see its own recent modifications
Additional Context
This occurred while debugging an iOS Swift file where debug print statements were added using the Edit tool, but subsequent Read tool calls and bash grep commands couldn't find the added debug code. The debug statements were confirmed to be present when viewed in external tools like Git clients and Xcode.
This is a critical issue as it makes it impossible for Claude Code to accurately assess the current state of files it has modified.
The issue appeared to be related to file caching or synchronization between Claude Code's internal file representation and the actual file system state.
This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗