Source control for coding agents: links each commit to the agent session that produced it, and lets multiple agents share one project memory.
git-ai-project/git-ai
An open source Git extension that records which lines of code were written by AI agents, linking each line to its agent, model, and prompt.
- Stars
- 2,946
- Forks
- 327
- Open issues
- 258
- Last commit
- 2 days ago
What is it?
Git AI tracks AI-generated code inside Git repositories. Once installed, each AI-written line is linked to the agent, model, and session that produced it, so the intent and requirements behind code are preserved alongside the commit history.
Attribution is stored in Git Notes, and the extension updates it when commits are squashed, merged, rebased, stashed, cherry-picked, or amended. It works with Git clients and the Git CLI without per-repo setup or git hooks, and it runs locally without a login. A `git ai blame` command works as a drop-in replacement for `git blame` and shows AI attribution per line, while `git ai stats` reports the share of AI-written code across commits.
The project supports a range of coding agents including Claude Code, Codex, Cursor, GitHub Copilot, and Windsurf, and a community VS Code extension displays attribution in the editor gutter.
Key features
- 01Links each AI-written line to its agent, model, and prompt session.
- 02Stores attribution in Git Notes and keeps it through rebase, squash, and other rewrites.
- 03Provides `git ai blame` as a drop-in replacement for `git blame`.
- 04Reports AI-code percentage and accepted rates via `git ai stats`.
- 05Runs locally with no login and no git hooks or Git wrapping.
Use cases
- Reviewing which parts of a codebase were written by AI and under what prompts.
- Measuring AI code share and acceptance rates across a team's commits.
- Tracing an incident or bug back to the AI session that produced the code.
Quick start
- 1
Run the official install script from the README for your OS (Mac, Linux, WSL, or Windows PowerShell)
- 2
Show AI attribution for a file with git ai blame
git ai blame /src/log_fmt/authorship_log.rs
Things to know
- Attribution depends on supported agents reporting their edits; the README lists the agents that are supported.
- Files created via Bash may not be attributed if the agent is not operating from the repository root.
In collections
Topics
FAQ
- What is git-ai?
- An open source Git extension that records which lines of code were written by AI agents, linking each line to its agent, model, and prompt. Git AI tracks AI-generated code inside Git repositories. Once installed, each AI-written line is linked to the agent, model, and session that produced it, so the intent and requirements behind code are preserved alongside the commit history.
- Is git-ai free to use? What license does it have?
- git-ai is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
- Is git-ai still maintained?
- Actively maintained. The last commit to git-ai was on Nov 5, 2026.
- What can I use git-ai for?
- Reviewing which parts of a codebase were written by AI and under what prompts. Measuring AI code share and acceptance rates across a team's commits. Tracing an incident or bug back to the AI session that produced the code.
- How do I install git-ai?
- Run the official install script from the README for your OS (Mac, Linux, WSL, or Windows PowerShell) Show AI attribution for a file with git ai blame: git ai blame /src/log_fmt/authorship_log.rs
- Where can I get git-ai?
- The source code and installation instructions are on GitHub: https://github.com/git-ai-project/git-ai
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
A Rust terminal workspace that runs coding agents in persistent panes, tracks which ones are working, blocked, or idle, and lets agents control it via CLI and socket API.
A terminal multiplexer that runs multiple AI coding agents in parallel, each in its own tmux pane with a separate git worktree and branch.
A Pi-native terminal workspace that puts parallel coding agents, live tasks, Git changes, and permission controls into one interface.
A CLI that finds relevant code by natural-language question, returning files, leads and source excerpts for coding agents.
A terminal UI for viewing, checking, installing and updating agent skills across Claude Code, OpenCode, Codex, Cursor and other coding agents.