Skip to main content

Track AI-generated vs human-made code changes in git repos

Project description

AI Tracker

Track what percentage of code changes in git repos are AI-generated (via Claude Code) vs human-made.

Installation

Option 1: uvx (recommended)

No installation needed - runs directly from PyPI:

uvx cc-ai-tracker stats

Option 2: Local install

Install globally with uv:

uv tool install cc-ai-tracker

Or install from source:

cd ai-tracker
uv tool install .

Then run directly:

ai-tracker stats

Setup

After installation, set up the hooks to start tracking:

ai-tracker install    # Install all hooks (Claude Code + git)

Or with uvx:

uvx cc-ai-tracker install

Usage

With uvx:

uvx cc-ai-tracker stats           # All-time stats
uvx cc-ai-tracker stats --graph   # Stats + chart for last 7 days
uvx cc-ai-tracker stats --chart --days 14  # Custom chart period

With local install:

ai-tracker stats           # All-time stats
ai-tracker stats --graph   # Stats + chart for last 7 days
ai-tracker stats --chart --days 14  # Custom chart period
ai-tracker stats --repo my-project  # Filter by repo

How It Works

  1. Claude Code Hooks (PostToolUse) - Logs every Edit/Write operation with line-level counts
  2. Git Post-commit Hook - Attributes committed changes to AI or human based on the edit log
  3. CLI Stats - Queries SQLite database and displays statistics with Rich formatting

Architecture

~/.config/ai-tracker/
├── tracker.db          # SQLite database (WAL mode)
├── cache/              # Temporary cache for Write tool pre-capture
└── git-hooks/
    └── post-commit     # Global git hook (delegates to local hooks)

Database

Data is stored in ~/.config/ai-tracker/tracker.db using SQLite with WAL mode for concurrent access.

Query the database directly:

# View recent edits
sqlite3 ~/.config/ai-tracker/tracker.db "SELECT * FROM edits ORDER BY timestamp DESC LIMIT 10"

# View commits with attribution
sqlite3 ~/.config/ai-tracker/tracker.db "SELECT * FROM commits ORDER BY timestamp DESC LIMIT 10"

Uninstall

ai-tracker uninstall    # Remove all hooks (Claude Code + git)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cc_ai_tracker-0.1.5.tar.gz (15.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cc_ai_tracker-0.1.5-py3-none-any.whl (20.4 kB view details)

Uploaded Python 3

File details

Details for the file cc_ai_tracker-0.1.5.tar.gz.

File metadata

  • Download URL: cc_ai_tracker-0.1.5.tar.gz
  • Upload date:
  • Size: 15.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.20 {"installer":{"name":"uv","version":"0.9.20","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for cc_ai_tracker-0.1.5.tar.gz
Algorithm Hash digest
SHA256 1e8ab8fad19a899ba3240ab9bb339563158462731eb0e34831b249dee99d94c7
MD5 8786da537031adfca79f0e29fca353db
BLAKE2b-256 6e9de10c0b727fe2c8e0f6cf1e70c7288697a4b2ce39043e82379bd66af34119

See more details on using hashes here.

File details

Details for the file cc_ai_tracker-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: cc_ai_tracker-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 20.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.20 {"installer":{"name":"uv","version":"0.9.20","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for cc_ai_tracker-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 569398509c7678a4de83c2f5d94a29d1baccb27f7800b6ad3c67a7ff91ecc852
MD5 3990a10da4d2df8cc88bc7e04a13b81e
BLAKE2b-256 aee725252110da4014ec912ca37d4e9898f63c0a0fa4f264e12cf33705129c9e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page