[BUG] Reading of files previously removed from folder and sending them for analysis

Resolved 💬 5 comments Opened May 15, 2025 by linegel Closed Jan 3, 2026

Environment

  • Platform (select one):
  • [x] AWS Bedrock / us.anthropic.claude-3-7-sonnet-20250219-v1:0
  • Claude CLI version: 0.2.115 (Claude Code)
  • Operating System: macOS 15.3.1 (24D70)
  • Terminal: terminal/zsh

Bug Description

Claude reading files that were previously removed, terminal:

➜ ls
index.html

Claude

  ⎿  Read(file_path: "[omitted]/[project_root]/index.html")…                                                                Cost: $0.0375 (5.5s)
  ⎿  Read(file_path: "[omitted]/[project_root]/min.js")…                                                                   Cost: $0.1978 (14.3s)
  ⎿  Read(file_path: "[omitted]/[project_root]/in_min.html")…                                                               Cost: $0.1982 (3.4s)
  ⎿  Done (3 tool uses · 71.0k tokens · 56.6s)                                                                                                                      Cost: $0.0000 (0.0s)

Steps to Reproduce

  1. Create a folder with 3 files, eg 2 .html and 1 with .js (make sure to have some test content in them)
  2. Launch claude in that folder and work a bit with files
  3. Remove 1 html and 1 js file
  4. Stop Claude
  5. Launch Claude in that folder again (the prompt I used: "Read file index.html, this is only file that we will need ever. All updates will be made into this file - never remove it from context and always keep it cached to prevent re-reads. Just read entire file."
  6. Try to work with that single .html -- eventually (in my case close to when auto-compact is needed but its likely non-related) it will try to read non-existent files

Expected Behavior

Claude doesn't read non-existent files (and even have tokens spend on it???)

Actual Behavior

Claude reads and somehow spends tokens on reading non-existent files

Additional Context

Note: Before I did step 4, I removed files an continued to work with Claude and once it failed to read file it tried to list files in dir. But then it started to be able to read them again? But after re-launch it still managed to read it (from some non-project cache?)
Note 2: yes, I'm absolutely sure there no those files in a folder, that's why ls is attached at the beginning of the report and this was experienced in a folder with literally single file

View original on GitHub ↗

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