Know which AI agent wrote each line. Undo just theirs.

Three agents and two people work in one repository. git blame can only name whoever committed. DeepBlame names the agent, what it was asked for, and what it cost — and takes one agent's work back out without losing anyone else's.

$ npx deepblame init
Read the source →

Node 20+. Any git repository. Open source, nothing to sign up for.

~/code/app
$ deepblame blame src/upload.ts

src/upload.ts  10 lines, 50% traced, 50% written by agents

  1-4          you, or a tool nobody recorded
  5-9          claude-code  feb92f2  add a retry  90%  changed elsewhere since, this line came through
  10           you, or a tool nobody recorded

Records every coding agent you already use, and exchanges it in the format the agent vendors agreed on

Claude Codeevery prompt, read and edit
Cursorevery prompt, read and edit
OpenCodeedits, with its own prices
Codexturn by turn
Everything elseat commit level, always

git blame names a person. Nobody wrote this code.

A commit says a human made it. It cannot say which tool typed it, what it was asked to do, or what it read first. Every vendor keeps its own history, and none of them covers the others. DeepBlame keeps one record for all of them, in your own repository.

blame

Which agent wrote this line, with a confidence you can check.

A line is claimed only when it can be followed from the state the run left to the file as it stands now. Anything else is reported as unknown rather than guessed at. It survives edits elsewhere in the file, follows the file through renames, and keeps the line at a lower confidence when a formatter reindents everything — and says so.

See every command →
blame --why 7
$ deepblame blame src/upload.ts --why 7

line 7 of src/upload.ts

  written by  claude-code  claude-opus-4-5
  run         feb92f2  2026-09-27T09:14:02Z
  intent      add a retry around the upload
  confidence  90%  changed elsewhere since, this line came through
  the turn    $0.0431, 6 tool calls

revert

Take one agent's work back out. Keep everyone else's.

An agent adds a retry loop to upload.ts. You rename the export in the same file. Revert takes the retry loop out and leaves your rename standing. A plain three-way merge cannot do that — two changes on adjacent lines conflict — because DeepBlame has something git does not: a record of which lines belong to the agent.

Nothing is written without --apply. A file that moved on too far is reported, not mangled.

revert --agent claude-code
$ deepblame revert --agent claude-code

Undoing 1 run by claude-code  ~/code/app

  ✓ src/upload.ts  3 lines        comes out cleanly
  · src/index.ts   12 lines       changed again after the agent

Nothing has been written yet.
Add --apply to undo 1 file.

cost

What the agents actually spent, per turn and per model.

Read from the agent's own session log. Where the agent reports its own price, that figure is used instead of ours. A model with no known rate is left blank rather than guessed at — a missing number is honest, an invented one is not.

cost --days 7
$ deepblame cost --days 7

7 days  38 runs, 1.2M tokens  $84.15

  by agent
    claude-code   31 runs   $79.40
    cursor         7 runs    $4.75

  by model
    claude-opus-4-5     31 runs   $79.40
    claude-haiku-4-5     7 runs    $4.75

One record, wherever the question gets asked.

The ledger is a git ref, so sharing it is the thing git is already good at. Everything below reads the same record, on your machine or on your team's.

In your editor

A mark down the left edge of every line an agent wrote, the agent and the prompt at the end of the line your cursor is on, and undo from the hover — after it shows you the plan.

The VS Code extension →
6   if (!res.ok) {
7     │ await sleep(backoff);
      claude-code · add a retry
8   }

On every pull request

How much of a change an agent wrote, counting only the lines it touches. A drop-in Action posts it and replaces its own comment rather than piling up.

50% of this change
was written by agents
14 of 28 lines

  claude-code  11 lines
  cursor        3 lines
  you          14 lines

Across the team

Push your runs, pull everyone else's. Joining two ledgers cannot conflict by construction, and the file contents travel too — so blame and revert work on a colleague's agent from your own machine.

$ deepblame push
Sent the ledger to origin.
  12 runs, 3 came in first.

$ deepblame pull
4 runs came in from origin.

It speaks the standard, so your record is not stuck here.

Agent Trace is the interchange format Cursor published, with Anthropic, Cognition, Cloudflare, Vercel and Google behind it. DeepBlame writes it and reads it, which means attribution can move between tools instead of being locked to whichever one recorded it.

agent trace

What comes in from elsewhere is marked as reported, not as something we saw.

A trace says which lines an agent wrote. It carries no before-image, so an imported line is blamed at 80% with the reporting tool named, and revert will not touch it — there is nothing to put back.

A claim is only taken in if git can still show the state it was made against: the revision it names, or a content hash that matches the lines in your file today. That second path is how a trace from a colleague's clone lands correctly with no shared history. Anything else is counted, reported and left out rather than guessed at.

trace import
$ deepblame trace import ./traces
Took in 1 record  from cursor

$ deepblame blame app.ts

  1-2          you, or a tool nobody recorded
  3            cursor (reported)  9f874ac  80%
               another tool's trace says so;
               we did not watch it happen

Every command.

One setup, then four commands answer nearly everything. No dashboard to learn, no account to make.

deepblame initSet up the ledger, local state and capture hooks
deepblame blame <file>Which agent wrote each line, and how sure we are
deepblame revertUndo one agent's work and nobody else's
deepblame costWhat the agents spent, by model and by agent
deepblame reportHow much of a branch or pull request an agent wrote
deepblame push / pullShare the ledger with your team
deepblame trace exportWrite the ledger as Agent Trace, for any tool to read
deepblame trace importTake in attribution another tool recorded
deepblame log / showEvery recorded run, and one run in full
deepblame doctorCheck recording is working, and say what to fix
deepblame gcAge old file contents out of the ledger

It never sends anything anywhere.

The ledger lives in a git ref in your own repository, refs/deepblame/ledger. It is never checked out, so your branches, working tree and index stay exactly as they were, and it is never signed with your key — a signing prompt can never block an agent. Prompts stay on your machine unless your team turns that on. There is no account, no server and no telemetry, and the whole thing is Apache-2.0 on GitHub.

Start recording now.

One command. It sets up the ledger and wires up whichever agents your project already uses.

$ npx deepblame init

Read the source on GitHub →