Correlate AI coding sessions with git history — attribution, churn, and blame overlay.
Project description
aigit
Correlate AI coding sessions with git history.
aigit tracks which lines of your codebase were written by an AI assistant — and which weren't. It works by matching code blocks from AI session logs to git commits via fuzzy hashing, then surfacing that attribution as a git blame-style overlay and CI report.
4 a1b2c3d [claude_c 100%] def greet(name: str) -> str:
5 a1b2c3d [claude_c 100%] return f"Hello, {name}!"
6 a1b2c3d
7 f9e8d7c def farewell(name: str) -> str:
8 f9e8d7c return f"Goodbye, {name}!"
Why
As AI-assisted coding becomes the norm, teams lose visibility into:
- What percentage of the codebase is AI-authored
- Whether AI-generated code has higher churn or bug rates than hand-written code
- Which specific commits introduced AI-generated code and from what prompt
Install
pip install aigit
Requires Python 3.10+ and git.
Quick start
# 1. Index your AI sessions and git history
aigit index
# 2. View blame with AI attribution overlay
aigit blame src/myfile.py
# 3. See repo-wide AI% stats
aigit stats
# 4. Generate a CI report
aigit ci --format=markdown
Supported AI tools
| Tool | Status |
|---|---|
| Claude Code | Supported (auto-discovers ~/.claude/projects/) |
| OpenAI Codex | Coming soon |
| Cursor | Planned |
| Devin / OpenCode | Planned |
The provider system is pluggable — see CONTRIBUTING.md to add your tool.
Commands
aigit index
Reads AI sessions and walks git history to build a local attribution database at .aigit/attribution.db.
aigit index # auto-discover Claude Code sessions
aigit index --sessions ./my-exports # point to a custom session directory
aigit index --provider codex # use a different provider
aigit blame <file>
Annotates git blame output with AI attribution. Lines written by an AI are highlighted with the tool name and confidence score.
aigit blame src/app.py
aigit blame src/app.py --show-prompt # also show the prompt that generated each line
aigit stats
Shows AI attribution statistics across the repository.
aigit stats # repo-wide summary
aigit stats --file src/app.py # single file
aigit stats --top 50 # show top 50 files (default: 20)
Example output:
aigit stats — 3 sessions, 142 code blocks indexed
File AI lines Total AI% Tools
──────────────────────────────── ──────── ────── ───── ─────────────
src/api/routes.py 87 120 72.5% claude_code:87
src/core/engine.py 54 98 55.1% claude_code:54
tests/test_routes.py 41 60 68.3% claude_code:41
Repo-wide: 182 / 450 lines (40.4% AI-attributed)
aigit ci
Emits a machine-readable report for CI pipelines.
aigit ci # markdown (default)
aigit ci --format=json # JSON
aigit ci --output=report.md # write to file
CI integration (GitHub Actions)
Add this workflow to post an AI attribution report on every pull request:
# .github/workflows/aigit-report.yml
name: aigit AI Attribution Report
on:
pull_request:
types: [opened, synchronize]
jobs:
aigit-report:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: pip install aigit
- run: aigit index
- run: aigit ci --format=markdown --output=aigit-report.md
- uses: marocchino/sticky-pull-request-comment@v2
with:
path: aigit-report.md
header: aigit-attribution
How it works
- Session ingestion — reads AI tool session logs and extracts code blocks (both markdown fences and file write operations)
- Tiered fuzzy matching — compares code blocks against git diff hunks using:
- Exact SHA-256 match → 100% confidence
- TLSH fuzzy hash distance < 30 → 90% confidence
- TLSH fuzzy hash distance < 100 → 70% confidence
- Attribution storage — stores matches in a local SQLite database (
.aigit/attribution.db) - Blame overlay — runs
git blameand annotates lines where the originating commit matched an AI code block
Contributing
See CONTRIBUTING.md.
License
Apache 2.0 — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file getaigit-0.1.0.tar.gz.
File metadata
- Download URL: getaigit-0.1.0.tar.gz
- Upload date:
- Size: 23.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
92b8bf100300161967098a9982577e61b9f8a5eb6690e53b0e430e0eaccb144c
|
|
| MD5 |
dc4a0750b4682faec8c8da78b35093c4
|
|
| BLAKE2b-256 |
553c2bd4b4a823f2cd7193f4c4977a50a29f98da7ac6e07d4527f60cdfe8c7d8
|
Provenance
The following attestation bundles were made for getaigit-0.1.0.tar.gz:
Publisher:
ci.yml on getaigit/getaigit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
getaigit-0.1.0.tar.gz -
Subject digest:
92b8bf100300161967098a9982577e61b9f8a5eb6690e53b0e430e0eaccb144c - Sigstore transparency entry: 1714214996
- Sigstore integration time:
-
Permalink:
getaigit/getaigit@9ac613ecbd31f473db18161c507ed70618ddbc7b -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/getaigit
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@9ac613ecbd31f473db18161c507ed70618ddbc7b -
Trigger Event:
push
-
Statement type:
File details
Details for the file getaigit-0.1.0-py3-none-any.whl.
File metadata
- Download URL: getaigit-0.1.0-py3-none-any.whl
- Upload date:
- Size: 23.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0fbfefdfed8e4ad965ce4201416e60861ae6b66c8a1c4c9e4762cac8e9bb900b
|
|
| MD5 |
9631e27093964f1e9f23bc09ff1561df
|
|
| BLAKE2b-256 |
10406cf1ba3207ea2b2bbac22817aa38f5611ba22f8267b037f45c3d059f8341
|
Provenance
The following attestation bundles were made for getaigit-0.1.0-py3-none-any.whl:
Publisher:
ci.yml on getaigit/getaigit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
getaigit-0.1.0-py3-none-any.whl -
Subject digest:
0fbfefdfed8e4ad965ce4201416e60861ae6b66c8a1c4c9e4762cac8e9bb900b - Sigstore transparency entry: 1714215047
- Sigstore integration time:
-
Permalink:
getaigit/getaigit@9ac613ecbd31f473db18161c507ed70618ddbc7b -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/getaigit
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@9ac613ecbd31f473db18161c507ed70618ddbc7b -
Trigger Event:
push
-
Statement type: