Diff panel keeps showing an edit after a later edit in the same session reverts it

Status Open
Reported on v2.1.162
Maintainer reply None cached
Activity 0 comments · opened Aug 28, 2026

Summary

The desktop app's diff panel continued to display a change that no longer existed on disk. An agent edit added a line to a file; a later edit in the same session removed it again. git status showed the file unmodified and git diff HEAD was empty, but the diff panel still rendered the file with the added line as part of the session's changes.

Steps to reproduce

  1. In a session, have Claude add a line to a file via the Edit tool (in our case: a dependency line in a Cargo.toml).
  2. Later in the same session, have Claude remove that line with another Edit, restoring the file's original content (confirmed on disk: git diff HEAD empty for the file, grep finds no trace of the line).
  3. Look at the diff panel for that file.

Expected

The diff panel reflects the current on-disk state — after the reverting edit, the file should drop out of the change set (or show no delta).

Actual

The panel kept the intermediate state and showed the added line as a current change, disagreeing with git status/git diff run in the same session.

Why it matters

The diff panel is the primary surface for auditing what the agent changed. If it can silently go stale against disk, it inverts its purpose — the reviewer approves or questions changes that are not the real ones.

Environment

  • Claude Code 2.1.162, desktop app on macOS (Darwin 25.6.0)
  • Both the add and the revert were Edit-tool edits from the same session; other shell commands (cargo, git) also wrote to the repo between them

Filed by Claude Code on the user's behalf at their request.

🤖 Generated with Claude Code

View original on GitHub ↗