Skip to main content
v1.8.0Forge merge attribution is on GitHub Marketplace

Line-level proof of who wrote your code

Which person, which agent, which model. git-byline observes edits as they happen and keeps line-level provenance in Git notes. No cloud, no account, no telemetry.

MIT licensed · one pure Go binary · macOS, Linux, and Windows

git byline · demo repository
HEAD~6..HEAD
git byline blame src/pricing.go
human 11ai 9human-override 5
human:john.doe1package pricing
human:john.doe2
human:john.doe3// Plan is one billable customer plan.
human:john.doe4type Plan struct {
human:john.doe5 Name string
human:john.doe6 Seats int
human:john.doe7}
human:john.doe8
human:john.doe9func (p Plan) Valid() bool {
human:john.doe10 return p.Name != "" && p.Seats > 0
human:john.doe11}
ai:droid/claude-sonnet-4-512
ai:droid/claude-sonnet-4-513// Total returns the plan price for one billing period.
ai:droid/claude-sonnet-4-514func (p Plan) Total(unit int) int {
human-override:john.doe/droid/claude-sonnet-4-515 // Volume discount applies from the eleventh seat.
human-override:john.doe/droid/claude-sonnet-4-516 if p.Seats > 10 {
human-override:john.doe/droid/claude-sonnet-4-517 return unit * p.Seats * 9 / 10
human-override:john.doe/droid/claude-sonnet-4-518 }
human-override:john.doe/droid/claude-sonnet-4-519 return unit * p.Seats
ai:droid/claude-sonnet-4-520}
ai:droid/claude-sonnet-4-521
ai:droid/claude-sonnet-4-522// Annual returns the discounted price for a yearly commitment.
ai:droid/claude-sonnet-4-523func (p Plan) Annual(unit int) int {
ai:droid/claude-sonnet-4-524 return p.Total(unit) * 10
ai:droid/claude-sonnet-4-525}
refs/notes/byline6 of 6 commits annotated

Native hooks for ten coding agents, one attribution format

  • Factoryai:factory
  • Claude Codeai:claude
  • GitHub Copilotai:copilot
  • VS Code Agentai:vscode
  • Cursorai:cursor
  • Codexai:codex
  • Gemini CLIai:gemini
  • Windsurfai:windsurf
  • Grokai:grok
  • OpenCodeai:opencode

The missing layer

Git knows who committed a line. Not who wrote it.

One commit can mix lines a person typed, lines an agent generated, and lines nobody can vouch for. git-byline records the difference when the edit happens.

What git blame and git-byline can answer
Questiongit blamegit-byline
Which commit touched this line?yes
Was it written by a person or an agent?no
Which person wrote it?commit author, whole commit
Which agent and model produced it?no
Did a person rewrite agent output?no
What is genuinely unknown?nothing is marked unknown
human

No supported agent checkpoint claimed the final transition.

Carries line range, person identity

human:john.doe
ai

A supported hook observed an agent edit.

Carries agent, model, session, timestamps

ai:droid/claude-sonnet-4-5
human-override

A person replaced AI output. The AI origin stays visible.

Carries person, agent, model, session, timestamps

human-override:john.doe/droid/claude-sonnet-4-5
untracked

Evidence is missing or ambiguous, so nothing is guessed.

Carries line range

untracked

git byline stats HEAD~6..HEAD

Your AI share, at a glance

Aggregate attribution over any revision range without reading a single blob: people, agents, models, sessions, files, and commits.

Human
41.8%
41 lines from 2 people
AI
39.8%
39 lines from 3 agents
Human override
10.2%
10 agent lines a person rewrote
Untracked
8.2%
8 lines without evidence, never guessed

Lines per commit

6 of 6 commits annotated

577fc95feat(pricing): add annual price and tax helper

John Doe, Feb 5, 34 lines

  • human 16
  • ai 9
  • human-override 5
  • untracked 4

Attribution

Every attributed line in the range

98lines
  • human4141.8%
  • ai3939.8%
  • human-override1010.2%
  • untracked88.2%

Line map

The three files at HEAD, line by line

src/pricing.go25 lines
src/invoice.go16 lines
src/tax.go9 lines

Point at a line to see who wrote it.

Agents and models

AI and human-override lines

  • droid2828.6%
    claude-sonnet-4-5
  • codex1616.3%
    gpt-5-codex
  • claude55.1%
    claude-opus-4-6

People

From the commit author of each line

  • john.doe4849.0%
    human 38, human-override 10
  • maya.chen33.1%
    human 3

Files

Summed over the notes in the range

  • src/pricing.go6162.2%
    human 33, ai 18, human-override 10
  • src/invoice.go2424.5%
    human 3, ai 21
  • src/tax.go1313.3%
    human 5, untracked 8

Sessions

