Auto-detect external file changes between turns

Resolved 💬 3 comments Opened Mar 3, 2026 by owengong Closed Mar 7, 2026

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

When I'm collaborating with Claude on a file — Claude makes an edit, then I manually tweak a few lines
before continuing — Claude doesn't detect my changes. It continues working from its stale mental model and
either overwrites my edits or gets confused by the mismatch.

The current workflow requires me to manually tell Claude "I edited that file, re-read it before
continuing" every time. This adds friction to the most natural collaborative editing pattern: Claude
writes, I adjust, we continue.

Proposed Solution

After Claude edits a file, store its hash or mtime. Before Claude's next turn, check if the file changed
externally. If it did, automatically re-read only that file and surface the user's changes as context
(e.g., "Note: user modified lines 12-15 of plan.md since your last edit").

This should be cheap — stat() for mtime is basically free, and you only re-read the 1-2 files that
actually changed. Claude already knows what it wrote (conversation history), and the filesystem knows
current state. The delta is necessarily the user's changes.

Alternative Solutions

Currently I work around this by explicitly telling Claude "I edited the file, re-read it" before
continuing. This works but adds friction every time. A prompt-submit hook could theoretically detect
changes, but this feels like it should be built in since the data is already available.

Priority

High - Significant impact on productivity

Feature Category

CLI commands and flags

Use Case Example

  1. I ask Claude to write an implementation plan to plan.md
  2. Claude writes the plan
  3. I read it and manually adjust a few sections — reword a step, remove something unnecessary
  4. I prompt Claude to "continue implementing"
  5. Claude works from the version it wrote, not my updated version — it may overwrite my changes or produce

code that doesn't match the plan I actually want

  1. With this feature, Claude would automatically detect that plan.md changed, re-read it, and work from my

version

Additional Context

This is especially common in plan mode where Claude writes a plan file and the user wants to tweak it
before execution. But it applies to any collaborative editing — code files, configs, etc. The pattern of
"AI writes, human adjusts, AI continues" should just work without manual re-read prompts.

View original on GitHub ↗

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