Git AI
Get Started

Get Started with Git AI

Git AI is an open source git extension that tracks AI-generated code in your repositories, linking every AI-written line to the agent, model, and prompts that generated it.

Install the Extension

Mac, Linux, Windows (WSL)

curl -sSL https://usegitai.com/install.sh | bash

Windows (non-WSL)

powershell -NoProfile -ExecutionPolicy Bypass -Command "irm http://usegitai.com/install.ps1 | iex"

🎊 That's it! No per-repo setup. You don't have to change your workflow.

Once the extension is installed, Git AI will track the AI-code entering your repositories as you work.

Note: You may need to restart any Agent sessions and/or the IDEs you have running before the Agent Hooks are picked up.


Our Choices

  • 🪄 Transparent — Git AI requires no workflow changes, just prompt and commit as you normally would. Git AI attaches attribution metadata to each commit with a git note.
  • No performance overhead — Git AI adds 0 overhead to git commands. It does not rely on Git Hooks (slow + difficult to set up in every repo) and it does not wrap the git binary.
  • 💻 Local-first — Works offline, no login required.
  • 🔒 Secure Prompt Storage — Git AI links each line of AI-code back to the prompt that generated it. These sessions are scanned and redacted, and saved outside of Git.
  • 🌐 Git native and open standard — Git AI built the open standard for tracking AI-generated code with Git Notes.

Attributions on every commit - Run git ai stats after you commit to see the breakdown of Human vs AI Code:

Cross-Agent AI Blame

Supported coding agents

Git AI detects AI-generated code through each agent's hooks. See the per-agent setup guides:

Local agentsCursor, Claude Code, Copilot, Codex, Windsurf, Gemini CLI, opencode, Continue, Droid, Junie, Rovo Dev, Amp

Background agentsClaude Web, Codex Cloud, Cursor Agent, Devin

Don't see your agent? Add your own →

FAQs

How does it work?

  1. Coding Agents call git ai checkpoint whenever they write code or modify files with bash scripts.
  2. On commit, Git AI stores line-level attribution data in Git Notes, linking each line of AI-generated code to the agent, model, and session that created it. Run git log --show-notes="ai" to see them.
  3. Git AI moves and merges line-level attributions when you squash, merge, reset, rebase, stash, cherry-pick, etc. so your AI code is always accurately tracked.

Git AI does not use AI or heuristics to "detect" AI code — the Agents report exactly which lines they wrote, providing the most accurate, explicit attribution possible.

Does the agent have to commit for Git AI to attribute the code?

No. Git AI works no matter how you commit — your Git client, the Git CLI, and your own Git aliases are all supported.

Git AI notes are attached to commits — how are attributions preserved when I rebase, squash, stash, cherry-pick, etc.?

Git AI analyzes the final state of the code after the operation completes and copies/merges the attributions into a Git Note for any completed commits. It's eventually consistent. The note will be written 5-100ms after the operation completes.

Can I use this on my own?

Yes. Git AI is free and open source, works locally, and requires no login or team setup.

Is there a performance impact?

No. Git AI does not use Git hooks and it does not wrap Git, so you won't see any overhead on your Git commands.

Do I have to set up agent hooks?

Nope — Git AI manages the agent hooks and checks/updates them daily. If you want to trigger this yourself (ie just installed a new agent) run git ai install-hooks.

Who uses this?

Hundreds of engineering teams (including many in the Fortune 100) use Git AI to understand their AI usage and make agents more effective on their codebase.

What's the difference between the open source CLI and the teams version?

The CLI accurately attributes AI code on every commit. The teams version adds a secure prompt store and joins in data from across the SDLC — tying token spend to individual Pull Requests, calculating % AI by PR, team, and repo, and connecting signals like amount of rework during code review, and even tying incidents back to the AI session that caused them. Self-host it or run it in our cloud: connect your SCM and get aggregate stats across thousands of repos plus full observability into everything your coding agents do.

Who built this?

Aidan and Sasha — say hi in Discord or set up a Meet the maintainers call.

What are the capabilities and known limitations?

Git AI provides line-level attribution for AI-generated code - whether it is written with an edit tool or a bash command. When a Git rewrite operation is run (rebase, stash, squash --merge, etc) Git AI will move and merge attributions so nothing is lost.

Here is a full breakdown of what is supported today:

CapabilityStatusNotes
Edit / Write / Patch toolsLine-level attribution recorded automatically.
Files created via BashMay not work if the agent is not operating from the repository root.
git worktreesAttribution maintained across linked worktrees.
Background AgentsSee docs for Claude Web, Codex Cloud, Cursor Agent, and Devin.
Attribute lines from multiple Agent Sessions in the same commit
Record which lines a human overrode
Attribute sessions that produced no codeRecords token usage and session activity even when no code is accepted.
Accepted rate per session
Added and deleted lines per session
Tool-call level attributionResolves attributed lines to the tool call that generated them.
Tokens and cost per commit and PRAggregates token usage and cost across the sessions behind each commit/PR.
FormattersFormatting will not change attribution to human.
Multi-repo root⚠️If you run an agent that edits multiple repos, Bash attributions only work when the agent runs each command with its cwd inside that repo.

git Rewrite Operations:

OperationStatusNotes
git rebaseAttribution preserved. View Code
git cherry-pickAttribution preserved. View Code
git stash / git stash popAttribution preserved. View Code
git merge --squashAttribution preserved. View Code
git reset --softAttribution preserved. View Code
git reset --mixedAttribution preserved. View Code
git reset --hardAttribution preserved for commits that remain in history. View Code
git merge (merge commit)Attribution preserved. View Code
git commit --amendAttribution preserved, including unstaged and partially staged changes. View Code
git checkout / git switch (branches)Attribution follows the working tree across branch changes. View Code
git pull (fast-forward / --rebase)Attribution preserved, including autostashed changes. View Code
git push / git fetchAttribution notes synced to/from the remote. View Code
git mvRenames are not yet tracked; attribution does not follow the moved file.
git filter-branch / git filter-repoBulk history rewrites are not tracked.
git replaceObject replacements are not tracked.

GitHub, GitLab, Bitbucket, Azure DevOps:

CapabilityStatusNotes
Squash and MergeRequires Git AI for Teams or Open Source CI Actions to preserve attribution.
Rebase and MergeRequires Git AI for Teams or Open Source CI Actions to preserve attribution.

Resources