| Crates.io | ai-blame |
| lib.rs | ai-blame |
| version | 0.5.3 |
| created_at | 2026-01-05 02:56:08.66191+00 |
| updated_at | 2026-01-06 00:12:05.088937+00 |
| description | Extract provenance from AI agent execution traces - like git blame, but for AI-assisted edits |
| homepage | https://github.com/ai4curation/ai-blame |
| repository | https://github.com/ai4curation/ai-blame |
| max_upload_size | |
| id | 2023010 |
| size | 550,203 |
Extract provenance from AI agent execution traces.
Like git blame, but for AI-assisted edits. See which AI model wrote each line of code.
| Command | What It Does | Example |
|---|---|---|
stats |
Show trace statistics | ai-blame stats |
timeline |
Chronological edit history | ai-blame timeline |
blame |
Line-by-line attribution | ai-blame blame src/main.rs |
transcript |
Explore AI sessions | ai-blame transcript list |
report |
Preview provenance | ai-blame report |
annotate |
Embed provenance in files | ai-blame annotate |
init |
Create starter config | ai-blame init |
Why ai-blame? AI coding assistants modify your files, but git blame only shows who committed the changesβnot which AI model wrote them. ai-blame fills this gap.
The easiest way to install ai-blame is using Python package managers. No Rust toolchain required!
# Using uv (recommended)
uv add --dev ai-blame
# Using pip
pip install ai-blame
# Using pipx (for global installation)
pipx install ai-blame
This installs a pre-built binary that works exactly like the Rust versionβfast, reliable, and dependency-free.
# Install from crates.io
cargo install ai-blame
# Or install from source
git clone https://github.com/ai4curation/ai-blame
cd ai-blame
cargo install --path .
Download the latest release from the releases page.
# Check what traces are available
ai-blame stats
# View timeline of all AI actions
ai-blame timeline
# Preview what would be added (stdout report)
ai-blame report --initial-and-recent
# Apply changes (writes annotations / sidecars)
ai-blame annotate --initial-and-recent
# Filter to specific files
ai-blame annotate --pattern ".py"
Watch a complete walkthrough of all commands:
Shows setup, discovery, line-level blame analysis, and annotation workflows using real traces from ai-blame development.
The tool includes DuckDB caching enabled by default to speed up repeated runs. Trace files are parsed once and results are cached in .ai-blame.ddb in your trace directory.
Caching enabled by default:
# Cache is automatically used
ai-blame stats
# Rebuild cache (delete existing cache and re-parse)
ai-blame stats --rebuild-cache
# Disable cache for a specific run
ai-blame stats --no-cache
Expected speedup:
Cache behavior:
Cache management:
# Delete the cache file to reset
rm .ai-blame.ddb
# Or use the CLI flag to rebuild
ai-blame stats --rebuild-cache
# Disable caching globally
export AI_BLAME_NO_CACHE=1
The Tauri-based desktop app provides a visual interface for exploring AI-assisted code edits.

Features:
# Run the desktop app
cd src-tauri && cargo run --release
See the Desktop App documentation for full details.
This repo uses MkDocs (Material) for user/CLI documentation.
python -m venv .venv
source .venv/bin/activate
pip install -r docs/requirements.txt
mkdocs serve
# 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
# 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
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
| Agent | Status |
|---|---|
| Claude Code | β Supported |
| OpenAI Codex / GitHub Copilot | β Supported |
| Others | PRs welcome! |
This Rust port maintains CLI compatibility with the Python version but offers significant improvements:
pip or uv with pre-built wheelsYou can still install ai-blame using Python package managers:
uv add --dev ai-blame
# or
pip install ai-blame
This installs the same high-performance Rust binaryβno Rust toolchain needed! The CLI commands remain the same, so it's a drop-in replacement for the Python version.
Note: The Python API from the original version is not available in this Rust port. The CLI provides all functionality. If you need programmatic access, please open an issue describing your use case.
# Run tests
cargo test
# Run with debug output
RUST_LOG=debug cargo run -- report
# Build for release
cargo build --release
# Format code
cargo fmt
# Lint code
cargo clippy
This repository uses a Cargo workspace to organize the CLI and Tauri UI components:
ai-blame/
βββ src/ # Core library (ai-blame crate)
β βββ lib.rs # Library root
β βββ main.rs # CLI binary entry point
β βββ cli.rs # CLI command parsing (feature-gated)
β βββ blame.rs # Line-level blame computation
β βββ config.rs # Configuration loading
β βββ extractor.rs # Trace file parsing
β βββ models.rs # Data models
β βββ updater.rs # File annotation logic
βββ src-tauri/ # Tauri desktop app (ai-blame-ui crate)
β βββ Cargo.toml # UI-specific dependencies
β βββ tauri.conf.json # Tauri configuration
β βββ src/main.rs # Tauri backend (invokes core library)
β βββ icons/ # Application icons for bundling
βββ ui/ # Static HTML/CSS/JS frontend
β βββ index.html # Main UI layout
β βββ app.js # UI logic
β βββ styles.css # Styling
βββ tests/ # Integration tests
βββ Cargo.toml # Workspace root + core library config
βββ tools/ # Development utilities
βββ generate_icons.py
ai-blame): Contains all reusable logic for parsing traces, computing blame, and updating filescli feature flag (enabled by default)ai-blame-ui): Depends on the core library with default-features = false to avoid pulling in CLI-only dependencies like clapThis structure follows Tauri best practices by keeping the Tauri binary in src-tauri (required for tauri dev/build to work) while sharing code through the core library.
cli (default): Enables CLI command parsing with clap. Disable with --no-default-features when using only the library API.BSD-3-Clause
Contributions welcome! This is a port of the Python ai-blame project.
PRs especially welcome for: