We built git blame for AI agents – here’s how it works

Your team uses Claude Code, Cursor, or Gemini to write code. 60-80% of new commits are AI-generated.

But when a bug appears – can you answer: which AI wrote this line?

We built Origin to solve this. Here’s how it works under the hood.

The p…


This content originally appeared on DEV Community and was authored by Artem Dolobanko

Your team uses Claude Code, Cursor, or Gemini to write code. 60-80% of new commits are AI-generated.

But when a bug appears - can you answer: which AI wrote this line?

We built Origin to solve this. Here's how it works under the hood.

The problem

Traditional git blame shows who committed code. But when your whole team uses AI agents, "who committed" is always the developer — even when Claude wrote 90% of the file.

You lose:

• which agent generated the code
• what prompt produced it
• what model was used
• what it cost

How Origin tracks it

Every time an AI agent starts a session, Origin hooks fire:

# Claude Code hooks (auto-installed via origin init)
origin hooks claude-code session-start
origin hooks claude-code user-prompt-submit
origin hooks claude-code stop

When a commit happens, Origin writes session data to git notes:

git notes show HEAD
# Origin-Session: abc123
# Agent: claude-code
# Model: claude-opus-4-6
# Cost: $2.40
# Prompts: 12

AI Blame

Now you can see who wrote every line:

origin blame src/api.ts

Line  Tag  Model              Content
────────────────────────────────────────
1     [HU]                   import express from 'express'
2     [AI] claude-opus-4-6   const app = express()
3     [AI] claude-opus-4-6   app.use(express.json())
4     [HU]                   // my custom middleware

Retroactive attribution

Already have a repo with months of AI commits but no tracking?

origin backfill --apply

Origin analyzes commit message patterns, author emails, and code style to detect which commits were AI-generated — even without hooks.

Policy enforcement

Origin also enforces rules before commits land:

# Block commits containing secrets
# Block commits to restricted files
# Enforce budget limits per agent

Pre-commit hook fetches active policies from your Origin dashboard and blocks violations before they hit the repo.

Try it

npm i -g https://getorigin.io/cli/origin-cli-latest.tgz
origin init

Works with Claude Code, Cursor, Gemini CLI, Codex. Data stored in git notes — no server required for standalone mode.

Open source CLI: https://github.com/dolobanko/origin-cli
Team dashboard: https://getorigin.io


This content originally appeared on DEV Community and was authored by Artem Dolobanko


Print Share Comment Cite Upload Translate Updates
APA

Artem Dolobanko | Sciencx (2026-03-26T16:51:19+00:00) We built git blame for AI agents – here’s how it works. Retrieved from https://www.scien.cx/2026/03/26/we-built-git-blame-for-ai-agents-heres-how-it-works/

MLA
" » We built git blame for AI agents – here’s how it works." Artem Dolobanko | Sciencx - Thursday March 26, 2026, https://www.scien.cx/2026/03/26/we-built-git-blame-for-ai-agents-heres-how-it-works/
HARVARD
Artem Dolobanko | Sciencx Thursday March 26, 2026 » We built git blame for AI agents – here’s how it works., viewed ,<https://www.scien.cx/2026/03/26/we-built-git-blame-for-ai-agents-heres-how-it-works/>
VANCOUVER
Artem Dolobanko | Sciencx - » We built git blame for AI agents – here’s how it works. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2026/03/26/we-built-git-blame-for-ai-agents-heres-how-it-works/
CHICAGO
" » We built git blame for AI agents – here’s how it works." Artem Dolobanko | Sciencx - Accessed . https://www.scien.cx/2026/03/26/we-built-git-blame-for-ai-agents-heres-how-it-works/
IEEE
" » We built git blame for AI agents – here’s how it works." Artem Dolobanko | Sciencx [Online]. Available: https://www.scien.cx/2026/03/26/we-built-git-blame-for-ai-agents-heres-how-it-works/. [Accessed: ]
rf:citation
» We built git blame for AI agents – here’s how it works | Artem Dolobanko | Sciencx | https://www.scien.cx/2026/03/26/we-built-git-blame-for-ai-agents-heres-how-it-works/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.