Track AI code from prompt to production

A git extension that tracks AI code through the entire SDLC.

No workflow changes

Just prompt and commit

Install the open-source Git extension and work as usual. Every line of AI code is tracked through the entire SDLC — zero overhead, no workflow changes, no git hooks.

AI-attribution for every line

AI Blame

Git AI links each line of AI code to the agent, model, and prompt that generated it. Attribution survives rebases, merges, stash/pops, squashes, resets, and cherry-picks.

Git AI is the open standard for tracking AI-code with Git

Record the agent, model and session behind every line of AI-code.

Performance
+0ms

Zero overhead on your git commands

Git AI runs outside the hot path. Every commit, rebase, and push is exactly as fast as before.

Setup
Simple setup

Install once, works in every repo

No git hooks, no per-repo config. Install it on your machine and every repository is tracked automatically.

Tracking · line-level attribution
  • When agents use write tools
    Patch, multiedit, edit & write — attributed line by line
  • When agents use bash to write code
    Resulting file changes are attributed too
  • Across Git worktrees
    Maintained across every linked worktree
  • Track multiple sessions in the same commit
    Records which lines belong to which session
Attributions preserved through
  • git rebase
    Commits reordered and replayed
  • git squash
    Multiple commits collapsed into one
  • git reset
    Commits unwound to the working tree
  • git cherry-pick
    Commits replayed onto another branch
  • git stash
    Changes shelved and restored
  • Formatters
    Re-formatting keeps every line attribution intact
Session storage

Every line traces back to its source

Git AI links each line to the agent session and the exact tool call that generated it.

Token usage

Cost behind every commit and PR

Git AI tracks the token usage and cost behind every commit and pull request.

git-ai-project / git-ai2.1k54 contributorsOpen source · No AI · Local-first
14+ agents
Cursor
Codex
Claude Code
GitHub Copilot
Gemini
OpenCode
Junie
Droid
Windsurf
Amp

How it works

A hook checkpoints each tool call as agents work; Git AI attaches the record on commit and keeps it accurate through every git operation.

agent · tool call
EditWriteBash
postToolCall
git ai checkpoint
records agent · model · prompt · lines
01
Agent hooks

A checkpoint fires on every tool call

Git AI registers a post-tool-call hook with every supported agent. After each Edit, Write, or Bash tool call, the hook runs git ai checkpoint to mark the lines just written — no setup, no workflow changes.

on commit
9f8e7d2refactor db
a1b2c3dsetup routes
3f7a2b1add auth
git note → 3f7a2b1refs/notes/ai
src/auth.ts
session_11-8,10-21
session_29,22-30
src/db.ts
session_112-19
02
Attribution on commit

Git AI attaches a note on every commit

When you commit, Git AI consolidates those checkpoints into a Git note attached to the commit. Your history and commit messages stay clean — the attribution rides alongside in refs/notes/ai.

git rebase
attributions for the final diff copied
git merge --squash
attributions merged into the squashed commit
git cherry-pick
attributions copied for the inserted lines
git commit --amend
attributions merged into the amended commit
git reset --soft/--mixed
attributions moved from the note to the index
git stash / pop
attributions moved with the working tree
git checkout / switch
attributions follow the working tree across branches
git pull --rebase/--autostash
attributions in index and working tree preserved
git push / fetch
attribution notes synced to and from the remote
git rebase
attributions for the final diff copied
git merge --squash
attributions merged into the squashed commit
git cherry-pick
attributions copied for the inserted lines
git commit --amend
attributions merged into the amended commit
git reset --soft/--mixed
attributions moved from the note to the index
git stash / pop
attributions moved with the working tree
git checkout / switch
attributions follow the working tree across branches
git pull --rebase/--autostash
attributions in index and working tree preserved
git push / fetch
attribution notes synced to and from the remote
03
Survives history rewrites

Attribution survives every git operation

Git AI understands each git operation and updates the attribution to match. However you rewrite history, every line stays tied to the agent, model, and session that wrote it.

Accurate line-level AI-attribution, built into Git

Track every line, measure ROI, and use signals from across the SDLC to build a more autonomous software factory.