Live data from Hacker News

If AI writes code, should the session be part of the commit?

github.com

11–20 of 410 posts

Re: If AI writes code, should the session be part of the commit?

#11
We think so as well with emphasis on "why" for commits (i.e. intent provenance of all decisions).

https://github.com/eqtylab/y just a prototype, built at codex hackathon

The barrier for entry is just including the complete sessions. It gets a little nuanced because of the sheer size and workflows around squash merging and what not, and deciding where you actually want to store the sessions. For instance, get notes is intuitive; however, there are complexities around it. Less elegant approach is just to take all sessions in separate branches.

Beyond this, you could have agents summarize an intuitive data structure as to why certain commits exist and how the code arrived there. I think this would be a general utility for human and AI code reviewers alike. That is what we built. Cost /utility need to make sense. Research needs to determine if this is all actually better than proper comments in code

Re: If AI writes code, should the session be part of the commit?

#12
post #2

I’ve been thinking about a simple problem: We’re increasingly merging AI-assisted code into production, but we rarely preserve the thing that actually produced it — the session. Six months later, when debugging or reviewing history, the only artifact left is the diff. So I built git-memento. It attaches AI session transcripts to commits using Git notes.

I already invented this in my head, thanks for not making me code it.

Excellent idea, I just wish GitHub would show notes. You also risk losing those notes if you rebase the commit they are attached to, so make sure you only attach the notes to a commit on main.

Re: If AI writes code, should the session be part of the commit?

#13
post #4
post #3

Earlier quoted context omitted.

A better solution would be to read and understand the code before committing it.

People won’t do that, unfortunately. We are a dying breed (I hate it). I went against my own instincts and vibe code this, works as a proof of concept. You can see the session (including my typos) and compare what was asked for and what you got.

Sounds like we've got an Ape Coder here!

https://rsaksida.com/blog/ape-coding/

Re: If AI writes code, should the session be part of the commit?

#14
Why should it be? The agent session is a messy intermediate output, not an artifact that should be part of the final product. If the "why" of a code change is important, have your agent write a commit message or a documentation file that is polished and intended for consumption.

Re: If AI writes code, should the session be part of the commit?

#16
post #4
post #3

Earlier quoted context omitted.

A better solution would be to read and understand the code before committing it.

People won’t do that, unfortunately. We are a dying breed (I hate it). I went against my own instincts and vibe code this, works as a proof of concept. You can see the session (including my typos) and compare what was asked for and what you got.

Personally, I'm not going to be complicit in reshaping the field around the lazy and undisciplined.

Re: If AI writes code, should the session be part of the commit?

#17
post #6

Maybe Git isn't the right tool to track the sessions. Some kind of new Semi-Human Intelligence Tracking tool. It will need a clever and shorter name though.

How about Entire?

https://techcrunch.com/2026/02/10/former-github-ceo-raises-r...

https://news.ycombinator.com/item?id=46961345

Re: If AI writes code, should the session be part of the commit?

#19
If the model in use is managed by a 3rd party, can be updated at will, and also gives different output each time it is interacted with, what is the main benefit?

If I chat with an agent and give an initial prompt, and it gets "aspect A" (some arbitrary aspect of the expected code) wrong, I'll iterate to get "aspect A" corrected. Other aspects of the output may have exactly matched my (potentially unstated) expectation.

If I feed the initial prompt into the agent at some later date, should I expect exactly "aspect A" to be incorrect again? It seems more likely the result will be different, maybe with some other aspects being "unexpected". Maybe these new problems weren't even discussed in the initial archived chat log, since at that time they happened to be generated in a way in alignment with the original engineers expectation.

Re: If AI writes code, should the session be part of the commit?

#20
In our (small) team, we’ve taken to documenting/disclosing what part(s) of the process an LLM tool played in the proposed changes. We’ve all agreed that we like this better, both as submitters and reviewers. And though we’ve discussed why, none of us has coined exactly WHY we like this model better.
Post reply on HN