How to measure whether AI coding agents pay off
To measure ROI of AI coding agents, count the changes that survive review and merge, against your own baseline. Engineering managers can't rely on commits or opened PRs, which can outrun finished work. In a Harvard working paper covering 655 firms, average time from review submission to merge rose 56.1% after firms adopted agents. Its data partner, Jellyfish, sells engineering analytics.
Last updated
Key points
- Track four numbers: cost per merged PR, accepted-change rate, PR cycle time with review wait, and rework or reverts.
- In that paper, commits rose 36.0% but issues resolved only 13.7%, an effect the authors call borderline significant.
- Set your baseline early. We found no benchmark for a good value, so use your own history and a similar team.
What the studies say about AI coding tools ROI
Output rises faster than delivery in two large studies. One also found slower review.
Chen and Stratton, the Harvard paper, covers 655 firms and 720,542 workers from January 2021 to August 2026. PRs opened rose 35.7% 12 months after adopting agents.
NBER working paper 35275 is a matched event study of over 500,000 GitHub developers. Autonomous agents' cumulative effect was 240% on commits, but 80% on projects and 30% on releases. Two of the three authors work as paid research consultants for Microsoft.
"AI Writes Faster Than Humans Can Review" covers one company: 802 developers, 196,212 PRs, January 2024 to April 2026. PR throughput rose about 12% when developers started using AI, and load per reviewer doubled. Assignment was not random, so this is association only.
"Who Finishes the Job?" compares 6,774 merged agent PRs with 5,044 human ones in the same repositories with 500+ stars. The agent PRs drew verified follow-up fixes at 1.62 times the odds.
Build a baseline before you compare
Without a baseline, a busy quarter can pass for an agent effect. Work in this order.
- Pick one team and a fixed set of repositories.
- Write a checkable rule for "agent-assisted", such as a PR label.
- Fix N, the days a merged PR must survive without a revert, such as 14.
- Before rollout, record acceptance, cycle time and reverts on all the team's PRs, long enough to smooth out a quiet month. Cost per merged PR starts with agent spend. If agents are already in use, say the baseline is not agent-free.
- Decide whether review time counts in cost.
- Pick a similar team that keeps its tools, as a rough control.
- Freeze the definitions.
How to measure ROI of AI coding agents with four numbers
Read cost, acceptance, cycle time and reverts against your baseline. The formulas are ours.
| Metric | Formula (ours) | Data source | Main trap |
|---|---|---|---|
| Cost per merged PR | (Seat fees + usage or overage invoiced in the period) / merged PRs surviving N days without a revert | Invoices, Git host | Mixing invoiced and estimated dollars; review time unstated |
| Accepted-change rate | Agent-assisted PRs merged and not reverted within N days / agent-assisted PRs opened | Git host | Confusing it with suggestion or line acceptance |
| PR cycle time with review wait | Merge time minus open time, median and p75; review wait (request to first review) beside it | Git host | Averages only |
| Rework or reverts | Agent-assisted merged PRs reverted within N days / agent-assisted PRs merged | Git host | Confusing it with DORA deployment rework rate: unplanned deployments after a production incident, not code rewritten after merge |
State which PRs your cost denominator counts. The example below counts agent-assisted PRs only. Read the four together: a lower cost means little if reverts rose.
A worked cost per merged PR example
One team, one month. The numbers are invented and round, not vendor prices.
- Invoiced spend: $2,000 seat fees plus $1,000 overage, so $3,000.
- Agent-assisted PRs: 200 opened, 160 merged, 10 reverted within 14 days, so 150 survive.
- Cost per merged PR: $3,000 / 150 = $20 (invoiced, review time excluded).
- Accepted-change rate: 150 / 200 = 75%.
- Revert rate: 10 / 160 = 6.25%.
- Review time: 90 hours at an invented $100 per hour is $9,000, or $60 per surviving PR (estimated).
If the seats also support other work, the invoiced $20 is an upper bound. Keep the estimated $60 out of the invoiced $3,000. Close the month 14 days after its last merge, or mark it provisional.
On a subscription, tokens times list price is an API-equivalent estimate, never invoiced. Do not add it to the seat fee. The labels REPORTED, ESTIMATED and SUBSCRIPTION are defined under cost basis.
What Claude Code, Copilot and Cursor admin data can tell you
Each source covers part of the picture. Take delivery outcomes from your Git host.
| Source | Can tell you | Limit |
|---|---|---|
| Claude Code dashboard (Team, Enterprise) | Contribution metrics (public beta), top-10 contributor ranking, CSV of all users | Metrics need Owner role and GitHub app; github.com only; not with Zero Data Retention; sessions 21 days before to 2 days after merge; code rewritten by more than 20% not attributed |
| Claude Code OpenTelemetry | Token, cost, commit and PR counts | Opt-in (CLAUDE_CODE_ENABLE_TELEMETRY=1); prompt text off by default; includes user.email with OAuth sign-in; vendor says "Cost metrics are approximations." |
| Claude Code Analytics API | Usage per actor; cost estimate in cents | Claude subscription sign-in usage not returned |
| GitHub Copilot usage metrics | Per-user interaction and acceptance counts | PR fields only in organization, enterprise and repository reports, not per-user ones |
| Cursor Admin API | acceptedLinesAdded per user; spend | 30-day range maximum for daily usage; spend is on-demand only, in cents, current cycle |
Suggestion or line acceptance says nothing about whether a change merged or survived. See Claude Code cost and usage tracking.
Collect the numbers without surveilling developers
Most vendor APIs are per user by default, so aggregation is your job.
- State the purpose, and aggregate to team or project.
- Publish no rankings of people.
- Keep content capture off. The four numbers need no prompt or code text.
- Set retention, and show developers what is collected.
This is not legal advice. GDPR Article 5 requires specified purposes and data "adequate, relevant and limited to what is necessary". Article 35(3)(a) requires an impact assessment for systematic and extensive automated evaluation on which significant decisions are based. In Germany, BetrVG section 87(1) no. 6 gives the works council co-determination on technical devices designed to monitor behaviour or performance. Involve it before the pilot.
On the AgentsTrack Team plan, owners, admins, managers, finance viewers and security viewers can open a member's sessions. Read what your admin can see before you assign roles.
A monthly report template for AI coding agent metrics
One page per team, no individual names.
- Scope: team, tools, month, N, agent-assisted rule, review time in or out
- Invoiced cost: seat fees, overage, total, idle seats
- Estimates: separate lines, labelled ESTIMATED or SUBSCRIPTION
- Four numbers: this month, baseline, similar team
- Review wait: median and p75
- Gaps and process changes
- Decision: keep, expand, change or cut, and next review date
Common mistakes when measuring AI coding agents
Each of these can tilt the decision.
- Counting commits or opened PRs as delivery. Output can outrun resolved work. Count surviving PRs.
- Treating acceptance as outcome. Accepted lines may never merge. Check the Git host.
- Adding estimates to seat fees. The total can't be audited. Use separate lines.
- No baseline, or shifting definitions. Any change can look like an agent effect. Record first, then freeze.
- Mixing DORA rework with code rework. They count different things. Name which one.
- Closing early. Late PRs haven't finished their window. Wait.
- Ranking individuals. People can optimize for the number. Report by team.
- Reading elapsed session time as work. It includes idle time. Separate human-active, agent-active and idle time.
Where AgentsTrack fits
AgentsTrack reads the session files of Claude Code, Codex, OpenCode, Antigravity and Gemini CLI. It shows spend by project and model, each figure labelled REPORTED, ESTIMATED or SUBSCRIPTION, with human-active, agent-active and idle time apart and no per-developer score. Team adds team dashboards and budgets.
It does not read Cursor or Copilot. It does not compute cost per merged PR: PR correlation is coming soon, not available. Take the numerator from invoices and the denominator from your Git host. Use AgentsTrack to see which projects and models the usage went to: an ESTIMATED or SUBSCRIPTION figure is not invoiced spend.
FAQ
What is a good cost per merged PR?
We found no benchmark for a good value. Compare with your own earlier months and a similar team, using the same review-time rule.
Can developer self-reports show whether AI agents save time?
Not on their own. In a METR randomized trial, 16 experienced open-source developers worked on 246 issues, and tasks took 19% longer with AI allowed. They had expected a 24% speedup and still believed in 20% afterwards. METR flags the page as out of date and does not claim representativeness.
Do DORA metrics already cover AI coding agents?
Not by themselves, since they neither price agent use nor separate agent-assisted changes. DORA change lead time runs from commit to production. Its change fail rate is the ratio of deployments needing immediate intervention.
Should unused seats count in the cost?
Yes. Idle seats still cost money, so keep their fees in the total and report the idle count.
Read on
Check it against your own sessions
14 days of Pro, no card. The collector is open source, and a dry run prints exactly what it would upload.