Extract provenance from AI agent execution traces
Project description
ai-blame
Extract provenance from AI agent execution traces.
Like git blame, but for AI-assisted edits.
Why?
AI coding assistants modify your files, but git blame only shows who committed the changes—not which AI model actually wrote them. ai-blame fills this gap by extracting provenance from execution traces and embedding it in your files.
Features
- Automatic trace discovery — Finds Claude Code traces based on your project directory
- Multiple output modes — Append to files, create sidecars, or embed as comments
- Configurable per file type — Different policies for YAML, JSON, Python, etc.
- Dry-run by default — Preview changes before applying
- Flexible filtering — By file pattern, change size, or time range
Installation
pip install ai-blame
# Or with uv
uv pip install ai-blame
Quick Start
# Check what traces are available
ai-blame stats
# Preview what would be added (dry run)
ai-blame mine --initial-and-recent
# Apply changes
ai-blame mine --apply --initial-and-recent
# Filter to specific files
ai-blame mine --pattern ".py" --apply
Output Examples
YAML/JSON files — Append directly
# config.yaml
name: my-project
version: 1.0
edit_history:
- timestamp: "2025-12-01T08:03:42+00:00"
model: claude-opus-4-5-20251101
agent_tool: claude-code
action: CREATED
Code files — Sidecar or comments
# main.py (with comment policy)
def hello():
print("Hello, world!")
# --- edit_history ---
# - timestamp: '2025-12-01T08:03:42+00:00'
# model: claude-opus-4-5-20251101
# action: CREATED
# --- end edit_history ---
Or use sidecar files: main.py → main.history.yaml
Configuration
Create .ai-blame.yaml in your project root:
defaults:
policy: sidecar
sidecar_pattern: "{stem}.history.yaml"
rules:
- pattern: "*.yaml"
policy: append
- pattern: "*.json"
policy: append
format: json
- pattern: "*.py"
policy: comment
comment_syntax: hash
- pattern: "tests/**"
policy: skip
Supported Agents
| Agent | Status |
|---|---|
| Claude Code | ✅ Supported |
| OpenAI Codex | 🔜 Planned |
| Others | PRs welcome! |
Documentation
Full documentation: ai4curation.github.io/ai-blame
Contributing
We welcome contributions! See CONTRIBUTING.md.
PRs especially welcome for additional agent support (Cursor, Aider, Copilot, etc.).
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.2.0.tar.gz.
File metadata
- Download URL: ai_blame-0.2.0.tar.gz
- Upload date:
- Size: 1.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
19773e689c549d4bfa1dbd559ba5a0ce0370107e1411b37572e7a3cc9d54102d
|
|
| MD5 |
8c92527451e7f4c27a59cc18811357b7
|
|
| BLAKE2b-256 |
9df3a967e618d3d531080bb6163ca836a98923cddf3eb468708f53bbd236c106
|
Provenance
The following attestation bundles were made for ai_blame-0.2.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.2.0.tar.gz -
Subject digest:
19773e689c549d4bfa1dbd559ba5a0ce0370107e1411b37572e7a3cc9d54102d - Sigstore transparency entry: 775950427
- Sigstore integration time:
-
Permalink:
ai4curation/ai-blame@ef1a3ecb3820593c7687b1cc4640773661dcafc1 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/ai4curation
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yaml@ef1a3ecb3820593c7687b1cc4640773661dcafc1 -
Trigger Event:
release
-
Statement type:
File details
Details for the file ai_blame-0.2.0-py3-none-any.whl.
File metadata
- Download URL: ai_blame-0.2.0-py3-none-any.whl
- Upload date:
- Size: 16.1 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 |
6c6ee69aa796aa4b92d6d6bf822eba45a3eb8be97d98fa3df2bf5b631c783dc5
|
|
| MD5 |
b9f4deb8b19f24517f25cf142cccdfbb
|
|
| BLAKE2b-256 |
686a287c9533e4f554c4e761c043309f9e8635c69188f60916c8ab2dee0c13f3
|
Provenance
The following attestation bundles were made for ai_blame-0.2.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.2.0-py3-none-any.whl -
Subject digest:
6c6ee69aa796aa4b92d6d6bf822eba45a3eb8be97d98fa3df2bf5b631c783dc5 - Sigstore transparency entry: 775950430
- Sigstore integration time:
-
Permalink:
ai4curation/ai-blame@ef1a3ecb3820593c7687b1cc4640773661dcafc1 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/ai4curation
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yaml@ef1a3ecb3820593c7687b1cc4640773661dcafc1 -
Trigger Event:
release
-
Statement type: