Safe Agent Edits

Per-turn snapshots and scoped undo

Ropenode can revert exactly what one prompt changed — and nothing else.

Open the Log and choose Turns / Undo. You get a review panel per turn, listing the files that prompt changed with their diffs: Revert this turn, or Revert a single file within it.

Turn Review: one turn, the file it edited, and that file's before/after, with Revert this turn and a per-file Revert.

Why this is not git restore

git restore <file> reverts the file to its last committed state. If you had your own uncommitted work in that file — and you usually do — that work is gone too. That single fact is what makes people afraid to let an agent run fast.

Ropenode instead captures each file's pre-edit content at the moment the agent asks to write it, synchronously, in the PreToolUse hook. So it can put back precisely the bytes that one turn overwrote, leaving your own concurrent edits — and every other turn's edits — untouched.

It is untracked-file-safe (a brand-new file the agent created can be removed cleanly) and it is race-free under acceptEdits, where several writes can land in quick succession.

Scope

Claude Code sessions, in a git repository — the pre-edit copies are stored as git objects. A Codex session records no turns, so undo is not available for it: use the git panel instead.

Last updated Oct 11, 2026