Git for AI Agent Teams: Branching, Review and Provenance When Most Commits Aren't Human
Description and use
When AI agents produce most commits, Git’s human assumptions break. The solution is to isolate agents in separate worktrees, enforce atomic commits with machine‑readable trailers, cap diff size, run automated checks, and tier reviews by risk.
Problem
When most commits are produced by AI agents, Git’s assumptions about authorship, commit intent, review bandwidth, and human‑paced history break, causing review bottlenecks, large diffs, missing context, shared working‑tree conflicts, and attribution problems.
Outcome
Implementing isolated worktrees, atomic commits, structured messages, bot identities, CI gates, diff caps, and risk‑tiered reviews transforms an agent‑heavy workflow into a human‑reviewable, reversible, and provenance‑rich process.
Workflow
- 1. Human writes a task spec with explicit acceptance checks.
- 2. System creates a worktree and an agent/
<task>branch from a clean main. - 3. Agent works in isolation: small commits, structured messages, bot identity.
- 4. Agent runs the full verification suite; evidence is attached to the PR.
- 5. Automation enforces gates: green CI, diff‑size cap, CODEOWNERS for sensitive paths.
- 6. Human reviews at the risk tier earned by the change—skim auto‑verified, read critical.
- 7. Merge to a protected main; branch and worktree are deleted.
- 8. If misbehaviour occurs, revert first and re‑dispatch with a better spec.
Evidence
Agents should commit more strictly than humans, not less, because their history will be read during incident response: Small, atomic commits. One logical change per commit, enforced by task design.
The single highest‑leverage practice: every agent works in its own Git worktree on its own branch.
Review throughput. Agents generate plausible‑looking diffs at machine speed. Human review — the actual quality gate — becomes the bottleneck within the first week.
- Record date: 2026-10-22T08:26:09.017Z