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.
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.
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.
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!
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.
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.
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.