Extract provenance from AI agent execution traces
Project description
ai-blame
Extract provenance/audit trails from AI agent execution traces.
Like git blame, but for AI-assisted edits.
Problem Statement
As AI agents increasingly assist with knowledge base curation, we need to track provenance — which agent/model made what changes, when, and why.
See: https://github.com/ai4curation/aidocs/issues/62
Supported Trace Sources
- Claude Code traces (
~/.claude/projects/<encoded-cwd>/)
Installation
uv pip install ai-blame
Or from source:
git clone https://github.com/ai4curation/ai-blame
cd ai-blame
uv sync
Usage
# Show stats about available traces
ai-blame stats
# Dry run - preview what curation_history would be added
ai-blame mine --initial-and-recent
# Actually apply changes to files
ai-blame mine --apply --initial-and-recent
# Filter to specific file
ai-blame mine Asthma.yaml --initial-and-recent
Output Format
Appends a curation_history section to YAML files:
# ... existing content ...
curation_history:
- timestamp: "2025-12-01T08:03:42Z"
model: claude-opus-4-5-20251101
action: CREATED
- timestamp: "2025-12-15T20:34:29Z"
model: claude-opus-4-5-20251101
action: EDITED
How It Works
- Scans Claude Code trace files (JSONL format)
- Identifies successful
EditandWritetool operations - Extracts metadata: timestamp, model, file path
- Groups by file and filters (first+last, size thresholds)
- Appends
curation_historyto affected files
Trace Directory Detection
If --trace-dir is not specified, the tool looks for traces in:
~/.claude/projects/<encoded-cwd>/
Where <encoded-cwd> is your current working directory with / replaced by -.
For example, /Users/cjm/repos/dismech becomes:
~/.claude/projects/-Users-cjm-repos-dismech/
Developer Tools
There are several pre-defined command-recipes available.
They are written for the command runner just. To list all pre-defined commands, run just or just --list.
Credits
This project uses the template monarch-project-copier
License
BSD-3-Clause
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 ai_blame-0.1.0.tar.gz.
File metadata
- Download URL: ai_blame-0.1.0.tar.gz
- Upload date:
- Size: 174.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c9d495e627e96f42746b7b8ce371662308e9bbdd645be49371b41d523c1e5ac
|
|
| MD5 |
564bb880a34628a892bfe26cf3b0e6d8
|
|
| BLAKE2b-256 |
2971a23de6c9d687c75b35882ecbad9120c0e1a2d42838d0e7d2fba41ba543bc
|
Provenance
The following attestation bundles were made for ai_blame-0.1.0.tar.gz:
Publisher:
pypi-publish.yaml on ai4curation/ai-blame
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ai_blame-0.1.0.tar.gz -
Subject digest:
7c9d495e627e96f42746b7b8ce371662308e9bbdd645be49371b41d523c1e5ac - Sigstore transparency entry: 775719209
- Sigstore integration time:
-
Permalink:
ai4curation/ai-blame@382cb5fbc29722a9e49dacd9b126dd79e3c4784b -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/ai4curation
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yaml@382cb5fbc29722a9e49dacd9b126dd79e3c4784b -
Trigger Event:
release
-
Statement type:
File details
Details for the file ai_blame-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ai_blame-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0f3f528fc837eb827965c60951a91351e46ad1507b18093e48a74d0efbda603d
|
|
| MD5 |
89f2ea220bb8fd265048df2868390d29
|
|
| BLAKE2b-256 |
ae4c9de8bf3ce9f128399fbbcbe9bcef294c690fc71f4edaba51048c55326569
|
Provenance
The following attestation bundles were made for ai_blame-0.1.0-py3-none-any.whl:
Publisher:
pypi-publish.yaml on ai4curation/ai-blame
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ai_blame-0.1.0-py3-none-any.whl -
Subject digest:
0f3f528fc837eb827965c60951a91351e46ad1507b18093e48a74d0efbda603d - Sigstore transparency entry: 775719210
- Sigstore integration time:
-
Permalink:
ai4curation/ai-blame@382cb5fbc29722a9e49dacd9b126dd79e3c4784b -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/ai4curation
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yaml@382cb5fbc29722a9e49dacd9b126dd79e3c4784b -
Trigger Event:
release
-
Statement type: