[Blog](/blog) / Other resources

# Is cost per merged pull request a good metric for AI coding agents?

Is cost per merged pull request a good metric for AI coding agents? What it shows, where it fails, and the better unit: cost per delivery point.

Pensero Pensero MarketingNov 30, 2026

Short answer

Cost per merged pull request is a good first metric for AI coding agents, because it links AI spend to work that shipped. But it is not enough on its own: it counts a 1-line fix and a new feature as the same unit, it does not show rework, and it leaves out the time engineers spend on review. Pensero uses a better unit, the cost per delivery point: each merged pull request is scored by magnitude × complexity, the same way for engineers, AI-assisted engineers and AI agents, with cost, time and quality beside each point.

## Why do teams use cost per merged pull request?

AI coding agents such as Claude Code, Codex and Copilot coding agent bill by tokens, seats or both. When agents do more work, the bill grows fast, and finance asks what it bought. Cost per merged pull request is the first answer that most teams find:

-   It is easy to calculate: agent spend ÷ merged pull requests.
-   It counts only work that shipped, not prompts or suggestions.
-   It goes up when agents produce work that nobody merges.

Larridin, for example, calls cost per merged PR "the KPI for AI coding agent spend", because agent spend can rise while shipped work falls. That point is correct. The question is whether one pull request is a good unit of work.

## Where does cost per merged pull request fail?

| Problem | What happens | Effect on the metric |
| --- | --- | --- |
| All pull requests count the same | A 1-line fix and a new feature are 1 unit each | Small changes make the agent look cheap |
| Easy to game | Splitting work into small pull requests lowers the cost per pull request | Better number, same work |
| No quality | A merged pull request can come back as rework or a revert | Rework is invisible |
| Review time left out | Engineers review and fix agent pull requests | The real cost is higher |
| No comparison with people | Engineers and agents do different sizes of work | A fair comparison is not possible |

Research also shows that speed and output are hard to read. In a randomized trial in early 2025, METR found that experienced open-source developers took 19% longer on their own repositories when they used AI tools, while they expected to be faster. In February 2026, METR changed the design of its next study, because wider AI use made the groups hard to compare. The lesson for buyers: count finished work with a careful unit, and do not trust a single simple ratio.

## What is a better metric?

A better metric keeps the strong part of cost per merged pull request, work that shipped, and fixes the weak parts:

1.  **Weight each merged pull request by its size and complexity.** Pensero scores each one in delivery points (magnitude × complexity).
2.  **Put the full cost in the numerator.** Tokens, seats, tools, and the engineer time to review and fix the agent work.
3.  **Put quality beside the number.** Rework, reverts and defects of the same work.
4.  **Use the same unit for people and agents.** Then you can decide which work goes to which.

## Cost per merged pull request vs cost per delivery point

| Measure | Cost per merged pull request | Cost per delivery point (Pensero) |
| --- | --- | --- |
| Unit | 1 merged pull request | Magnitude × complexity of the merged work |
| Follows the size of the work | No | Yes |
| Can be gamed by small pull requests | Yes | No, small work gets fewer points |
| Quality | Not included | Beside each point |
| Review cost of engineers | Often left out | Included in the full cost |
| Compares agents and engineers | Not fairly | Yes, on one scale |

## Example: 2 agents, 1 month

A team runs 2 AI coding agents on the same code base. Example numbers for 1 month:

| Measure | Agent A | Agent B |
| --- | --- | --- |
| Agent spend | $6,000 | $9,000 |
| Merged pull requests | 300 | 150 |
| Cost per merged pull request | $20 | $60 |
| Engineer review time, at cost | $9,000 | $3,000 |
| Full cost | $15,000 | $12,000 |
| Delivery points | 150 | 240 |
| Full cost per delivery point | $100 | $50 |
| Rework | 14% | 5% |

By cost per merged pull request, agent A looks 3 times cheaper. With the full cost and delivery points, agent B costs half as much per unit of finished work, with less rework. Agent A produced many small pull requests that needed a lot of review.

The decision changes: give more of the work to agent B, and use agent A only for small, well-tested changes.

## What do finance leaders and clients need to see?

A finance leader does not ask how many pull requests an agent merged. The questions are about money and risk:

-   **What did the AI spend buy?** The finished work, in one unit, for each month.
-   **Is the cost per unit going down?** The trend of the full cost per delivery point, with agents and people together.
-   **Did quality hold?** Rework, reverts and defects next to the output.
-   **Where do we put the next dollar?** The agents, teams and vendors with the lowest cost per point at the same quality.

An IT services firm gets the same questions from its clients. When AI agents do part of the work, the client wants to see what changed: more finished work for the same fee, or the same work for a lower fee. A cost per merged pull request cannot answer this, because the client does not buy pull requests. A unit of finished work, with the evidence behind each unit, gives the client and the firm the same number to discuss.

This is also why the unit must cover people and agents together. Most work in 2026 is mixed: an engineer writes the plan, an agent writes the code, and an engineer reviews it. A metric for agents only splits one piece of work into 2 numbers that nobody can add.

## How to move from cost per merged pull request to cost per delivery point

