Open source tool re_gent adds audit trails, per-line prompt attribution, and session tracking for AI coding agents like Claude Code, solving the problem of untraceable agent-driven code changes that standard version control systems cannot handle.
What is re_gent?
The re_gent project provides a dedicated version control system for AI coding agent activity, addressing a gap that standard git workflows cannot fill for developers and teams using autonomous coding tools. While git tracks human-made code changes well, it has no native way to record the prompts, tool calls, and session context behind agent-driven edits.

The problem with existing version control for AI agents
Developers who work with AI coding agents like Claude Code will recognize the pain points re_gent targets. An agent might edit 10 files, run tests, and modify dependencies in a single session, but git only captures the final state of the codebase. If a change breaks functionality, there is no easy way to trace which prompt caused the issue, or to revert only the agent's edits without disrupting separate human-led git commits.
Common frustrations include losing track of what an agent changed in the past hour, wondering why an agent modified a specific file, or struggling to undo a messy refactor without resetting unrelated work. Claude Code users face additional issues: using the /compact command to trim context wipes conversation history, making it impossible to link later code changes to earlier prompts. Running multiple concurrent agent sessions also creates git conflicts, as standard version control is not designed to handle parallel agent workflows.
Core functionality and workflow
re_gent runs alongside git, complementing rather than replacing existing version control. It automatically captures every agent tool call, with no manual commits required. The project focuses on three core primitives that its maintainers argue should be standard for agent workflows:
rgt logshows a step-by-step history of what an agent session did, including tool calls, file changes, and timestamps.rgt blameattributes specific code lines to the exact prompt and session that created them.rgt rewind(coming soon) allows non-destructive restoration to any previous agent step.
Integration with Claude Code is transparent, using hook-driven capture that records activity without extra input from the user.
The project's demo shows this workflow in action, tracking Claude Code edits, bash commands, and file writes automatically. 
Technical implementation
re_gent stores all agent activity in a .regent/ directory, structured similarly to git's .git/ folder. The directory layout includes:
objects/: Content-addressed blobs hashed with BLAKE3, which enables automatic deduplication of repeated content.refs/: Per-session pointers that act as separate branches for each active agent session, avoiding conflicts between concurrent workflows.index.db: A SQLite database that powers fast queries, with lookups typically taking less than 10ms.config.toml: Project-specific configuration settings.
Every agent tool call creates a Step object, which serves as a node in a directed acyclic graph (DAG). Each Step records:
- The hash of the previous step (parent)
- A snapshot of the workspace tree at the time of the call
- A delta of the conversation transcript related to the change
- The cause of the step: tool name, arguments, and output
- The session ID and timestamp
Steps form a DAG where each session maintains its own branch. Common ancestors between sessions are deduplicated, giving full auditability of agent activity without redundant data storage. The project uses BLAKE3 hashing instead of git's SHA-1 for faster performance and stronger collision resistance, and relies on SQLite for local query performance rather than parsing raw object files. ACID transactions and compare-and-swap (CAS) refs ensure concurrency safety when multiple agents run at the same time.
re_gent vs git
re_gent is designed to work alongside git, not replace it. The two tools serve different purposes, as outlined below:
| Feature | Git | re_gent |
|---|---|---|
| Tracks human code changes | ✅ | ✅ |
| Tracks agent activity | ❌ | ✅ |
| Per-line prompt blame | ❌ | ✅ |
| Conversation history | ❌ | ✅ |
| Concurrent agent sessions | ⚠️ Conflicts possible | ✅ Separate branches |
| Primary purpose | Developer VCS | Agent audit trail |
Git remains the source of truth for human-led code changes, while re_gent provides a complete record of agent-driven work that can be audited, traced, and reverted independently.
Available commands and features
The project currently has core functionality complete, with several commands available for daily use:
rgt init: Sets up the.regent/directory in an existing project.rgt log: Displays step history, with filters for specific sessions, time ranges, or step counts.rgt sessions: Lists all active and recent agent sessions.rgt blame <path>[:<line>]: Shows which prompt and session modified a specific file or line.rgt show <step>: Displays full context for a step, including the associated conversation transcript.rgt status: Shows the current state of the re_gent repository.rgt cat <hash>: Inspects raw objects by their BLAKE3 hash for debugging.rgt version: Prints the installed version of the CLI.rgt completion: Generates shell completion scripts for bash, zsh, and fish.
Planned features include rgt rewind for time-travel restoration, rgt gc for garbage collection of old steps, and rgt fork to create new sessions from a specific past step.
Editor integration is available via a VS Code extension, which adds inline blame annotations, hover tooltips with step context, and a sidebar session timeline. The extension pulls data directly from the SQLite index, avoiding subprocess overhead. The extension can be installed from a VSIX file on its releases page, or from the VS Code Marketplace once published. Development builds can be compiled from the vscode-regent repository.
Installation options
re_gent is written in Go, with multiple installation options:
- Homebrew (macOS/Linux): Run
brew tap regent-vcs/tapfollowed bybrew install regent. This installs bothregentandrgtcommands (which are identical) and sets up shell completions automatically. - Go install: Run
go install github.com/regent-vcs/regent/cmd/rgt@latestto install thergtCLI. Shell completions must be set up manually withrgt completion [bash|zsh|fish] > [path]. - From source: Clone the main repository, run
go build -o rgt ./cmd/rgt, then move the binary to/usr/local/bin. - Binary releases: Pre-built binaries for common platforms are available on the GitHub Releases page.
After installation, run rgt init in a project directory to start tracking agent activity. Claude Code integration works automatically once the CLI is installed, with no additional configuration needed.
Current status and contributing
re_gent is in active development, with approximately 7,800 lines of Go code. Core features including init, log, sessions, status, show, and blame are complete, as is Claude Code hook integration. The project is used daily by its contributors, but has not yet reached v1.0. Maintainers describe the code as production-quality with POC-level feature completeness, and are building the project in public.
Contributions are welcome from developers of all experience levels.
New contributors can start with the QUICK_START.md guide for a 5-minute setup, then check good first issues on the issue tracker. Full contribution guidelines are available in CONTRIBUTING.md. All pull requests must pass tests (go test ./... and go test -race ./...), linting (golangci-lint run), and formatting (go fmt ./...) before merging.
Key project documents include:
- POC.md: Full technical specification
- CLAUDE.md: Project context for agent contributors
- TESTING.md: Testing strategy guide
- SUPPORT.md: Help and support resources
The project is built with the Cobra CLI framework, BLAKE3 hashing library, go-diff for Myers diff implementation, and modernc.org/sqlite for pure-Go SQLite support. It is licensed under the Apache License 2.0, and maintainers are active in GitHub Discussions and Issues for community support.

Comments
Please log in or register to join the discussion