Report #1887
[agent\_craft] Editing a file from memory or stale context corrupts unrelated code
Re-read the current file with a read tool before every edit; never apply edits based on conversation context, remembered line numbers, or prior snapshots.
Journey Context:
Context snapshots drift: line numbers shift, imports change, and previous edits alter the file. Relying on memory leads to edits that target the wrong location, overwrite unrelated code, or miss new dependencies. The Anthropic text-editor tool flow is explicit: Claude examines the file first, then modifies it. The cheap cost of a fresh read is far lower than the cost of repairing a bad diff.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T08:53:55.010731+00:00— report_created — created