News for hackers. Stuff that matters.
Re:Claude Code Checkpoints by mhast on Thursday August 28, 2025 @08:41AM (#45051448)
Git won't catch new files the agent is adding. To get around that you can of course always add all new files, but then you'll potentially have your repo polluted with a bunch of temporary scratch files instead.

You can typically go back and edit git history. But it will require force push and breaking changes. And a few sacrifices to ensure that it doesn't make a mistake because then your repo is potentially broken.

Best way to do that is probably to have it work on branches and then squash merge those.

Re:Claude Code Checkpoints by fprotthetarball on Thursday August 28, 2025 @09:16AM (#45051784)
> Git won't catch new files the agent is adding.

Another problem I inadvertently dodged by using Jujutsu with Claude Code :)

I tend to send a lone "commit" message to Claude when I think I'm in a spot I may want to return to in the future, in case the current path doesn't work out. Then Claude commits it with a decent message. It knows how to use jj well enough for most things. Then it's really easy to jj new back to a previous change and try again.

Re:Claude Code Checkpoints by stavros on Thursday August 28, 2025 @05:07PM (#45057053)
I sometimes use jj in watcher mode and then just use the oplog to go back to wherever.
Re:Claude Code Checkpoints by black_knight on Thursday August 28, 2025 @09:55AM (#45052246)
I always squash and reorganise the commits from aider. It is however awesome that everything is in git directly from the agent. I can’t imagine why not all these tools do this!
Re:Claude Code Checkpoints by fluidcruft on Thursday August 28, 2025 @08:55AM (#45051602)
You could also create a branch, save your intermediates there, and then squash merge when you are ready.
Re:Claude Code Checkpoints by winter_blue on Thursday August 28, 2025 @09:36AM (#45051993)
Yup, that's what I do. Even for personal projects, with the flurry of changes Claude/other AI assistants make, a branch makes it easier for me to compare changes.

Often I have a branch with multiple commits on it, with each commit corresponding to a message in a conversation with AI on Cursor trying to get a new feature built.

In the end, I can diff the branch against the main branch, and see the sum total of changes the AI agent has made.

Maybe edit/improve manually on my own afterwards. And then, merge.

Re:Claude Code Checkpoints by skapadia on Thursday August 28, 2025 @09:25AM (#45051887)
Exactly. This is precisely what I do.
Re:Claude Code Checkpoints by jdthedisciple on Thursday August 28, 2025 @03:11PM (#45055853)
uhh... .gitignore solves that right?
Re:Claude Code Checkpoints by 0x6c6f6c on Friday August 29, 2025 @10:43AM (#45064793)
These agents often generate randomly named files and dump them anywhere. You can end up with dozens of files added if you let it run on any problem it tries to create one-off "test / reproduction" cases. It hasn't always cleaned them up so a "git add all" approach can bring in junk, and the patterns for names aren't consistent. In fact they're often called stuff like *-test.js which looks like it could be a source OR test file.
Re:Claude Code Checkpoints by jdthedisciple on Sunday August 31, 2025 @07:26AM (#45082348)
That's why I wouldn't recommend "git add all", but rather use something like gitextensions [0] and visually add files or delete them, so you know what's happening in git world.

[0] https://gitextensions.github.io/