A Git extension for tracking the AI-generated code in your repos
Find a file
Sasha Varlamov 298cf03c26
Merge pull request #1196 from git-ai-project/svarlamov-patch-1
Revise CONTRIBUTING.md for task commands and cleanup
2026-04-24 15:14:02 +00:00
.cargo fix(ci): apply mold config and test binary ref fixes from ae7633a1 2026-03-19 10:24:31 -07:00
.github Use GitHub App token for release version bump push 2026-04-23 15:24:38 -04:00
.vscode update all settings 2025-09-19 19:42:53 +02:00
agent-support Merge pull request #914 from git-ai-project/devin/1775068693-sentry-filter-plugin-errors 2026-04-18 17:44:50 +00:00
assets/docs scale 2026-04-17 14:01:01 -04:00
docs docs: add implementation plan for daemon production logging migration 2026-04-15 03:34:34 +00:00
scripts Harden flaky test retry scripts: fail-fast on >5 failures, fix Windows log streaming 2026-04-21 22:05:49 +00:00
skills make local prompt analysis robust to rebases and merges 2026-04-07 08:45:40 -04:00
specs major commit hook performance improvements for commits with many files w/o ai changes 2026-02-11 18:24:10 -05:00
src Strip prompt messages during serialization in release builds 2026-04-23 13:28:02 +00:00
tests fmt 2026-04-19 15:16:53 -04:00
.env.example Add nightly agent CLI integration test workflow 2026-03-09 21:41:40 -07:00
.gitignore Add .claude/worktrees/ to .gitignore 2026-04-08 02:49:41 +00:00
.gitmodules added submodule with squash examples plus snapshot tests 2025-09-27 13:21:05 +02:00
AGENTS.md update agent instructions 2026-04-20 09:37:59 -04:00
ai Add ./ai CLI for worktree-based dev workflows 2026-04-19 16:45:01 +00:00
Cargo.lock chore: bump version to 1.3.5 [skip ci] 2026-04-23 14:18:03 +00:00
Cargo.toml chore: bump version to 1.3.5 [skip ci] 2026-04-23 14:18:03 +00:00
CHANGELOG.md Add AI-powered automated changelog generation workflow 2026-02-12 21:01:14 +00:00
CLAUDE.md edits to tooling and ai guidance by hand 2026-04-19 15:14:42 -04:00
CONTRIBUTING.md Revise CONTRIBUTING.md for task commands and cleanup 2026-04-24 11:13:49 -04:00
data-privacy.md Update data-privacy.md 2026-04-20 17:43:23 -04:00
flake.lock Add Nix flake for building, packaging, and deployment 2026-02-06 14:15:30 -08:00
flake.nix chore: bump version to 1.3.5 [skip ci] 2026-04-23 14:18:03 +00:00
install.ps1 fix: disable PowerShell progress bar during download to fix extreme slowness 2026-03-31 17:13:21 +00:00
install.sh Revert changes to install.sh 2026-04-10 18:34:23 -07:00
lefthook.yml Add lefthook pre-commit hooks and dev tooling 2026-03-18 14:14:50 -07:00
LICENSE Change license from MIT to Apache 2.0 2025-10-16 06:44:49 -04:00
README-nix.md Update README-nix.md 2026-02-06 22:29:34 -05:00
README.md fix 2026-04-20 13:22:07 -04:00
Taskfile.yml fmt 2026-04-19 15:16:53 -04:00

git-ai Discord

Git AI Logo

Git AI is an open source git extension that tracks AI-generated code in your repositories.

Once installed, it automatically links every AI-written line to the agent, model, and transcripts that generated it — so you never lose the intent, requirements, and architecture decisions behind your code.

AI attribution on every commit:

git commit

[hooks-doctor 0afe44b2] wsl compat check
 2 files changed, 81 insertions(+), 3 deletions(-)
you  ██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ ai
     6%             mixed   2%             92%

AI Blame shows the model, agent, and session behind every line:

git-ai blame /src/log_fmt/authorship_log.rs


