How it works

Architecture

Blamely is small. Three pieces, one local SQLite, one git ref.

  1. Record. When an AI tool edits a file, its hook calls blamely record <tool>, which sends the edit to the local daemon.
  2. Watch. The daemon also tails Codex sessions, Cursor logs, Copilot transcripts, Devin IDE session databases, and the Claude Desktop cowork sandbox’s logs, and observes filesystem activity to catch edits that don’t go through hooks.
  3. Attribute. On every commit, the global post-commit hook runs blamely attribute, which diffs the commit against stored edits and writes a per-line attribution note. A post-merge hook does the same for commits a git pull brings in that carry a cloud agent’s Co-Authored-By trailer (Devin Cloud).
  4. Report. blamely report, blamely stats, and blamely history read those notes back.
terminal

ls ~/.blamely

bin/

db.sqlite

daemon.log

daemon.port

git-hooks/

state.json

Persistence and git

Attribution data lives in two places, both local:

  • Git notes at refs/notes/blamely — one JSON note per commit, attached via the standard git notes mechanism. Notes travel with the repo if you push them; nothing is pushed by default.
  • SQLite database at ~/.blamely/db.sqlite — raw edit events used to compute attribution and to power the editor plugins’ live views.

To inspect a note directly:

git notes

git log --oneline refs/notes/blamely

aaaaaaa notes: Notes added by 'git notes add'

git notes --ref=blamely show HEAD

{

"schema": 2,

"commit": "0000000000000000000000000000000000000000",

"branch": "main",

"totals": {

"ai_lines": 18,

"human_lines": 7,

"deleted_lines": 2,

"files": 3,

"models": { "claude-opus-4-6": 12, "composer-1": 6 }

},

"by_tool": {

"claude": { "lines": 12, "model": "claude-opus-4-6", "tokens": { "input": 4200, "output": 890 } },

"cursor": { "lines": 6, "model": "composer-1", "tokens": { "input": 1100, "output": 340 } }

},

"files": [ ... attribution as {start,end} ranges ... ]

}

Sharing notes with the team

Git notes are local by default. To push them:

terminal
git push origin refs/notes/blamely

And to fetch them on another machine:

terminal
git fetch origin refs/notes/blamely:refs/notes/blamely

What runs where

  • Hooks (Claude Code, Cursor, Codex, Copilot, Gemini, Devin CLI) push edits to the daemon synchronously when the AI tool acts on a file.
  • Watchers inside the daemon poll local logs / files to catch edits that the hooks miss (especially session-based tools that record activity in their own log).
  • Editor plugins observe document-change events for things hooks and logs can’t see (Cursor Tab, Copilot Tab) and post them to the daemon’s /edit endpoint.
  • The post-commit hook runs blamely attribute at commit time. This is where the bar comes from.
  • The post-merge hook attributes pulled commits that were written off this machine, using the agent’s Co-Authored-By trailer.

Next

Something unclear or wrong? Tell us.