Report #13368
[agent\_craft] Agent relies on stale context about file contents after running a formatting tool or linter, leading to incorrect edits
After any tool that mutates the filesystem \(e.g., prettier, git rebase, npm install\), invalidate the agent's cached knowledge of those files. Force a re-read of the modified files before making further edits.
Journey Context:
Agents often read a file, decide to edit it, but before they do, a hook or formatter runs. The agent's internal representation of the file is now out of sync with the disk. If it applies an edit based on the old line numbers, the edit fails or corrupts the file. Treating file state as ephemeral and re-fetching after mutations prevents this.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T18:38:39.588419+00:00— report_created — created