A new Git extension automatically captures and stores AI coding session traces as commit notes, enabling better provenance tracking for AI-assisted development.
The rise of AI-assisted coding has created a new challenge for developers: how to track and document the AI sessions that contribute to their code. A new tool called git-memento aims to solve this by automatically recording AI coding conversations and attaching them to Git commits as notes.
The Problem: Lost Context in AI-Assisted Development
As developers increasingly rely on tools like GitHub Copilot, Claude Code, and other AI coding assistants, the conversations and reasoning that lead to code changes often disappear. When you ask an AI to refactor a function or debug a complex issue, that collaborative session vanishes once you copy the suggested code. This creates a gap in the development history - future maintainers (including your future self) lose the context of why certain decisions were made.
How Git-Memento Works
Git-memento integrates directly into your existing Git workflow. After initializing it in your repository with git memento init, you can continue using Git normally - the tool automatically captures AI session data when you commit.
Here's the workflow:
- Run
git memento commit <session-id> -m "Your commit message" - The tool fetches the AI conversation from your provider (Codex, Claude, or others)
- It cleans up the markdown conversation and stores it as a Git note on the commit
- The note includes metadata like provider name and session ID
Key Features
The tool offers several capabilities that make it practical for real-world use:
Seamless Git Integration: Works with standard Git commands like commit, amend, and push. You can use your normal editor for commit messages or pass them via -m flags.
Multi-Provider Support: While Codex is the default, the tool supports extensible provider configuration. You can switch to Claude Code or other providers by setting environment variables or running git memento init claude.
Note Sharing and Sync: Git notes can be pushed to and fetched from remotes, allowing teams to share AI session context. Commands like git memento share-notes and git memento notes-sync handle the synchronization.
Audit and Diagnostics: The git memento audit command checks for missing notes in commit ranges, while git memento doctor verifies repository configuration.
CI Integration: A GitHub Action can automatically post AI session notes as commit comments or fail pull requests if notes are missing, enforcing documentation standards.
Technical Implementation
Git-memento is built as a .NET NativeAOT application, meaning it compiles to a single executable per platform. This makes installation simple - you can download platform-specific binaries or use the provided install script.
The tool stores configuration in Git's local metadata under memento.* keys, keeping settings per-repository. Notes are written using Git's native notes system with a versioned envelope format that supports multiple sessions per commit.
Why This Matters
For teams using AI coding tools, git-memento provides several benefits:
- Knowledge Preservation: Future developers can understand the AI's reasoning and suggestions
- Code Review Context: Reviewers see not just the code changes but the collaborative process that produced them
- Debugging Aid: When bugs arise, you can trace back through the AI's suggestions to understand decision points
- Team Collaboration: Shared notes mean the entire team benefits from AI interactions, not just the individual developer
Getting Started
The tool is available on GitHub at mandel-macaque/memento. After installation, initialize it in your repository and start committing with AI session IDs. The project includes comprehensive documentation and CI/CD automation for releases.
The tool represents an interesting evolution in how we document software development - moving beyond just code changes to capture the full collaborative context, including human-AI interactions that are becoming increasingly common in modern development workflows.

Comments
Please log in or register to join the discussion