Cloud & AI Cost Management
Blog →
Cloud & AI Cost Management

AI Coding Cost Attribution: From Tokens to Features | Harness Blog

Webinar recap: Harness's Martin Reynolds and Trimble's Barani Mohandoss explain how to connect AI coding spend to commits, pull requests, tickets, and shipped features, and why provider usage data alone falls short. Watch on demand.

AI Coding Cost Attribution: From Tokens to Features

TL;DR

  • Spend is the start of the conversation. Provider data shows tokens consumed, not value created.
  • Roll up before you drill down. Feature-level attribution gets you about 90% of the way there.
  • Measure three things together. Trimble tracks velocity, quality, and cost, and uses counter-metrics so no single number gets gamed.
  • Expect duplicate and experimental spend. It spikes when a new model or harness launches, then tapers.
  • Control cost with role-based budgets and a fast approval path. Budgets add predictability and make people think about consumption.
  • Buy the platform, build the custom layer. Use a tool that covers engineering and cost, then add team, product, and outcome context.
  • Prediction is not solved. Nobody can forecast token cost per feature yet. Build historical baselines.

Watch the webinar

Recorded live on October 29, 2026, this InfoQ webinar is a conversation between Martin Reynolds, Field CTO at Harness, and Barani Mohandoss, Director, Cloud Governance, FinOps & E-Tools at Trimble. They discuss how to connect AI coding spend to developer sessions, commits, pull requests, tickets, and delivered features. Jared Ruckle of InfoQ moderated, with two audience polls and live Q&A. 

The short answer

Start by deciding what you are trying to attribute AI spend to. As Barani put it in his closing remarks, are you attributing to a feature that shipped, or trying to understand AI spend variability across the company? For attributing cost to a feature, rolling spend up is usually good enough; he said span-level attribution eventually becomes over-engineering with diminishing returns, and that a rollup gets you to about 90% of the understanding you want. Provider data shows the value of the tokens consumed, not the value generated, so pair spend with velocity and quality data.

Who this is for

Engineering, platform, and FinOps leaders whose teams already use AI coding tools and who are being asked what that spend delivers. If your cost data lives in provider dashboards and your delivery data lives in Git and Jira, this post is about the gap between them.

The problem: AI coding is widely deployed, but hard to measure

The webinar started by noting that chargeback and showback were hot topics in the early days of cloud, and that AI brings a new version of the problem: far more code, and real ROI and cost considerations. In the first poll, asking how attendees measure the ROI of AI, results were a fairly even split among not measuring it, using provider dashboard costs rolled up by team or project, and tying spend to PRs, tickets, and features.

Why Provider Usage Data Falls Short

Barani shared an example from one of Trimble's earlier engineers. Provider data showed roughly 300,000 to 400,000 lines of code generated, with 90% to 98% accepted. He called that unrealistic for any developer in a month. The team had to talk with the developer to understand what was being done and how much of it reached production and persisted across a couple of releases. It turned out to be an internal experiment, and the token spend was never attributed to a product or feature release. In his words, provider data focuses on the value of the tokens consumed, not the value generated.

Martin noted that session data from tools like Claude Code and Cursor often does not touch a gateway and lives on the developer machine. Barani said that when Trimble launched Copilot a few years ago, the platform metrics were not detailed enough to show how it changed developers' work, so the team sent periodic surveys, adding work for developers.

How to build cost attribution for AI-assisted engineering

Choose the right level of detail

Asked whether a session spanning multiple models and sub-agents needs span-level attribution, Barani said it depends where you start. For attributing cost to a feature, a rollup is good enough. The core question is whether you are getting value for the tokens spent, and how the models and harnesses play a role. (A harness is the tool wrapper around a model, such as a coding agent or IDE plugin.)

Go beyond the developer to the whole delivery lifecycle

Trimble started with developers. As coding became commoditized and far more code was produced quickly, cracks showed up in other parts of the SDLC. Barani said attribution goes beyond Git hygiene to how features are defined, broken into tasks and Jira tickets, and combined into an aggregated result.

Expect messy data

Martin pointed out that in the real world a PR might cover three Jira tickets, a ticket might have no PR, and service accounts may author commits. Barani said attribution needs basic engineering discipline; without it, it becomes an approximation, such as attributing tokens to teams and correlating them with the products and features those teams worked on. Trimble uses Harness Engineering Efficiency to correlate this data and layers AI data on top, so it measures engineering efficiency in the context of AI engineering.

Account for duplicate and experimental spend

Trimble has seen developers try multiple tools and models on the same problem, and compare multi-agent against single-threaded agent modes. Barani said the duplication does not go away entirely, so Trimble gives developers and leaders a holistic view that separates experimentation from the spend that led to production. He said it spikes when a new harness or frontier model is introduced and tapers as teams settle into a rhythm of harness, tool, and model.

Normalize seat-based and token-based billing

The second poll asked how attendees' AI coding tools are billed. Per-token was the most common answer, alongside per-seat. Barani said the market is moving toward consumption pricing, and that seat fees of about $10 to $15 are becoming almost negligible next to usage spend, which is often hundreds of thousands of dollars. Hybrid models, which add consumption of other models through hyperscalers, complicate accounting. Martin noted that the FinOps Foundation's FOCUS specification helps normalize different billing shapes. Barani called hybrid the transition path to consumption.