One agent conversation each

  • pr-4812-droid2323.5%
    droid/claude-sonnet-4-5
  • pr-4812-codex1616.3%
    codex/gpt-5-codex
  • pr-4817-claude55.1%
    claude/claude-opus-4-6
  • pr-4823-droid55.1%
    droid/claude-sonnet-4-5

Every number above is real git byline stats --json output for the demo repository that build-demo-repo.sh creates from real hook events.

Recorded, not mocked

Real output from the real binary

Every frame comes from the binary built from this repository, run against a demo repository built from real hook events. No mock output, no retouching.

git byline blame · stats · check
A four-view tour: line attribution with human identity, agent model, and human-override ranges; a close-up of untracked merge content next to two named people; a range aggregate with per-person totals; and the policy gate failing with exit code 1, then passing, then exporting Git AI authorship

Four views, two of them close-ups: line attribution, who wrote what, the range aggregate, and the policy gate with its exit code.

git byline stats HEAD~6..HEAD

Who wrote what, per person and per agent

Aggregates notes over any revision range without reading a single blob: author classes, agents, models, people, sessions, files, and commits, in deterministic order. The JSON output feeds your own tooling.

git byline stats --json HEAD~10..HEAD
Read more in the guide
git byline stats HEAD~6..HEAD
git byline stats aggregating a commit range into totals, agents, models, authors, sessions, files, and commits, then the same data as JSON

git byline check

A gate, not a dashboard nobody opens

check is the gate, verify is the proof, and disclosure is the artifact. Flags only: no configuration file and no new format to maintain.

git byline check --max-ai-percent 30   # exit 1 on violation
git byline verify --deep               # prove notes against real blobs
git byline disclosure --format cyclonedx --output sbom.json
Read more in the guide
git byline check
git byline check failing an AI share policy with exit code 1, passing at a higher limit, then verify and a disclosure export read back with jq

git byline dashboard

A local dashboard, no hosted service

One self-contained HTML file: attribution classes, contribution sources, evidence health, and per-line provenance. No CDN, font, image, script, or API is loaded, so it opens the same way offline in five years.

git byline dashboard --range HEAD~10..HEAD
Read more in the guide
git byline dashboard
The self-contained git-byline dashboard switching between attribution classes, contribution sources, evidence health, per-line provenance, and the range report with its commit trend and people breakdown

Reproduce every recording with docs/assets/demo/record-media.sh.

Terminal
curl -fsSL --proto '=https' --proto-redir '=https' --tlsv1.2 \
https://raw.githubusercontent.com/comarch/git-byline/main/install.sh | bash

Then work normally

git commit -m "feat: add example"
git byline blame src/example.go

Install

Attributed from the next commit

The installer verifies the release archive checksum and the binary version, then detects the coding agents on your machine. Run it inside a repository and the Git hooks land there too.

  • Checksum-verified release binary, no elevated privileges
  • Factory and Claude Code get a user-level hook for every repository
  • post-commit annotates, pre-push shares notes with your remote
  • --local-notes keeps attribution notes on your machine
All install paths, including air-gapped

Built for real Git

Attribution that survives real workflows

Rewrites, squash merges, shell commands, and other tools. Provenance follows the code instead of breaking on the first rebase.

Rebase, amend, cherry-pick, reset, branch switch, and stash transitions reproject attribution onto the new content through managed Git hooks.

shell_pre and shell_post checkpoints snapshot the dirty set and attribute only paths whose blobs actually changed, so unrelated human edits are not claimed.

Forge merges create commits that never passed a local hook. A least-privilege workflow rebuilds attribution from the pull request commits and pushes only refs/notes/byline.

Read and write the Git AI Standard v3 authorship format at refs/notes/ai, and write Agent Trace 0.1 records. Import never overwrites a different existing note.

update downloads the newest release from the pinned repository, checks it against checksums.txt, swaps the binary, and refreshes the managed hooks. Air-gapped machines stage the archive themselves.

managed Git hooks
  • rebase, amend, cherry-pickpost-rewritepost-commit
  • merge, pullpost-mergefirst parent is authoritative
  • fast-forward pullreference-transactionpulled commits keep their original notes
  • reset, branch switchreference-transactionpost-checkout
  • stash push, pop, applyrefs/notes/byline-stash

Unmatched rewritten content becomes untracked, never reassigned by guess.

Why teams deploy it

Answers with evidence, not estimates

How much of this release is AI-written? Where should review effort go? Can we show an auditor? Answer from observed provenance, with nothing new to host.

Evidence, not heuristics

Pre-edit and post-edit snapshots establish provenance when the edit happens. Nothing is inferred from code style, tokens, or classifiers.

A gate for CI

git byline check fails a build on an AI or untracked share limit, with a stable exit code and JSON output.

Proof an auditor accepts

Disclosure documents in native JSON, CycloneDX 1.6, or SPDX 3.0.1, plus verify --deep, which proves them against the actual blobs.

Ready for air-gapped estates

No cloud, account, daemon, or telemetry. Commands run offline except explicit update and version --check, and notes travel only with your own git push.

