Modern software engineering is currently grappling with a transparency crisis. As developers shift from using AI as a simple autocomplete tool to deploying autonomous coding agents like Claude Code or OpenAI Codex CLI, the volume of generated code is exploding. The problem is not the quantity of code, but the loss of intent. When a developer opens a file containing a hundred lines of agent-generated logic, they often find themselves staring at a black box. They can see what the code does, but they cannot remember which specific prompt, instruction, or context window led the AI to make a particular architectural decision. This gap in the audit trail creates a dangerous friction point where the speed of generation outpaces the speed of comprehension.
The Architecture of Prompt Traceability
To bridge this gap, re_gent introduces a dedicated tracking and auditing layer designed specifically for the agentic workflow. Unlike traditional version control that tracks changes to the state of the code, re_gent tracks the causal relationship between the prompt and the resulting line of code. The system integrates directly with leading agentic tools, including Claude Code, OpenAI Codex CLI, and OpenCode. The setup process is streamlined through a single initialization command:
rgt initExecuting this command automatically configures the necessary hooks to capture agent activity. The core functionality is centered around three primary commands that mirror the git experience. The `rgt log` command provides a chronological history of agent operations, while `rgt show` allows developers to output the full context of a specific step in the generation process. The most critical tool in the suite is `rgt blame`, which allows a user to pinpoint the exact prompt responsible for any specific line of code in the source file.
Under the hood, re_gent prioritizes extreme performance to ensure that auditing does not slow down the development cycle. All tracking data is stored locally within a `.regent/` folder. To handle the high volume of data generated during long AI sessions, the tool utilizes BLAKE3, a cryptographic hash function optimized for parallel processing, combined with a SQLite index. This technical combination allows re_gent to achieve lookup speeds of less than 10ms, ensuring that the audit trail is available instantaneously as the developer scrolls through their code.
Shifting from Version Control to Intent Control
The fundamental shift re_gent introduces is the distinction between state tracking and intent tracking. Git is designed to tell a developer that a line changed from X to Y; re_gent is designed to tell the developer that the AI changed X to Y because it was told to optimize for memory efficiency in a specific prompt. This creates a complementary relationship rather than a competitive one. re_gent does not seek to replace git, but rather to act as a specialized audit layer that sits on top of it.
This transparency extends into the integrated development environment through a VSCode extension. This extension provides inline blame annotations, allowing developers to see the prompt source directly in the editor, and a session timeline view that visualizes the evolution of the code. One of the most significant pain points in current AI agent interactions is the loss of history when using commands like `/compact` or `/clear` to manage context window limits. re_gent solves this by maintaining the conversation history independently of the agent's active session memory. Furthermore, for developers managing multiple concurrent AI tasks, the tool tracks separate sessions using a reference system similar to git refs, preventing the overlap of prompt histories across different feature branches or bug fixes.
By providing this level of granularity, re_gent transforms the AI agent from an unpredictable black box into a transparent collaborator. The ability to audit the prompt-to-code pipeline means that when a bug is discovered in agent-generated code, the developer can trace it back to a flawed instruction rather than spending hours reverse-engineering the AI's logic. This tool is released under the Apache-2.0 license, ensuring it can be integrated into a wide variety of professional and open-source pipelines.
This move toward observable AI marks the beginning of a new era where the provenance of every line of code is fully documented and accountable.



