Version control for AI agent activity is now available through an open-source tool called re_gent. This tool allows users to track what their AI agents did, which prompt wrote each line, and rewind when things break.
Overview
re_gent stores agent activity in a .regent/ directory, similar to how Git stores version control information in a .git/ directory. Every tool call creates a Step, which includes information such as the parent step, workspace snapshot, conversation delta, tool name, arguments, and result. Steps form a directed acyclic graph (DAG), and each session has its own branch.
What it does
re_gent provides several commands for users to interact with their AI agent activity. These commands include:
- rgt init: Initialize .regent/ in the current directory
- rgt log: Show step history (supports --session, -n, --since)
- rgt sessions: List all active sessions
- rgt status: Show current repository state
- rgt show
: Display full context for a step (tool call + conversation) - rgt blame
[: ]: Show per-line provenance for a file - rgt cat
: Inspect any object by hash (debug) - rgt version: Print version information
- rgt completion: Generate shell completion scripts
Coming soon are commands for non-destructive time-travel (rgt rewind), garbage collection (rgt gc), and creating a new session from a step (rgt fork).
Tradeoffs
re_gent is designed to complement Git, not replace it. It provides features such as content-addressed storage, fast queries, per-session DAG, conversation tracking, and hook-driven integration with Claude Code. re_gent is built in public, and contributions are welcome.
In conclusion, re_gent provides a much-needed solution for tracking and auditing AI agent activity. Its features and commands make it a useful tool for developers working with AI agents. By using re_gent, developers can gain more insight into their AI agents' actions and decisions, making it easier to debug and improve their systems.