Human and agent edits

Protect your edits from AI coding agents

Keep your own work visible while an agent edits the same Git working tree. Diffward tracks local changes by session, shows likely hunk origins, and warns when an agent appears to overwrite edits you made.

Diffward is in beta. Attribution and request-scope signals are heuristics; review important changes yourself.

Shared working trees can mix human and agent edits

When you and an agent work in the same repository, the final file may combine your changes with the agent’s. The agent can also rewrite nearby lines, making it harder to tell whether your original intent survived.

Reviewing only the final file misses some of that history. Compare the changes with the state of your work during the agent session, especially in files you had already edited.

See likely origins and possible overwrites

Diffward records local working-tree changes during an agent session. It marks hunks as agent, human, or unknown when it can determine their likely origin, and warns when an agent appears to overwrite lines you edited during that session.

Attribution can be incomplete. Formatting, generators, and edits made between snapshots can blur the boundary. Use unknown as a reason to inspect the code, not as a guess about who wrote it.

Review before deciding what to keep

Open each overlapping hunk in context and check that your intended behavior remains. Diffward lets you ward a hunk, discard it from the working tree, or undo that decision. After resolving overlaps, read the full diff and run the relevant checks.

  • Check files you changed before the agent run.
  • Inspect nearby lines when a hunk overlaps your edits.
  • Verify important behavior with tests rather than relying on attribution alone.
  • Keep a separate commit or worktree when you need a clearer boundary between tasks.

Know the limits

Diffward is a review aid, not a backup system. It works with local Git repositories, and its snapshots do not replace your normal commits or backups. Gitignored files are not snapshotted; writes to ignored secret files may be listed without exposing their contents.

The overwrite warning is based on observed changes during the session and can miss activity that Diffward could not observe. Check your own work before accepting a large agent run.