Skip to content
How it works / Git commit attribution

Git commit attribution

How Centrail associates captured usage with commits using local Git facts.

Centrail associates captured usage with recorded commits. This is an allocation based on timing, branch, and authorship evidence, not proof that AI caused a change or that a feature is complete.

How matching works

The CLI reads Git locally and uploads allowed commit facts alongside usage metadata. Only Claude Code and Codex usage is matched today; Copilot CLI, Gemini CLI and Pi usage is captured but left unattributed. The current server matches events within the same repository identity. Among recorded commits at or after an event, it prefers:

  1. Your own commit on the session's branch.
  2. Any commit on that branch.
  3. Your own commit on another branch.
  4. The earliest remaining commit.

Within each preference, the earliest commit wins, with commit hash breaking timestamp ties. A teammate's commit can therefore receive an allocation. Events with no candidate remain unattributed. Cross-branch matches can move when new evidence arrives on the session's branch. Older servers without the matching capability use the CLI's simpler earliest-commit fallback.

The CLI also sends patch hashes, never diffs, to help recognize rewritten commits. Work whose commit disappears without an equivalent is kept in an abandoned group instead of silently assigned to unrelated work. Syncing can therefore improve a match as Git history changes; idempotence prevents duplicate usage, not all changes to attribution.

See local capture for the complete metadata inventory and cost, output, and value for interpreting allocations.

Ship status

Every attributed commit also gets a fate, so your dashboard can show estimated cost by Git history status:

  • Shipped: the commit, or a patch-identical copy, reached the repo's default branch (on the forge), by a pull request the GitHub App recorded as merged, or, without forge evidence, by the CLI's git check. Not a deployment claim.
  • In flight: not shipped, and a branch still holds it; "quiet" when that branch has not moved in 14 days.
  • Unshipped: its pull request closed without merging, or every branch holding it was deleted and no equivalent commit shipped. A status, not a verdict that the spend was wasted.
  • Unchecked: no fate has been reported for this commit yet.

The forge decides first. Where the Centrail GitHub App is installed on a repository, its record outranks your machine's: a pull request merged into the default branch ships every commit it listed (a fork's commits included, merged upstream), as does a push of the commit to that branch, and a pull request closed without merging marks its commits unshipped unless an open pull request from the same branch still carries them, or your machine found the same change squashed onto the default branch after the close. This needs no linked GitHub account: it tells Centrail only whether a commit you reported merged.

Without forge evidence the CLI's fates stand, recomputed on every sync, so an in-flight commit that later merges self-heals to shipped. The CLI reports only commits some branch still reaches, so its own “unshipped” (no containing branch active in 14 days) reads as in flight, quiet. A deleted branch reaches Centrail when its commits vanish from a sync: their work moves to an equivalent commit, or the commit becomes unshipped.

The CLI computes fates locally with plain git commands, scaling with live branches rather than commits:

git for-each-ref refs/heads refs/remotes   # branch tips and their dates
git rev-list --since="90 days ago" <tip>   # containment, per live branch
git rev-list --since="90 days ago" <default>  # ancestry on the default branch
git cherry <default> <branch-tip>          # squash-merge detection
git patch-id --stable                      # rewritten (rebased/squashed) commits

Ship-status uploads include commit hashes, branch/repository identities, dates, counts, authorship flags, and optional patch hashes. They exclude diffs, messages, and paths.

GitHub-verified merges

Everything above is computed on your machine, so on its own it is your word. If your organization installs the Centrail GitHub App and you link your GitHub account in Settings → Account, GitHub itself tells Centrail which commits reached which repository, who pushed them, and which pull requests merged. Then:

  • Shipped work counts your GitHub-verified merges: merged pull requests that carried work of yours — a commit you pushed, or one in a pull request you opened that GitHub does not attribute to someone else.
  • A commit's spend reads "matched to forge commits" when GitHub saw you push it (or merge it through your pull request) on the same branch, after the agent work it is matched to. The spend itself is still an estimate.

Linking reads your numeric GitHub id once and keeps no token. From GitHub, Centrail keeps ids, commit hashes, branch and repository names, and push and merge times — never code, diffs, commit messages, or anyone's email.