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
- 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.
Custom Database Path
For multi-agent deployments (e.g., agent-swarm workers), you can configure a custom database path:
export AI_TRACKER_DB_PATH="/path/to/custom/tracker.db"
This allows each agent to have its own isolated database file.
Query the Database
# 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)
Metadata
Release files for cc-ai-tracker 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cc_ai_tracker-0.2.0.tar.gz | 16.7 kB | Without provenance | Details for cc_ai_tracker-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cc_ai_tracker-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for cc_ai_tracker-0.2.0-py3-none-any.whl |
Total release size: 39.2 kB
Release files / cc_ai_tracker-0.2.0.tar.gz
| Download URL | cc_ai_tracker-0.2.0.tar.gz |
|---|---|
| Size | 16.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
62d7ea593f8a61f99e68e886e0c5d2fe5a07e5bb91568b9b202acfb8406331dd
|
|
BLAKE2b-256 checksum How to use checksums |
b57aa68849e2fc8724a3a897dcf4e4611616db2bd97c861b9240dde9a81af56c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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}
|
Release files / cc_ai_tracker-0.2.0-py3-none-any.whl
| Download URL | cc_ai_tracker-0.2.0-py3-none-any.whl |
|---|---|
| Size | 22.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e0a13ff4c703ca85bb73d449c7f363a08579b84b66a3d2027c039c995dba2432
|
|
BLAKE2b-256 checksum How to use checksums |
d48790728a0c8b3d2bbc3b1d95089a51c0db2185e5b91a4ec21c4894b11ad026
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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}
|
Security for cc-ai-tracker 0.2.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.