cb832b7 (Aidan Cunniffe      2025-12-13 08:16:29 -0500  133) pub fn execute_diff(
cb832b7 (Aidan Cunniffe      2025-12-13 08:16:29 -0500  134)     repo: &Repository,
cb832b7 (Aidan Cunniffe      2025-12-13 08:16:29 -0500  135)     spec: DiffSpec,
cb832b7 (Aidan Cunniffe      2025-12-13 08:16:29 -0500  136)     format: DiffFormat,
cb832b7 (Aidan Cunniffe      2025-12-13 08:16:29 -0500  137) ) -> Result<String, GitAiError> {
fe2c4c8 (claude [session_id] 2025-12-02 19:25:13 -0500  138)     // Resolve commits to get from/to SHAs
fe2c4c8 (claude [session_id] 2025-12-02 19:25:13 -0500  139)     let (from_commit, to_commit) = match spec {
fe2c4c8 (claude [session_id] 2025-12-02 19:25:13 -0500  140)         DiffSpec::TwoCommit(start, end) => {
fe2c4c8 (claude [session_id] 2025-12-02 19:25:13 -0500  141)             // Resolve both commits
fe2c4c8 (claude [session_id] 2025-12-02 19:25:13 -0500  142)             let from = resolve_commit(repo, &start)?;...

Supported Agents

Claude Code Codex Cursor GitHub Copilot OpenCode
Pi Windsurf Droid Amp Gemini
Continue Junie Rovo Dev Firebender + Add an Agent

Install

Mac, Linux, Windows (WSL)

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

Windows (non-WSL)

Non-WSL Windows support is currently experimental and under active development. We would love to hear your feedback while we work to get non-WSL Windows support production-ready.

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

That's it — no per-repo setup required. Prompt and commit as normal. Git AI tracks attribution automatically.

Our Choices

  • No workflow changes — Just prompt and commit. Git AI tracks AI code accurately without cluttering your git history.
  • "Detecting" AI code is an anti-pattern — Git AI does not guess whether a hunk is AI-generated. Supported agents report exactly which lines they wrote, giving you the most accurate attribution possible.
  • Local-first — Works 100% offline, no login required.
  • Git native and open standard — Git AI built the open standard for tracking AI-generated code with Git Notes.
  • Secure Prompt Storage — Git AI links each line of AI-code to the prompt that generated it. Since v1.0.0 Agent Sessions are stored outside of Git and can optionally be synced to your team's cloud or self-hosted prompt store -- keeping repos lean, enabling fine-grained access control, and preventing PII or secrets from leaking into Git.

How Git AI works

  1. Edit|Write|Bash Hooks get triggered as Agents make changes to a repository
  2. Hooks call git-ai checkpoint to link each line of AI-Code to the model, Agent and prompt that generated it.
  3. Post Commit a Git Note with AI-attributions in it is attached to the commit
  4. On merge --squash, rebase, cherry-pick, stash, pop, commit --amend, etc AI-attributions are automatically moved

Example Note

refs/notes/ai/commit_sha

hooks/post_clone_hook.rs
  prompt_id_123 6-8
  prompt_id_456 16,21,25
main.rs
  prompt_id_123 12-199,215,311
---
...Prompt metadata including agent, model, and a link to the full session transcript

For more information review Git AI's open standard for attributing AI-code with Git Notes.


Attribution Stats

Line-level AI-attribution let you track AI-code through the full SDLC. Track how much AI code gets accepted, committed, through code review, and into production — to identify which tools and practices work best.

git-ai stats --json
git ai stats <start_sha>..<end_sha> --json

Calculates % AI-code, AI-lines generated vs committed, accepted rates, human overrides broken down by tool and model. Learn more: Stats command reference docs.

Example JSON output
{
  "human_additions": 28,
  "mixed_additions": 5,
  "ai_additions": 76,
  "ai_accepted": 47,
  "total_ai_additions": 120,
  "total_ai_deletions": 34,
  "time_waiting_for_ai": 240,
  "tool_model_breakdown": {
    "claude_code/claude-sonnet-4-5-20250929": {
      "ai_additions": 76,
      "mixed_additions": 5,
      "ai_accepted": 47,
      "total_ai_additions": 120,
      "total_ai_deletions": 34,
      "time_waiting_for_ai": 240
    }
  }
}

For Teams

Git AI For Teams aggregates attribution data at the PR, contributor, team repository, and organization level:

  • Full lifecycle tracking — See how much AI code is accepted, committed, rewritten in review, and deployed — and whether it causes alerts or incidents once shipped.
  • Team and contributor stats — Identify who uses background agents effectively and what high-leverage teams do differently.
  • Agent readiness — Measure the impact of skills, rules, MCPs, test harnesses, and AGENTS.md changes across repos and task types.
new-graphic-dashboards

Set up your dashboards


AI Blame

Git AI blame is a drop-in replacement for git blame that shows AI attribution for each line. It supports all standard git blame flags.

git-ai blame /src/log_fmt/authorship_log.rs
cb832b7 (Aidan Cunniffe 2025-12-13 08:16:29 -0500  133) pub fn execute_diff(
cb832b7 (Aidan Cunniffe 2025-12-13 08:16:29 -0500  134)     repo: &Repository,
cb832b7 (Aidan Cunniffe 2025-12-13 08:16:29 -0500  135)     spec: DiffSpec,
cb832b7 (Aidan Cunniffe 2025-12-13 08:16:29 -0500  136)     format: DiffFormat,
cb832b7 (Aidan Cunniffe 2025-12-13 08:16:29 -0500  137) ) -> Result<String, GitAiError> {
fe2c4c8 (claude         2025-12-02 19:25:13 -0500  138)     // Resolve commits to get from/to SHAs
fe2c4c8 (claude         2025-12-02 19:25:13 -0500  139)     let (from_commit, to_commit) = match spec {
fe2c4c8 (claude         2025-12-02 19:25:13 -0500  140)         DiffSpec::TwoCommit(start, end) => {
fe2c4c8 (claude         2025-12-02 19:25:13 -0500  141)             // Resolve both commits
fe2c4c8 (claude         2025-12-02 19:25:13 -0500  142)             let from = resolve_commit(repo, &start)?;
fe2c4c8 (claude         2025-12-02 19:25:13 -0500  143)             let to = resolve_commit(repo, &end)?;
fe2c4c8 (claude         2025-12-02 19:25:13 -0500  144)             (from, to)
fe2c4c8 (claude         2025-12-02 19:25:13 -0500  145)         }

There are community plugins that display AI-attribution in popular IDEs, color-coded by agent session. Hover over a line to see the raw prompt or summary.

Supported Editors
Git AI VS Code extension showing color-coded AI blame in the gutter

Understand Why with the /ask Skill

See something you don't understand? The /ask skill lets you talk to the agent that wrote the code about its instructions, decisions, and the intent of the engineer who assigned the task. Git AI adds the /ask skill to ~/.agents/skills/ at install time so you can talk to it from any agent.

/ask Why didn't we use the SDK here?

Agents with access to the original intent and source code understand the "why." Agents that can only read the code can tell you what it does, but not why:

Reading Code + Transcript (/ask) Only Reading Code (not using Git AI)
When Aidan was building telemetry, he instructed the agent not to block the exit of our CLI flushing telemetry. Instead of using the Sentry SDK directly, we came up with a pattern that writes events locally first via append_envelope(), then flushes them in the background via a detached subprocess. This keeps the hot path fast and ships telemetry async after the fact. src/commands/flush_logs.rs is a 5-line wrapper that delegates to src/observability/flush.rs (~700 lines). The commands/ layer handles CLI dispatch; observability/ handles Sentry, PostHog, metrics upload, and log processing. Parallel modules like flush_cas, flush_logs, flush_metrics_db follow the same thin-dispatch pattern.
Make Your Agents Smarter

Agents make fewer mistakes and produce more maintainable code when they understand the requirements and decisions behind the code they build on. The best way to provide this context is to give agents the same /ask tool you use yourself. Tell your agents to use /ask in plan mode:

Claude|AGENTS.md

- In plan mode, always use the /ask skill to read the code and the original transcript that generated it. Understanding intent will help you write a better plan.

Resources

License

Apache 2.0