Switch to light mode

How to Measure the ROI of AI Coding Tools Without Getting Fooled by the Wrong Metrics

- 8 min read

Dashboard showing engineering metrics with cycle time and defect rate trends

Your board is asking for ROI on the AI tools budget. You’re paying $50K a year for Copilot, Claude Code, and a handful of supporting subscriptions. Your developers swear they’re more productive. Now you need to prove it.

The temptation is to pull the obvious metrics: lines of code, PRs merged, commits per day. These are measurable, they went up after AI adoption, and they sound like productivity.

They are not productivity. They are inputs. And with AI tools in the loop, they are actively misleading.

Why the Obvious Metrics Make Things Worse

Lines of code was already a bad productivity metric before AI. It rewards verbosity. It doesn’t distinguish between a 50-line function that solves a hard problem and a 50-line function that should be 10 lines written by someone who understood the domain.

With AI tools, lines of code becomes worse than useless. Claude will generate a complete, syntactically correct, well-formatted function that is twice as long as it needs to be because it defaulted to the verbose pattern in its training data. Your lines-of-code metric goes up. Your codebase quality went down. You’re rewarding the wrong thing.

PRs merged has the same problem, amplified. AI tools make it easy to break work into smaller chunks and ship more frequently. Some of that is good - smaller PRs are generally easier to review. But if your team knows they’re being measured on PRs merged, Claude Code will be used to generate more, smaller, less-considered PRs. The metric goes up. The quality of thinking behind each change goes down.

This is Goodhart’s Law in action: when a measure becomes a target, it ceases to be a good measure. As soon as your team knows what numbers you’re watching, those numbers stop measuring what you think they’re measuring.

Commits per day is the worst of the three. It measures finger movement. A developer who commits ten small AI-generated changes is not more productive than one who commits two carefully considered ones.

The Framework I Use Instead

The right place to measure is the system level, not the individual level. You’re not trying to prove that individual developers write more code. You’re trying to prove that your team ships better software faster. Those are different claims.

Cycle time is the first metric I look at. This is the time from “work started” to “deployed to production.” It captures everything: how long does it take to write the code, get it reviewed, address feedback, pass CI, and ship? If AI tools are genuinely helping, cycle time should compress. If it’s not compressing, the AI is not solving your real bottleneck - and understanding why that is is itself valuable.

The reason cycle time is better than PR velocity is that it’s harder to game. A team that’s generating lots of small PRs but each one is getting stuck in review for three days has a long cycle time. The PR count looks healthy. The cycle time tells the truth.

Defect escape rate is the second metric. This is bugs that reach production per unit of shipped code. If AI adoption is making your team faster but your defect rate is increasing, you have a problem. AI-generated code is confident but not always correct. A team that’s reviewing output carefully will hold their defect rate steady or improve it. A team that’s rubber-stamping suggestions will see it rise.

Defect escape rate is the metric that makes the board conversation real. “We’re shipping 30% more features but our production bugs doubled” is not an ROI story. It’s a risk story.

Time to first meaningful PR review is a metric I added more recently. The question it answers is: how long after a PR is opened before a reviewer can actually engage with it? AI tools should reduce the “draft” phase - the time your PR spends as a work-in-progress before it’s ready for another set of eyes. If your team is shipping earlier drafts and asking reviewers to figure out what’s ready, AI is creating review burden, not reducing it.

Rework rate rounds out the framework. What percentage of PRs require significant changes after initial submission? High rework means the code that went up for review wasn’t production-ready. If AI adoption increases your rework rate, engineers are submitting AI output without adequate review, and your reviewers are doing the quality work that should have happened before submission. That’s not ROI. That’s shifting work around.

How to Run the Measurement

Don’t try to measure ROI during the adoption period. Behavior changes take time to stabilize. Engineers are learning new workflows, making mistakes, figuring out what works. Measuring in the first four weeks gives you noise.

The approach I recommend: run a baseline quarter before AI rollout, measure your four metrics, document them. Then introduce the tools and measure nothing for the first six weeks. You want the team focused on learning, not performing for metrics. After eight weeks of post-adoption data, compare.

Be honest about what you’re comparing. If you adopted AI tools in the same quarter you hired two senior engineers or switched frameworks, you can’t cleanly attribute the change to AI. Name the confounds. Boards respect honesty about measurement limitations. They don’t respect confident numbers that don’t hold up.

The Qualitative Signal You Can’t Skip

The four metrics above tell you whether AI tools are working at the system level. They don’t tell you whether your team will sustain the gains or burn out chasing them.

Run a monthly five-question pulse for the six months after adoption. Keep it short or people won’t fill it out. The question that matters most: “Do you feel more effective this month than last month?” Not “have you shipped more” - effective. The distinction is important. An engineer who has shipped more but feels scattered and uncertain about the quality of what they shipped is not on a sustainable trajectory.

Sustained engagement matters more than velocity spikes. Most teams see a productivity bump in the first few weeks of AI adoption. It’s new, it’s fast, it’s exciting. The question is whether effectiveness is still improving at month four, when the novelty has worn off and the real workflow has settled.

What to Tell the Board

Frame the ROI case around cycle time and defect rate, not individual productivity.

“We shipped the same scope 23% faster with 15% fewer production bugs” is a defensible business case. You can tie it to reduced engineering hours per feature and to support cost reduction from fewer production issues. That’s the board conversation.

“Our engineers wrote 40% more code” is not a business case. It’s a vanity metric that a skeptical CFO will immediately ask you to translate into something that matters - and if your answer is “well, they shipped the same number of features,” you’ve made a bad impression.

The strongest version of the story: take the cycle time improvement, multiply it by the number of features on your roadmap, and estimate the shipping date advantage that creates. If AI tools are letting you ship your roadmap two months earlier, what is that worth? That’s the number the board wants to see.

The Honest Failure Mode

Some teams see no meaningful improvement in cycle time or defect rate after AI adoption. I’ve seen it. It’s worth being honest about what it usually means.

If cycle time didn’t improve, the bottleneck was probably never code-writing. Code review, cross-team dependencies, unclear requirements, deployment pipeline slowness - these are the bottlenecks that kill cycle time, and AI tools don’t touch them. That’s useful to know. It redirects investment to where the actual constraint is.

If defect rate went up, the team is generating more code than it can review carefully. This is a workflow problem, not an AI problem. The fix is not removing AI tools - it’s building the review discipline that keeps output quality high. That might mean explicit checklists for reviewing AI-generated code, mandatory static analysis in CI, or just slowing down acceptance of suggestions.

Both of these outcomes are worth knowing. The board isn’t looking for a perfect story. They’re looking for evidence that you understand what’s working and what isn’t, and that you have a plan either way.

ROI measurement done honestly builds trust. ROI measurement done to justify a decision already made usually gets exposed - and when it does, it erodes credibility for every conversation that follows.

© 2024 Shawn Mayzes. All rights reserved.