Comment by mbb70

10 hours ago

Probably it actually ran git checkout or reset. As you say git revert only operates on committed snapshots so it will all be in the reflog

Yes, this exact scenario has happened to me a couple times with both Claude and Codex, and it's usually git checkout, more rarely git reset. They immediately realize they fucked up and spend a few minutes trying to undo by throwing random git commands at it until eventually giving up.

  • Yeap - this is why when running it in a dev container, I just use ZFS and set up a 1 minute auto-snapshot - which is set up as root - so it generally cannot blow it away. And cc/codex/gemini know how to deal with zfs snapshots to revert from them.

    Of course if you give an agentic loop root access in yolo mode - then I am not sure how to help...