News for hackers. Stuff that matters.
Re:We Put Claude Code in Rollercoaster Tycoon by diath on Saturday January 17, 2026 @12:36PM (#46660019)
> Yet another reason to use Jujutsu

And what would that reason be? You can git revert a git revert.

Re:We Put Claude Code in Rollercoaster Tycoon by jsnell on Saturday January 17, 2026 @01:08PM (#46660341)
You're correct for an actual git revert, but it seems pretty clear that the original authors have mangled the story and it was actually either a "git checkout" or "git reset". The "file where 1-2 hours of progress had been accumulating" phrasing only makes sense if those were uncommitted changes.

And the reason jj helps in that case is that for jj there is no such thing as an uncommitted change.

Re:We Put Claude Code in Rollercoaster Tycoon by block_dagger on Saturday January 17, 2026 @02:04PM (#46660931)
Having no such thing as an uncommitted change seems like it would be a nightmare, but perhaps I'm just too git-oriented.
Re:We Put Claude Code in Rollercoaster Tycoon by steveklabnik on Saturday January 17, 2026 @03:11PM (#46661577)
Things like the index become a workflow pattern, rather than a feature, if that makes any sense.
Re:We Put Claude Code in Rollercoaster Tycoon by eru on Saturday January 17, 2026 @10:04PM (#46664465)
> Having no such thing as an uncommitted change seems like it would be a nightmare, but perhaps I'm just too git-oriented.

Why? What's the problem you see? The only problem I see is when you let these extra commits pollute the history reachable from any branch you care about.

Let's look at the following:

Internally, 'git stash' consists of two operations: one that makes an 'anonymous' commit of your files, and another that resets those files to whatever they were in HEAD. (That commit is anonymous in the sense that no branch points at it.)

The git libraries expose the two operations separately. And you can build something yourself that works similarly.

You can use these capabilities to build an undo/redo log in git, but without polluting any of the history you care about.

To be honest, I have no clue how Jujutsu does it. They might be using a totally different design.

Re:We Put Claude Code in Rollercoaster Tycoon by fragmede on Sunday January 18, 2026 @12:15AM (#46664979)
> perhaps I'm just too git-oriented.

The problem is git's index let's you write a bunch of unconnected code, then commit it separately. To different branches, even! This works great for stacking diffs but is terribly confusing if you don't know what you're doing.

Re:We Put Claude Code in Rollercoaster Tycoon by eru on Sunday January 18, 2026 @02:02AM (#46665458)
Well, git doesn't really commit 'to' a branch.

You just build commits, and then later on you muck around with the mutable pointers that are branches.

Re:We Put Claude Code in Rollercoaster Tycoon by fragmede on Wednesday January 21, 2026 @12:27PM (#46708676)
How "to" do you want to make it? That description's totally disingenuous.

"later on" makes it sound to a human like it takes any real amount of time or that it isn't basically instant and wrapped by up porcelean, and "muck around with" implies that there's anything more random or complicated to it then writing the sha to a file in the right place in the .git directory.

Re:We Put Claude Code in Rollercoaster Tycoon by MarkMarine on Saturday January 17, 2026 @02:35PM (#46661275)
Also JJ undo is there and easy to tell the model to use, I have it in my Claude.md
Re:We Put Claude Code in Rollercoaster Tycoon by hu3 on Saturday January 17, 2026 @04:58PM (#46662520)
surely Claude is much better at using git because of the massive training data difference.

If it didn't undo git, it would do it with JJ either.

Re:We Put Claude Code in Rollercoaster Tycoon by Filligree on Saturday January 17, 2026 @11:09PM (#46664710)
It does fine with jj. Sometimes better, because jj is much easier to use non-interactively.
Re:We Put Claude Code in Rollercoaster Tycoon by hu3 on Monday January 19, 2026 @10:30AM (#46680071)
what do you mean non-interactively? Claude is great with git in command-line.
Re:We Put Claude Code in Rollercoaster Tycoon by MarkMarine on Monday January 19, 2026 @11:27PM (#46687911)
Actually I find it better with JJ. I have context7 mcp to help with commands and I’ve got an explicit Claude.md to direct it, but it’s more ambitious running stacked PRs and better at resolving conflicts.
Re:We Put Claude Code in Rollercoaster Tycoon by mbb70 on Saturday January 17, 2026 @01:02PM (#46660280)
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
Re:We Put Claude Code in Rollercoaster Tycoon by ewoodrich on Saturday January 17, 2026 @02:26PM (#46661188)
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.
Re:We Put Claude Code in Rollercoaster Tycoon by foobar10000 on Saturday January 17, 2026 @03:28PM (#46661713)
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...