Problem
One bad agent turn can wreck a previously-good working tree, and recovery means reading the whole diff and untangling it by hand. #93 (reflog undo) covers destructive git actions — agent file edits never touch the reflog.
Proposal
- After each completed ACP turn (turn boundaries are explicit in
chat.ts runTurn), snapshot the worktree's state to a hidden ref (git stash create-style dangling commit — no working-branch pollution, no index disturbance).
- A timeline on the chat panel: each turn is a restore point; "Restore to before turn N" resets the working tree (with a confirm showing what would be lost).
- Auto-prune snapshots (keep last N per session, drop on worktree delete).
- Terminal-mode agents get best-effort snapshots on output-idle boundaries.
Together with #93 this makes "let the agent try something" genuinely safe — the worktree-first equivalent of an editor's undo stack.
Problem
One bad agent turn can wreck a previously-good working tree, and recovery means reading the whole diff and untangling it by hand. #93 (reflog undo) covers destructive git actions — agent file edits never touch the reflog.
Proposal
chat.tsrunTurn), snapshot the worktree's state to a hidden ref (git stash create-style dangling commit — no working-branch pollution, no index disturbance).Together with #93 this makes "let the agent try something" genuinely safe — the worktree-first equivalent of an editor's undo stack.