No vendor in the data path

Prompts and transcripts are never stored. Metadata travels only through Git, to the remote you already trust.

One pure Go binary

No CGo and no language runtime. Linux, macOS, and Windows on amd64 and arm64.

How it compares

Same question, smaller data boundary

Git AI, Entire, and Cursor Blame also attribute AI code line by line. They differ in what they collect, what runs in the background, and what they give back.

Scroll sideways to see all four tools.

git-byline compared with Git AI, Entire, and Cursor Blame
Capabilitygit-bylineMIT · GoGit AIApache-2.0 · RustEntireMIT · GoCursor BlameProprietary
Attribution
Line-level AI attributionYesYesentire blameYescode written in Cursor
Agents with native hooks148Cursor only
Follows rebase and squash mergesYesdaemon and CINot documentedNot documented
Data boundary
Prompts and transcriptsLinked to every AI line, kept locally by defaultFull transcripts in Git refs, pushed with your codeEach line links to a chat summary
TelemetryError reports, on by defaultOff unless you opt inNot documented
Background activityDaemon, daily hook check, auto-updateDaily version checkNot documented
AccountNot for the CLINot for the CLIEnterprise plan
What you get
CI gate and SBOM disclosureNot documentedNot documentedNot documented
Team analyticsYesGit AI for TeamsYesentire.io web appYesteam API
Editor integrationYesVS Code family, EmacsNot documentedYesbuilt in
YesNoNot documented

git-byline

Pick it when prompts must never be stored, nothing may run in the background or phone home, and CI or an auditor needs a gate and an SBOM.

Git AI

Pick it when you want the prompt behind every AI line, the longest agent list, editor blame, and a team product on top.

Entire

Pick it when you want whole agent sessions, prompts and transcripts included, versioned next to each commit.

Cursor Blame

Pick it when your whole team writes code in Cursor on the Enterprise plan.

Already on Git AI? git-byline imports and exports Git AI notes, so attribution history comes with you. See interop.
Checked on 23 September 2026 against each project's public README, documentation, and source. These tools change fast, so check their docs before you decide. The longer version is in why git-byline.

FAQ

Questions, answered

Is git-byline an AI detector?

No. It records agent edits when they happen, through the hooks of supported agents. It never guesses from code style, tokens, or statistical classifiers. When evidence is missing, the line is untracked.

What leaves my machine?

Checkpoints and snapshot blobs stay local. After install-hooks --git, the managed pre-push hook publishes refs/notes/byline to the same remote on ordinary pushes: line ranges, paths, agent and model names, human identity tokens, session identifiers, and timestamps. Install with --local-notes to keep notes local.

Are prompts or transcripts stored?

No. Checkpoint JSON and notes never contain raw hook payloads, prompts, transcripts, tool responses, or environment dumps. Snapshot blobs contain file content and stay in your local object database unless you transfer those refs yourself. See the security model.

Which agents are supported?

Factory, Claude Code, GitHub Copilot, VS Code Agent, Cursor, Codex, Gemini CLI, Windsurf, Grok, and OpenCode, through native project hooks. Other tools can report edits through the generic agent-v1 JSON adapter. Details are in compatibility.

Does attribution survive rebase and squash merges?

Yes. Managed hooks reproject attribution for rebase, amend, cherry-pick, reset, branch switch, and stash. Squash and rebase merges on GitHub or GitLab are rebuilt by a workflow or the marketplace action. Content that cannot be matched becomes untracked.

Can I enforce an AI share limit in CI?

Yes. git byline check --max-ai-percent 30 exits with status 1 on a violation and 0 on success. Add --max-untracked-percent, --require-note, or --json as needed. Flags only, no configuration file.

Does it work in air-gapped environments?

Yes. Every command runs offline except update and version --check. On an air-gapped machine, download the release archive and checksums.txt yourself, then run git-byline update --archive FILE --checksums checksums.txt.

Is the disclosure output a compliance certificate?

No. It is machine-readable input for an AI content disclosure process, in native JSON, CycloneDX 1.6, or SPDX 3.0.1 with the AI profile. verify --deep proves it against the actual blobs.

How is it different from Git AI?

Both record agent edits through hooks, keep line-level attribution in Git notes, and follow rebases and squash merges. Git AI links every AI line to its prompt, runs a background daemon, and sends error reports by default. git-byline stores no prompts, runs no daemon, sends no telemetry, and adds a CI gate and SBOM disclosure. It also reads and writes the Git AI format; see interop and the full comparison.

Still deciding? Read why git-byline or ask in GitHub Discussions.

Know who wrote every line.

One command installs a checksum-verified binary and the hooks, so your next commit is attributed. No account, no daemon, no telemetry.

curl -fsSL --proto '=https' --proto-redir '=https' --tlsv1.2 https://raw.githubusercontent.com/comarch/git-byline/main/install.sh | bash