@teach_fireworks: AI Coding 现在开始进入一个很有意思的阶段。 过去大家讨论最多的是模型能力、上下文长度、Agent Loop、Tool Use、自动化编程,但真正把 Agent 长时间放进真实开发环境之后,很多团队发现问题已经不只是“能不能生成代…
摘要
介绍开源工具 re_gent,它为 AI 编程 Agent 提供运行时级别的版本控制和可观测性基础设施,解决 Agent 长时间运行后的代码溯源与审计问题。
查看缓存全文
缓存时间: 2026/05/10 16:29
AI Coding 现在开始进入一个很有意思的阶段。 过去大家讨论最多的是模型能力、上下文长度、Agent Loop、Tool Use、自动化编程,但真正把 Agent 长时间放进真实开发环境之后,很多团队发现问题已经不只是“能不能生成代码”,而是“系统能不能管理 Agent 的整个运行过程”。 因为 Agent 一旦连续运行几十分钟甚至几小时,workspace 会不断变化,shell 会持续执行,文件会被频繁修改,tool call 会越来越多,最后整个工程会进入一种非常典型的状态:代码已经变了,但没人知道为什么会变成现在这样。 很多 AI Coding 产品目前其实都存在这个问题,你能看到最终结果,却看不到完整过程,很难知道哪一步修改了文件、哪个 prompt 生成了代码、哪次执行引入了 bug、workspace 是从什么时候开始被污染的,也很难回放整个执行链路。 人类开发者有 Git,但 AI Agent 目前还缺少真正成熟的 runtime-level version control。最近越来越多团队开始重新思考 Agent Infra,本质上是在给 Autonomous Agents 补一层“软件工程基础设施”。 未来真正成熟的 Agent 系统,大概率都会具备 execution DAG、workspace snapshot、session timeline、tool tracing、persistent history、replay、time travel、audit log 这些能力,因为 AI Coding 下一阶段拼的已经不只是生成代码的能力,而是系统是否具备可追踪、可恢复、可审计、可回放的运行能力。 本质上都是让系统具备可追踪、可恢复、可审计能力。 最近看到一个很有意思的开源项目: https://github.com/regent-vcs/re_gent… 它做的事情非常直接,给 AI Agent 增加一层版本控制与 可观测基础设施。可以直接追踪某一行代码是在哪次 Agent 执行中生成的。 这个方向我觉得会越来越重要。 很多人现在还把 AI Coding 理解成“更聪明的 Copilot”,但整个行业其实已经开始往“Autonomous Software System”演化了 AI Coding 的下一阶段,拼的已经不只是模型能力了。 更像是在重新发明一套适用于 Autonomous Agents 的软件基础设施。
regent-vcs/re_gent
Source: https://github.com/regent-vcs/re_gent
Version-Control for AI Agents
Version control for AI agent activity. Track what your agent did, which prompt wrote each line, and rewind when things break.
Demo
Every tool call is automatically captured. No manual commits needed.
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 normally (every tool call is tracked)
# See what happened
rgt log
rgt blame src/file.go:42
That’s it. Your agent activity is now auditable.
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-20260502-143021 | 3 steps | Last: 2 min ago
claude-20260502-091534 | 7 steps | Last: 2 hours ago
$ rgt log --session 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
The problem: 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
The solution: Three primitives that should already exist:
rgt log— what did this session do?rgt blame— which prompt wrote this line?rgt rewind— restore to any previous step (coming soon)
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 call creates a Step:
Step {
parent: <previous-step-hash>
tree: <workspace-snapshot>
transcript: <conversation-delta>
cause: {
tool_name: "Edit"
args: <what-changed>
result: <tool-output>
}
session_id: "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 both regent and rgt commands (they’re identical) and automatically sets up shell completions for bash, zsh, and fish.
Via Go Install
go install github.com/regent-vcs/regent/cmd/rgt@latest
This installs the rgt command.
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/
# Optionally create a symlink: sudo ln -s /usr/local/bin/rgt /usr/local/bin/regent
For shell completion, follow the “Via Go Install” instructions above.
Binary Releases
Download pre-built binaries from GitHub Releases
Editor Integration
VSCode Extension
Get inline blame annotations directly in your editor:
Installation Options:
# 1. From VSIX (Recommended)
# Download the latest .vsix from:
# https://github.com/regent-vcs/vscode-regent/releases
# Then in VS Code: Extensions > ... > Install from VSIX...
# 2. From VS Code Marketplace (Coming Soon)
# Search for "re_gent Blame"
# 3. 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
- Direct SQLite integration—no subprocess overhead
Requirements: re_gent CLI must be installed and rgt init run in your project.
Commands
Available Now:
| Command | Description |
|---|---|
rgt init | Initialize .regent/ in 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 <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 (debug) |
rgt version | Print version information |
rgt completion | Generate shell completion scripts |
Coming Soon:
| Command | Description |
|---|---|
rgt rewind <step> | Non-destructive time-travel |
rgt gc | Garbage collection |
rgt fork <step> | Create a new session from a step |
Features
- Content-Addressed Storage — BLAKE3 hashing, automatic deduplication
- Fast Queries — SQLite index, sub-10ms lookups
- Per-Session DAG — Concurrent agents, no conflicts
- Conversation Tracking — Survives
/compactand/clear - Hook-Driven — Transparent Claude Code integration
- Concurrency-Safe — CAS refs, ACID transactions
- Gitignore-Compatible —
.regentignoresupport
re_gent vs Git
| Git | re_gent | |
|---|---|---|
| Tracks code | ✅ | ✅ |
| Tracks agent activity | ❌ | ✅ |
| Blame with prompt | ❌ | ✅ |
| Conversation history | ❌ | ✅ |
| Concurrent sessions | ⚠️ conflicts | ✅ separate branches |
| Purpose | Developer VCS | Agent audit trail |
re_gent complements git, doesn’t replace it. Use both.
Status
Active Development
- ~7.8k LOC Go implementation
- Core functionality: init, log, sessions, status, show, blame — COMPLETE
- Hook integration (Claude Code) — COMPLETE
- Used daily by contributors
- Not yet v1.0
Honest assessment: Production-quality code at POC-level feature completeness. We’re building in public.
🔥 Current Focus
Phase 3: Advanced Features (May 2026)
We’re working on:
rgt fork— Create new sessions from any step (enables branching exploration)rgt rewind— Non-destructive time-travel to previous steps- Performance optimization — Faster snapshots for large repositories
Want to help? Check good first issues or the issues tagged with phase-3.
Roadmap
| Phase | Status | Features |
|---|---|---|
| Phase 1: Core Storage | ✅ Complete | Object store, content addressing, SQLite index |
| Phase 2: Hook Integration | ✅ Complete | Claude Code capture, session tracking |
| Phase 3: Advanced Features | 🚧 In Progress | fork, rewind, performance optimization |
| Phase 4: Multi-Tool Support | 📋 Planned | Cursor, Cline, Continue adapters |
| Phase 5: Collaboration | 📋 Planned | Session sharing, merge support |
| Phase 6: Enterprise | 💭 Future | Team analytics, compliance reporting |
See POC.md for detailed implementation specs.
Contributing
Contributions are welcome! re_gent is built in public and we actively review PRs.
Quick Start:
- Read QUICK_START.md for a 5-minute setup guide
- Check good first issues
- Full guidelines: CONTRIBUTING.md
Before opening a PR:
-
Tests pass:
go test ./...andgo test -race ./... -
Linter passes:
golangci-lint run -
Code formatted:
go fmt ./... - PR template filled out
Important files:
- CONTRIBUTING.md — Full contribution guide
- SUPPORT.md — Support and help resources
- TESTING.md — Testing guide and strategy
- CLAUDE.md — Project context and architecture
- POC.md — Technical specification
Built With
- cobra — CLI framework
- blake3 — BLAKE3 hashing
- go-diff — Myers diff
- modernc.org/sqlite — Pure Go SQLite
License
Built by contributors
相似文章
@teach_fireworks: 别让 AI Agent 第二次踩同一个坑。 最近看到一个挺有意思的开源项目:RoBrain https://github.com/adelinamart/robrain… RoBrain 是 AI 编程团队的“决策记忆层”,专门记录一次次…
RoBrain is an open-source shared memory layer for AI coding teams that captures technical decisions, rationale, and rejected alternatives across sessions and tools like Claude Code, Cursor, and Copilot, preventing agents from repeating past mistakes.
@FakeMaidenMaker: 用 AI agent 写代码最怕的就是失控:agent 自顾自跑、质量飘忽、你不知道它现在在哪个阶段、改到一半又乱了。 AWS 刚开源了一套专门给 AI coding agent 用的开发生命周期工作流规则——AI-DLC,让 agent…
AWS 开源了 AI-DLC(AI-Driven Development Life Cycle),一套为 AI coding agent 设计的开发生命周期工作流规则,帮助开发者控制 agent 行为,确保质量。支持 Claude Code、Cursor、GitHub Copilot 等多种平台。
@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.
@GitHub_Daily: 很多教程教 AI Agent 开发都是直接上框架,装完跑起来了,但底下到底怎么回事不清楚。 ai-agents-from-scratch 反过来,先从最基本的模型调用写起,一步步搭出工具调用、记忆、ReAct 循环这些核心模式。 全程用本…
GitHub_Daily 推荐了一个开源项目 ai-agents-from-scratch,它从零开始使用本地模型逐步实现工具调用、记忆和 ReAct 循环等核心模式,帮助开发者理解 AI Agent 的底层原理,而不直接使用框架。
@realfxw: 做 Agent 最头疼的往往不是模型逻辑,而是让它联网“拿数据”——反爬、登录鉴权、频率限制,折腾半天全卡在接口上。 推荐关注开源项目 Agent-Reach,相当于直接给 AI Agent 装上了一副全网“采集外骨骼”: 整合成熟生态:…
Agent-Reach 是一个开源项目,为 AI Agent 提供一键式网络数据采集能力,整合多种工具以解决反爬和认证等问题。