Measure velocity, quality, and cost together

Trimble looks at three dimensions:

  1. Velocity. Do the AI tokens spent increase velocity? Trimble uses DORA and SPACE metrics for engineering efficiency.
  2. Quality. How much of what was generated is retained and shipped to production?
  3. Cost. Is Trimble using the right size of tokens for the right kind of work?

Trimble brings AI data and Engineering Efficiency data from Harness into a model every team and product can use, then aggregates it for leadership. Because the raw data needs business context, Barani's team coordinates with business leaders. The leadership view combines tokens with the human capital that went into building the feature. Martin's summary: it is not just tokens, they are still humans.

Webinar Q&A highlights

How do you keep metrics from being gamed?

Barani: when a metric becomes the target, it gets gamed. Trimble avoids relying on one or two metrics and adopted SPACE, which balances metrics with counter-metrics. For example, if PR cycle time is low, what happens to quality and defect escape rate? Each team tracks improvement against its own baseline, such as a sprint ago. The message to teams is that the trend line matters, not the individual number. Martin agreed that conflicting metrics produce a more rounded outcome, and said Harness also tracks feature velocity and released features, because a lot of what AI generates never makes it out the door.

How do you reduce token use on large analysis tasks?

An attendee asked about P95 latency analysis consuming too many tokens and whether the scan can be limited to specific modules. The speakers offered general advice:

  • Context bloat depends on the harness and model; models assumed to be best suited can bloat context and need multiple iterations (Barani).
  • Put rule sets or skills in place as a precursor to problem solving (Barani).
  • Slice the context meaningfully, and use a router that sends simple work to cheaper, faster models (Martin).
  • Set a limit on the number of cycles per request (Martin).
  • Split into plan and execute: plan with a higher-end model, then implement with a medium frontier or open-weight model (Barani).
  • Sometimes AI is not the best tool for the problem (Martin).

Should you build your own attribution platform?

Martin said you could build it, but it would take years even with AI help, you would start behind vendors, and you would have to maintain, secure, and evolve it. He acknowledged he is on the vendor side. Barani agreed: internal builds tend to target what the company does today rather than industry benchmarks, and an enterprise whose products release anywhere from daily to once a year faces a never-ending commonality challenge. He recommends starting with a tool that covers both engineering and cost, then building the team, product, and custom layer on top. Jared compared the question to the "build your own cloud" debate.

How do you choose between coding tools?

Barani said there is still no clear winner, so Trimble gives developers access to best-of-breed tools without changing them every couple of months. One is not the right answer, but neither are ten; a sweet spot also reduces developers' cognitive load. Martin sees some convergence and thinks the interface to the agent harness will matter more than the specific model. His personal view is that separation of concerns matters: a different model should review code than the one that wrote it, like not marking your own homework. He expects the same to hold in a "software factory" of agents.

Can you predict spend before a feature is built?

Barani said Trimble is in the early stages: it is still normalizing data while models and harnesses keep changing, and is focused on accurately capturing what a feature cost, to use as a rough order of magnitude for similar work. Martin said Harness can help with budgeting and enforcement, including spend caps, but nobody is yet able to predict token spend. He suggested using historical data in the way story points are used, and possibly machine learning on past requests, noting that doing this at scale would itself take tokens to analyze tickets. He also said it is unlike infrastructure as code, because an AI request may go down a rabbit hole. His average-tokens-per-story-point figure in the session was illustrative, not a benchmark.

How do you control spend without slowing teams?

Martin described Harness's internal AI budget enforcement, which covers teams such as finance and people as well as engineering. Budgets are set by role from historical data, with a fast process to request an increase. It is designed not to get in the way, but it makes people think about what they are using, and gives predictability. He contrasted it with stories of teams spending an annual AI budget in the first two months of the year.

Closing advice from the speakers

Barani: set the problem statement before building attribution, and keep the goal post fixed. He also flagged that agents acting on their own and the full AI development lifecycle mean tokens will no longer be confined to coding tools, which he called the next-level problem. Martin: choose your outcome measure and keep it consistent so you can measure improvement over time.

How Harness fits

Harness Engineering Efficiency is part of the Harness Cost Management Agent. It attributes AI coding spend to the developer, commit, PR, or ticket that produced it.

It captures token spend, model choice, and AI-versus-human code at the prompt. Through Git and Jira, it maps cost to PRs, commits, and tickets. It then connects that cost to delivery metrics such as lead time and incidents.

Wasted spend detection surfaces tokens burned on abandoned sessions, bloated prompts, and wrong model choices, and policy and budgets run on a Recommend, Approve, or Autonomous dial with an audit trail.

← Previous:
Next: →‍

FAQs

Related Resources

Get Started

Get Started with Harness AI

Try the full platform free. No module restrictions, no credit card.

Kelsey Rosen
Sr. Product Marketing Manager
Kelsey Rosen brings over a decade of experience in sales, marketing, and FinOps leadership—bridging strategy, creativity, and financial accountability.
kelsey-rosen
Kelsey Rosen
https://www.linkedin.com/in/kelseyrosen/