SuperAPI AI Directory

git-ai

Git extension that tracks AI-generated code and the prompts behind each line.

Open website

About this tool

Git AI is an open-source Git extension designed to track AI-generated code in code repositories. According to the materials, after installing this extension, every line of AI code is linked to the agent, model, and prompt that generated it, thereby avoiding the loss of the intent, requirements, and architectural decisions behind the code.

In terms of purpose, Git AI mainly addresses the attribution and traceability of AI code in version control. It lets developers know which code was generated by AI, by which agent and model, and based on what prompt, and supports tracking the acceptance, commit, code review, and entry into production of AI code throughout the complete software development lifecycle.

Main capabilities include:

  • Line-level attribution: every line of AI-generated code is associated with the agent, model, and prompt.
  • git ai blame: as a direct replacement for git blame, it displays the AI attribution for each line and supports all standard git blame flags.
  • Stats command: aggregates AI statistics in commits, such as the percentage of AI code, the number of AI lines generated and committed, acceptance rate, and human override broken down by tool and model, etc.
  • Support for rewrite operations: when performing operations such as squash, merge, reset, rebase, stash, and cherry-pick, Git AI moves and merges line-level attribution to ensure that AI code is always accurately tracked.
  • No performance overhead: it does not rely on Git Hooks and does not wrap the Git binary, so Git operation speed is the same as before installation.
  • Local-first: it can work offline and requires no login.
  • Secure prompt storage: sessions are scanned and redacted, stored outside Git, keeping the repository lightweight, supporting fine-grained access control, and preventing PII or secret leakage.
  • Open standard: Git AI has built an open standard for tracking AI-generated code using Git Notes.
  • Team edition: connect to GitHub, GitLab, Bitbucket, or Azure DevOps to obtain aggregated insights across all repositories, as well as complete tracking from prompt to production.

In terms of usage, Git AI requires no per-repository setup or Git Hooks. Users only need to prompt and commit as usual, and can commit with an agent, git, or their favorite Git client, and attribution will be automatically linked to the commit. Running git log --show-notes="ai" allows viewing attribution data. Git AI, through the final code state analysis after the operation is completed,copies/merges attribution information into the Git Note, and the system is eventually consistent without adding latency to Git operations. Coding agents call git-ai checkpoint when writing code or modifying files with bash scripts. Git AI also provides the install hooks command git ai install-hooks, but Git AI usually manages agent hooks itself and checks for updates daily.

Applicable scenarios include individual developers tracking the source of AI code, as well as teams and enterprises measuring AI code usage. The team edition can measure the proportion of AI code entering production, count AI percentages and token costs by Pull Request, repository, team, and contributor, measure and improve agent autonomy and token efficiency, measure AI code durability and rework needs, and correlate events back to AI sessions. The materials mention that hundreds of engineering teams (including many Fortune 100 companies) use Git AI.

In terms of limitations, the materials do not provide Git AI's specific version requirements, installation commands, minimum system configuration, a complete list of supported agents, pricing (only stating that the CLI is free and open source), or the specific pricing and deployment details of the team edition. This information is not yet available.