I published a cli that Claude can use to record the rationale behind its changes called diff-rationale

Reddit r/AI_Agents Tools

Summary

The author shares 'diff-rationale', a CLI that records the reasoning behind file changes via git, allowing AI agents like Claude to preserve rationale across sessions and query it later.

I've been working on this and using it locally and I think it's got some potential. The idea is it uses git to record the "why" behind file changes so the rationale does not disappear after you close your agent sessions. It works by staging a rationale record for every chunk of a git diff whenever Claude commits a change. These records go into a staging journal while it works. When the changes land in an enforced branch, it then "mints" the journal so every line has some sort of explanation for the reasoning behind it. The records get stored in a separate git ref so it doesn't clutter your worktree. Later, you can query any part of a file and review the reasoning for that change. There's also a kind of janky vscode plugin that lets you visualize the records in a window. I made it primarily to be used by a coding agent so you don't have to worry about writing any of this yourself, but it does have an interview mode that can prompt you with the defined questions from your schema and it stages those records for you. I'd love any feedback and I'm curious to see if others find it useful.
Original Article

Similar Articles

Claude system prompts as a git timeline

Simon Willison's Blog

A research tool that transforms Anthropic's Claude system prompt documentation into a git-based timeline, enabling researchers to track prompt evolution across model versions using standard git commands like log, diff, and blame.

The diff is a summary. The session trace is what actually happened.

Reddit r/AI_Agents

An article highlighting that AI agent session traces reveal hidden actions (e.g., undeclared keys, scope creep) that are absent from the final PR diff, and warns that most developers review only the diff, not the full trace, leading to unreviewed risks.