@gaoren7716: AI Agent 的版本控制系统。 追踪 Agent 做了什么、哪个 prompt 写了哪一行、任意步骤可回溯。像 .git 一样有 .regent,但记录的是 Agent 活动而非人类 commit。 几个核心命令: rgt log —…
摘要
re_gent is a version control system for AI agents, tracking agent actions, enabling line-level attribution to specific prompts, and supporting rollback. It integrates with Claude Code, Codex, and OpenCode automatically.
查看缓存全文
缓存时间: 2026/05/23 06:06
AI Agent 的版本控制系统。
追踪 Agent 做了什么、哪个 prompt 写了哪一行、任意步骤可回溯。像 .git 一样有 .regent,但记录的是 Agent 活动而非人类 commit。
几个核心命令:
rgt log — 查看 Agent 每一步操作,带时间戳和变更摘要
rgt blame — 精确到行,这行代码是哪个 prompt 让 Agent 写的
rgt show — 查看任意步骤的完整上下文,包括工具调用和对话历史
其他方面:多会话并行,每个会话独立 ref 并发不冲突;内容寻址存储走 BLAKE3 哈希加自动去重;SQLite 索引查询在 10ms 以内;rgt init 后 Claude Code / Codex / OpenCode 自动开启追踪零配置;VSCode 扩展支持 inline blame 注释和 hover 上下文。
最值得说的是这个场景:rgt blame src/handler.go:42 不只告诉你谁改了这行,而是告诉你哪个 prompt 让 Agent 写了这行——你能看到当时的对话上下文、工具调用参数和结果。代码审查时不再是「Agent 写的我也不知道为什么」,而是每一行都有可追溯的意图来源。
http://github.com/regent-vcs/re_gent…
#AgentVCS #版本控制 #审计 #ClaudeCode
regent-vcs/re_gent
Source: https://github.com/regent-vcs/re_gent
🚀 We're live on Product Hunt today! Your upvote means the world to us → Support re_gent
Version Control for AI Agents
Track what your agent did, which prompt wrote each line, and inspect any step.
Quick Start
# Install via Homebrew (macOS/Linux)
brew tap regent-vcs/tap
brew install regent
# Or via Go
go install github.com/regent-vcs/regent/cmd/rgt@latest
# Initialize in your project
cd your-project
rgt init
# Work with Claude Code, Codex, or OpenCode normally — activity is tracked automatically
# See what happened
rgt log
rgt blame src/file.go:42
rgt show <step-hash>
That’s it. Your agent activity is now auditable.
Demo
https://github.com/user-attachments/assets/a19b7c56-2e3c-4f04-81a1-d8665e3963b8
Every agent turn is automatically captured. No manual commits needed.
What You Get
See what your agent actually did
$ rgt log
Step a1b2c3d | 2 min ago | Tool: Edit
│ File: src/handler.go
│ Added error handling to request handler
│ + 5 lines, - 2 lines
Step d4e5f6g | 5 min ago | Tool: Write
│ File: tests/handler_test.go
│ Created unit tests for handler
│ + 23 lines
Step f8g9h0i | 8 min ago | Tool: Bash
│ Command: go mod tidy
│ Cleaned up dependencies
Blame: which prompt wrote this line?
$ rgt blame src/handler.go:42
Line 42: func handleRequest(w http.ResponseWriter, r *http.Request) {
Step: a1b2c3d4e5f6
Session: claude-20260502-143021
Tool: Edit
Prompt: "Add error handling to the request handler"
Track multiple concurrent sessions
$ rgt sessions
Active Sessions:
claude_code:claude-20260502-143021 | 3 steps | Last: 2 min ago
codex_cli:codex-20260502-091534 | 7 steps | Last: 2 hours ago
$ rgt log --session claude_code:claude-20260502-143021
# Filter history by session
See full context for any change
$ rgt show a1b2c3d
Step a1b2c3d4e5f6
Parent: d4e5f6g7h8i9
Session: claude-20260502-143021
Time: 2026-05-02 14:30:21
Tool: Edit
File: src/handler.go
Changes:
+ func handleRequest(w http.ResponseWriter, r *http.Request) {
+ if r.Method != "GET" {
+ http.Error(w, "Method not allowed", 405)
+ return
+ }
- func handleRequest(w http.ResponseWriter, r *http.Request) {
Conversation:
User: "Add error handling to reject non-GET requests"
Assistant: "I'll add method validation to the handler..."
Why This Exists
AI agents have no version control of their own.
You know this pain:
- “It was working five minutes ago”
- “Why did you change that file?”
- “Go back to before the refactor”
/compactand pray- Copy-pasting code into a fresh chat
Three primitives that should already exist:
rgt log— what did this session do?rgt blame— which prompt wrote this line?rgt show— inspect the full context for any step
We gave agents write access to our codebases. We did not give ourselves git for it. re_gent fixes that.
How It Works
re_gent stores agent activity in .regent/ (like .git/):
.regent/
├── objects/ # Content-addressed blobs (BLAKE3)
├── refs/ # Session pointers (one per agent)
├── index.db # SQLite query index
└── config.toml
Every tool-using turn creates a Step — a content-addressed snapshot of what changed, why, and who asked:
Step {
parent: <previous-step-hash>
tree: <workspace-snapshot>
causes: [{ tool_name: "Edit", args: <input>, result: <output> }]
session_id: "claude_code:claude-20260502-143021"
timestamp: "2026-05-02T14:30:21Z"
}
Steps form a DAG. Each session has its own branch. Common ancestors dedupe. You get git-level auditability for agent activity.
Technical details: See POC.md for the complete specification.
Installation
Via Homebrew (macOS/Linux)
brew tap regent-vcs/tap
brew install regent
This installs the rgt command and automatically sets up shell completions for bash, zsh, and fish.
Via Go Install
go install github.com/regent-vcs/regent/cmd/rgt@latest
Shell Completion (manual setup):
# Bash
rgt completion bash > /usr/local/etc/bash_completion.d/rgt
# Zsh
rgt completion zsh > "${fpath[1]}/_rgt"
# Fish
rgt completion fish > ~/.config/fish/completions/rgt.fish
From Source
git clone https://github.com/regent-vcs/regent
cd regent
go build -o rgt ./cmd/rgt
sudo mv rgt /usr/local/bin/
Binary Releases
Download pre-built binaries from GitHub Releases
Supported Tools
| Tool | Status |
|---|---|
| Claude Code | Fully supported |
| OpenAI Codex CLI | Fully supported |
| OpenCode | Fully supported |
| Cursor, Cline, Continue | Planned |
Hooks auto-configure on rgt init. No manual setup required.
Commands
| Command | Description |
|---|---|
rgt init | Initialize .regent/ in current directory |
rgt log | Show step history (supports --session, -n, --json, --graph) |
rgt sessions | List all active sessions |
rgt status | Show current repository state |
rgt show <step> | Display full context for a step (tool call + conversation) |
rgt blame <path>[:<line>] | Show per-line provenance for a file |
rgt cat <hash> | Inspect any object by hash |
rgt version | Print version information |
rgt completion | Generate shell completion scripts |
Features
- Content-Addressed Storage — BLAKE3 hashing, automatic deduplication
- Fast Queries — SQLite index, sub-10ms lookups
- Per-Session DAG — Concurrent sessions tracked as separate refs
- Conversation Tracking — Survives
/compactand/clear - Hook-Driven — Transparent Claude Code, Codex, and OpenCode integration
- Zero Configuration — Hooks auto-configure on
rgt init - Concurrency-Safe — CAS refs, ACID transactions
- Gitignore-Compatible —
.regentignoresupport
Editor Integration
VSCode Extension
Get inline blame annotations directly in your editor:
# From VSIX (Recommended)
# Download the latest .vsix from:
# https://github.com/regent-vcs/vscode-regent/releases
# Then in VS Code: Extensions > ... > Install from VSIX...
# From source (Development)
git clone https://github.com/regent-vcs/vscode-regent
cd vscode-regent
npm install && npm run compile
# Press F5 in VS Code to launch Extension Development Host
Features:
- Inline blame annotations showing which step modified each line
- Hover tooltips with full step context (timestamp, tool name, arguments)
- Session timeline view in the sidebar
- One-click access to conversation history
Requirements: rgt CLI must be installed and rgt init run in your project.
re_gent vs Git
| Git | re_gent | |
|---|---|---|
| Tracks code | ✅ | ✅ |
| Tracks agent activity | ❌ | ✅ |
| Blame with prompt | ❌ | ✅ |
| Conversation history | ❌ | ✅ |
| Concurrent sessions | ⚠️ shared workspace conflicts | ✅ separate captured session refs |
| Purpose | Developer VCS | Agent audit trail |
re_gent complements git, doesn’t replace it. Use both.
Roadmap
See ROADMAP.md for planned features including:
- Non-destructive rewind and fork operations
- Additional tool adapters (Cursor, Cline, Continue)
- Session sharing and merge support
- Garbage collection and integrity verification
Contributing
Contributions welcome! See CONTRIBUTING.md for guidelines.
Quick Start:
- QUICK_START.md — 5-minute setup guide
- Good first issues
Before opening a PR:
-
Tests pass:
go test ./...andgo test -race ./... -
Linter passes:
golangci-lint run -
Code formatted:
go fmt ./...
Built With
- cobra — CLI framework
- blake3 — BLAKE3 hashing
- go-diff — Myers diff
- modernc.org/sqlite — Pure Go SQLite
License
Built by contributors
相似文章
Re_gent
Re_gent 是一个用于跟踪和管理 AI 智能体活动的版本控制工具。
Show HN:面向AI代理的Git
re_gent 是一个开源的版本控制系统,专为AI代理活动设计,记录每一次工具调用及其相关提示,使开发者能够审查和回滚代理的变更。
@teach_fireworks: AI Coding 现在开始进入一个很有意思的阶段。 过去大家讨论最多的是模型能力、上下文长度、Agent Loop、Tool Use、自动化编程,但真正把 Agent 长时间放进真实开发环境之后,很多团队发现问题已经不只是“能不能生成代…
介绍开源工具 re_gent,它为 AI 编程 Agent 提供运行时级别的版本控制和可观测性基础设施,解决 Agent 长时间运行后的代码溯源与审计问题。
@FeitengLi: 动手搭了一个 ReAct agent 系统:围绕 LLM 做 agent 系统 傍晚散步时在想:如何训练 LLM 的 agentic 能力、数据准备、模型训练、agent 轨迹 action 构造 RL 训练,再想 Claude 在过去一…
作者分享了搭建 ReAct agent 系统的经验,并介绍了智谱 AI 发布的 GLM-5 技术报告,该模型在 agentic、推理和编码方面取得了突破。
@geekbb: 一个专为 AI 编码设计的 macOS 终端,把工作区管理、分屏和 AI agent 启动流程整合到一起。支持横竖分屏,一键启动 Claude Code、Codex、Gemini CLI 等七个 AI agent,右键选中内容直接提交给 …
kooky 是一个专为 AI 编码设计的 macOS 终端,整合工作区管理、分屏和 AI agent 启动流程,支持一键启动多个 AI agent 和右键提交内容。