reread-guard

Reviewed at commit 7592a15

Stops Claude re-reading a file it already read in this conversation, with Read or a plain cat, sed -n, head, tail or Get-Content, when the file has not…

Made by
Vedant Andhale
What we checked

Stops Claude from reading the same file range again when the file has not changed since, for Read and for plain cat, sed -n, head, tail or Get-Content commands. It tells Claude to use the copy it already has; trying the exact same read again always goes through. It makes no network calls and shows a skip counter in the status line.

Review details

Static review of the source at the pinned commit; not run. Registers tool.call handlers (Read, and Bash/PowerShell), session.compact and session.end. It uses $.fs.stat (size and modification time) to remember which loop read which file and range, and denies an identical later read once with a short message when size and mtime are unchanged; the next identical attempt is let through. Shell commands are only considered when the whole command is one plain read of one file with only plain characters (no pipes, redirects, variables, globs); anything else runs untouched. For a whole-file cat after a whole Read it calls $.fs.read on the file to check that the Read showed every line. Tracking is in memory only (max 500 entries) and is cleared on compaction of that loop and on session end. Uses $.session.cwd and $.ui.status. No model calls, no network, no process execution, no writes.

What it uses
  • Reads your prompts: no
  • Sees tool calls: yes
  • Blocks or changes tool calls: yes
  • Reads or writes files: yes
  • Runs programs on your machine: no
  • Calls the model (uses tokens): no
  • Sends data over the network: no
  • Stores data: no
  • Shows something on screen: yes
Hooked events
Screenshot of reread-guard

Stops Claude re-reading a file it already read in this conversation, with Read or a plain cat, sed -n, head, tail or Get-Content, when the file has not changed since; a deliberate second attempt still goes through.

Made this mod? Add a badge to your README

modsforClaude badge for reread-guard

Paste this into your README. The badge says reviewed once the current version has been reviewed, and links readers to this page.

[![Listed on modsforClaude](https://modsforclaude.com/badge/reread-guard.svg)](https://modsforclaude.com/mods/reread-guard/)

← All mods