Lab / Essay

Agent workflow, measured

One branch, many agents

Do per-agent git branches waste tokens? We measured two weeks of our own AI coding sessions. Branchy work paid about three times the branch tax and hit more conflicts, but the tax was a few percent, not a disaster.

Updated 5 min read


Two projects, same two weeks, same tools

One shared branch against a branch per agent.

A: one shared branchB: branch per agent

Share of all tokens spent on branch work

1.3%
4.0% · 3x

Merge conflicts hit

2
10

Branch commands run

143
663

Tokens per commit on the main line (no real difference)

2.84 M
2.78 M

Hours from writing a change to landing it (no stall)

0.4 h
0.6 h

Each pair of bars has its own scale (the larger value = full width). Measured from our own session logs, November 2026: 441 commits in A, 769 in B. One pair on one workstation; not a general benchmark.

Claims instead of branches Left: three agents each get a branch and a worktree, and every branch has to be merged back into main, where conflicts can happen. Right: a boss writes claims that give each of three agents its own files in one shared checkout; their commits land on main directly. Branch per agent main agent 1 agent 2 agent 3 3 branches · 3 worktrees sync · merge · resolve conflicts One branch, claims boss writes claims agent 1billing/** agent 2orders/** agent 3docs/** main · one checkout
Schematic. The claims are ordinary path globs that never overlap; commits go straight to the shared line.
550Mtokens on branch work in two weeks, across 27 projects
3.9%of all tokens: real, but a tax, not the main cost
350worktrees created and 33 merge conflicts hit
5.2%branch share in projects with 5+ merges, against 3.1% in near-linear ones

Git branches were invented for people. A person goes away for a week, works on a copy, and comes back to merge. Branches make that safe, and they are the right tool for it.

When we started running several AI coding sessions in parallel on the same codebase, the obvious move was to give each one its own branch and its own working copy (a git worktree). Every guide suggests it. We had a hunch it was the wrong tool for agents: a crew of sessions that finish a task in minutes does not need a week-long copy, and every copy has to be synced, merged and cleaned up again. So we measured it instead of arguing about it.

What we measured

A small script read two weeks of our own session logs (every API request carries its token counts, every tool call carries the command it ran) and kept only numbers. It tagged every request that did branch work: creating or removing worktrees, switching or listing branches, merging, rebasing, cherry-picking, stashing, resolving conflicts. Then it compared that with what reached the main line in git: commits, merges, task cards shipped.

Over those 14 days the sessions used about 12.3 billion tokens across 27 projects on one workstation. Most of that is cached context being re-read, which is cheap per token but adds up.

Two projects, same two weeks

We picked a fair pair. Project A ran its parallel agents in one shared branch and one checkout: a boss session split the work into cards and gave each agent its own files to edit. Project B, another product of similar size built with the same tooling, gave agents branches and worktrees and merged their work back.

  • Branch work as a share of all tokens: 1.3% in A, 4.0% in B. About three times as much.
  • Branch commands: 143 in A, 663 in B. Worktrees created: 29 and 83. Merge conflicts hit: 2 and 10.
  • Tokens per commit that reached the main line: 2.84 million in A, 2.78 million in B. Effectively the same.
  • Cost per task card shipped: B was 16% dearer. Cost per commit: B was 14% cheaper (it makes smaller commits).
  • Time from writing a change to it landing on the main line: 0.4 hours on average in A, 0.6 hours in B.

Across all 16 projects that had enough history, the ones with five or more merges paid 5.2% of their tokens on branch work; the near-linear ones paid 3.1%.

What the numbers say, honestly

The hunch was half right. Branch-per-agent work costs about three times as much in branch bookkeeping and hits several times as many merge conflicts. Across everything, branch work came to 550 million tokens in two weeks, so "millions of tokens" is true.

But it is a tax of a few percent, not the thing that eats a budget. Cost per shipped commit was no worse in the branchy project, and merged work landed within the hour, so we cannot say branches stalled shipping. Keeping one shared branch in sync is not free either: pulling and pushing cost about as much as all the branch work put together. In the same two weeks, oversized context windows and expensive models on routine work cost far more than branches did.

We still made "one shared branch" the default, because it is cheaper, it conflicts less, and there is less state for an agent to get wrong. We just stopped claiming it is a miracle.

How a boss hands out file claims

  1. Cut the work by files, not topics. Each card names its area, the paths it owns, the goal, when it is done, and what to read first.
  2. Write the claims before anyone starts. One line per agent, such as w1 crates/billing/**. Claims never overlap.
  3. Agents edit only what they claimed and commit only those paths. Nobody runs commands that sweep up other agents' work, such as stash, reset or "add everything".
  4. Shared files go through the boss, one card at a time. A failing test may be a neighbour's half-written file, so agents check the claims before "fixing" it.
  5. Done means landed. No branch to merge, no worktree to clean up, nothing to reconcile.

This is how JIVA runs its crews.

Caveats

One workstation, one pair, two weeks. Project A was not perfectly linear: it used throwaway worktrees for experiments and one short-lived branch. Our tagging is a lower bound (re-running builds and tests inside fresh worktrees is not counted), and counting whole conversations that touched a branch would be a loose upper bound. Card counts depend on how each project writes its commit messages. Token costs are compared at list prices; we run on a flat plan.