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
Local (development)
cd ai-tracker
uv sync
uv run ai-tracker stats
From PyPI (recommended)
uvx --from cc-ai-tracker ai-tracker stats
Global (run from anywhere)
cd ai-tracker
uv tool install .
This installs ai-tracker globally so you can run it from any directory:
ai-tracker stats
ai-tracker stats --days 7 --chart
To upgrade after making changes:
cd ai-tracker
uv tool install . --force
Setup
# Install Claude Code hooks
uv run ai-tracker setup
# Install global git hooks (works across all repos)
uv run ai-tracker git-install
Usage
# Show stats for last 30 days
uv run ai-tracker stats
# Last 7 days
uv run ai-tracker stats --days 7
# Specific repo
uv run ai-tracker stats --repo my-project
# Include ASCII chart
uv run ai-tracker stats --chart
How It Works
- Claude Code Hooks (
PostToolUse) - Logs every Edit/Write operation with line-level counts - Git Post-commit Hook - Attributes committed changes to AI or human based on the edit log
- 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
# Remove git hooks
uv run ai-tracker git-uninstall
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
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 cc_ai_tracker-0.1.4.tar.gz.
File metadata
- Download URL: cc_ai_tracker-0.1.4.tar.gz
- Upload date:
- Size: 13.9 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f18997b290cd4e1a62d84c9e4a5c5e1f001e0d9299654f462b9ff0fb564ff490
|
|
| MD5 |
428b883c5ea9741da93e5dba71ce6605
|
|
| BLAKE2b-256 |
4ca7c64ed842229fa87a844489f91bc8178c0dd5b25341bfc2245ff09e29b8c5
|
File details
Details for the file cc_ai_tracker-0.1.4-py3-none-any.whl.
File metadata
- Download URL: cc_ai_tracker-0.1.4-py3-none-any.whl
- Upload date:
- Size: 19.0 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c4e4212bc9b68335e0c4145a214832eae708730ba20de8aa6872682f11c26fa4
|
|
| MD5 |
6bdfe17f548c59805e140dc2840f894a
|
|
| BLAKE2b-256 |
30336494cd6efcbdb2caf591846aad2d60975bd420fda9604137e4359bdd3e40
|