Skip to content

AI Glossary · Metrics

What is Cost per PR?

Cost per PR

Cost per PR divides a defined set of AI-related costs by a defined count of pull requests. State the accounting period, included costs, and whether the denominator counts opened or merged pull requests.

Also known as: cost per pull request

· Updated · Chain of Thought

AI Engineering

  • 2 explainers
  • 1 episode
  • 1 guest clip
  • 1 source

Worked example: a team spends $100 on model calls during a week and opens 20 pull requests. Eight are merged by the end of that week. Cost per opened PR is $5; cost per merged PR is $12.50 for that accounting window. These fictional figures use the same spending and different denominators. Neither includes human review time.

In episode 76, at 4:33, Sonar CTO Andrea Malagodi describes one engineer with over 500 PRs and low cost per PR, and another with high spending and few PRs. Examining their work revealed different problems: an agent workflow optimized for throughput versus difficult analysis requiring long AI turns. Malagodi cautions against quick judgments from the ratio.

Our recommendation is to compare similar work and record the accounting boundary. PR count does not measure correctness, useful outcomes, or business value. Cost per task asks the same denominator question about tasks rather than pull requests, and measuring whether AI is paying off considers those broader outcomes.

Hear it from the guest

“Without really understanding the context of the problems that are being worked on.”

Quotes lightly edited to remove filler words.

Sources

Go deeper

From the conversation