Skip to main content

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

  1. Session ingestion — reads AI tool session logs and extracts code blocks (both markdown fences and file write operations)
  2. 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
  3. Attribution storage — stores matches in a local SQLite database (.aigit/attribution.db)
  4. Blame overlay — runs git blame and annotates lines where the originating commit matched an AI code block

Contributing

See CONTRIBUTING.md.

License

Apache 2.0 — see LICENSE.

Metadata

Release files for getaigit 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for getaigit 0.1.0
File Size Uploaded
getaigit-0.1.0.tar.gz 23.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for getaigit 0.1.0
File Interpreter ABI Platform
getaigit-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 47.2 kB

Release files / getaigit-0.1.0.tar.gz

Download URL getaigit-0.1.0.tar.gz
Size 23.4 kB
Tags Source
SHA-256 checksum
How to use checksums
92b8bf100300161967098a9982577e61b9f8a5eb6690e53b0e430e0eaccb144c
BLAKE2b-256 checksum
How to use checksums
553c2bd4b4a823f2cd7193f4c4977a50a29f98da7ac6e07d4527f60cdfe8c7d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 4, 2026.

Transparency log

Release files / getaigit-0.1.0-py3-none-any.whl

Download URL getaigit-0.1.0-py3-none-any.whl
Size 23.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0fbfefdfed8e4ad965ce4201416e60861ae6b66c8a1c4c9e4762cac8e9bb900b
BLAKE2b-256 checksum
How to use checksums
10406cf1ba3207ea2b2bbac22817aa38f5611ba22f8267b037f45c3d059f8341
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 4, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page