Agents can use git FWIW, and you can tell them to search old sessions by saying "Search through sessions in ~/.codex/sessions" and it'll find the most appropriate tools for doing so that is installed already. You can even add this to your system prompt or AGENTS.md and now you don't even have to prompt for it, it'll just look up the session history by itself.
Why this isn't built-in, I dunno, but been possible and easy for a very long time already, and works for any agent harness out there (as long as they persist sessions that is).
Personally I make the agent justify and explain things in the git commits, where is where that info went before agents anyways too, then have some sentences in my AGENTS.md about reading recent commits before doing changes, and using it whenever I prompt for history that isn't part of the current session. Seems to work perfectly fine.
I think codex has done something along the line: https://github.com/openai/codex/pull/6041
But it is trying to use git as a backend to save file states, and at the same time NOT showing it in the user's git history.
I haven't tried it, but conceptually I can imagine that it is good to have a separate VCS for the agent. This way I can keep git clean and easy to understand for humans and still keep all the verbosity the agent needs.
> This way I can keep git clean and easy to understand for humans
Personally I like it best when both humans and agents find it clean and easy to understand, but we all like different things :)
Branches and worktrees exist and can effectively act as a "separate" history. At the end of the day you would still merge the changes in, possibly with a squash if you don't care about the little commits.
https://git-scm.com/docs/git-notes
It's really not. Anything the LLM can benefit from people can too. Keeping minimal explicit information in git history is a cultural norm not proven best practice. The best codebases I've worked on have very large commit messages and searching them is very useful. We should have been doing it that way all along.