Architecture
Blamely is small. Three pieces, one local SQLite, one git ref.
- Record. When an AI tool edits a file, its hook calls
blamely record <tool>, which sends the edit to the local daemon. - 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.
- Attribute. On every commit, the global
post-commithook runsblamely attribute, which diffs the commit against stored edits and writes a per-line attribution note. Apost-mergehook does the same for commits agit pullbrings in that carry a cloud agent’sCo-Authored-Bytrailer (Devin Cloud). - Report.
blamely report,blamely stats, andblamely historyread those notes back.
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 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:
git push origin refs/notes/blamelyAnd to fetch them on another machine:
git fetch origin refs/notes/blamely:refs/notes/blamelyWhat 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
/editendpoint. - The post-commit hook runs
blamely attributeat 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-Bytrailer.
Next
- Detection model — exactly which AI tools and gen types are recognized.
- Privacy & data — what stays local.
- CLI commands — the reporting surface.
Something unclear or wrong? Tell us.