1.  **Keep the metric you have.** Cost per merged pull request stays a useful early warning.
2.  **Score 3 months of merged work** in delivery points, for agents and for engineers.
3.  **Add the review time** of engineers on agent pull requests to the agent cost.
4.  **Read the cost per delivery point next to rework**, per agent, team and vendor.
5.  **Review every month,** and move work to the agent, team or vendor with the lowest cost per point at the same quality.

## When is cost per merged pull request enough?

-   **Early pilots** with 1 agent and a few pull requests per week, where you only need to see if spend and output move together.
-   **Spend alerts,** to see quickly when an agent burns tokens on work that nobody merges.
-   **The same type of task,** for example only dependency updates, where pull requests have about the same size.

For budget decisions, vendor comparisons, quotes to clients and the split of work between people and agents, use a weighted unit.

## Common mistakes

-   **Reading the metric without the review cost.** The agent looks cheaper than it is.
-   **Rewarding small pull requests.** The number goes down, and the finished work stays the same.
-   **Ignoring reverts.** A merged pull request that is reverted the next week is not finished work.
-   **Comparing agents across different code bases.** The work is not the same, so the cost is not comparable.
-   **Using the metric to rank engineers.** Measure agents, teams, vendors and work, not individuals.

## How Pensero helps

-   Pensero scores each merged pull request, ticket and document in delivery points, for engineers, AI-assisted engineers and AI agents, with cost, time and quality beside each point. It reads Claude Code and Codex CLI sessions to link agent work to its cost.
-   Read [how to measure the cost and output of AI coding agents](/blog/measure-ai-agent-cost-and-output), [what your AI budget bought](/blog/what-did-our-ai-budget-buy) and [how to measure people and AI agents on one scale](/blog/measure-people-and-ai-agents-one-scale).
-   [Book a scoping session ↗](https://calendar.google.com/calendar/appointments/schedules/AcZssZ2eVzpQZbcYew7J5OinbUaAbTqUx5FH0Hfb1BxXafGqs5p_U8YRp4L6-ipsSsqH3Amr6dBRkGS6) to see your cost per delivery point.

## Sources

-   Larridin, checked 30 November 2026: [Cost per Merged PR: The KPI for AI Coding Agent Spend](https://larridin.com/blog/ai-coding-agent-cost-per-merged-pr).
-   METR, 10 July 2025: [Measuring the Impact of Early-2025 AI on Experienced Open-Source Developer Productivity](https://metr.org/blog/2025-07-10-early-2025-ai-experienced-os-dev-study/).
-   METR, 24 February 2026: [We are Changing our Developer Productivity Experiment Design](https://metr.org/blog/2026-02-24-uplift-update/).
-   Google Cloud, 23 September 2025: [Announcing the 2025 DORA Report](https://cloud.google.com/blog/products/ai-machine-learning/announcing-the-2025-dora-report).

## Frequently asked questions

**Is cost per merged pull request a good metric for AI coding agents?**

It is a good start, but not enough. It links AI spend to shipped work, but it counts a 1-line fix and a new feature as the same unit, and it does not show rework.

**What is a better metric than cost per merged pull request?**

Cost per delivery point. Pensero scores each merged pull request by magnitude × complexity, so the cost follows the size of the work, with quality beside it.

**How do I calculate cost per merged pull request?**

Divide the AI agent spend of a period (tokens, seats and tools) by the number of pull requests that the agent produced and that were merged in the same period.

**Can AI agents game cost per merged pull request?**

Yes. Smaller pull requests lower the cost per pull request without more finished work. A unit weighted by size and complexity removes this effect.

**Should I compare AI agents and engineers with cost per merged pull request?**

No. Agents and engineers do different sizes of work. Compare them with the same weighted unit, such as delivery points, and add the review time of the engineers to the agent cost.

## Related posts

-   ### [How to Measure and Improve Product Development Performance](/blog/product-development-performance)
    
    Connect customer value, delivery, quality, strategic alignment, and investment efficiency in a balanced product development performance review.
    
    Pensero  
    Pensero Marketing
    
    Aug 10, 2026
    
-   ### [AI Engineer vs Software Engineer: Key Differences](/blog/ai-engineer-vs-software-engineer)
    
    Compare AI and software engineers by responsibilities, skills, quality standards, and risk, with guidance on how they work together and when to hire each.
    
    Pensero  
    Pensero Marketing
    
    Aug 10, 2026
    
-   ### [16 KPIs for Software Engineering Teams](/blog/kpis-software-engineers)
    
    Explore 16 team-level KPIs covering delivery, quality, developer satisfaction, and AI efficiency, with guidance on reading metrics together.
    
    Pensero  
    Pensero Marketing
    
    Aug 10, 2026
    

Next step

## Find your level of AI in engineering

See the 5 levels, from human-only to fully autonomous agents, and what moving up is worth.

[See the 5 levels →](/how-it-works#levels)

Next step

## Scope your audit in 30 minutes

We look at your tools, AI agents and vendors and tell you what we would measure first.

[Book a scoping session](https://calendar.google.com/calendar/appointments/schedules/AcZssZ2eVzpQZbcYew7J5OinbUaAbTqUx5FH0Hfb1BxXafGqs5p_U8YRp4L6-ipsSsqH3Amr6dBRkGS6) [Start free](/auth/signup/)
