Skip to content
ThetaLayer

Solutions · Software engineering

What your coding agents cost per merged change

Engineering teams run several coding agents on several models, billed in seats, tokens and credits. ThetaLayer joins agent spend to what reached the main branch — and what stayed there — so you can set caps, charge back, and route work between premium and cheaper agents on evidence.

Evidence from
  • Agent usage & billing exports
  • Git host
  • Pull requests & reviews
  • CI pipelines
  • Revert history
Change ledger
One change · coding agent
Opened pull request
Agent reported
tests passing
CI pipeline says
checks passed on head commit
ConfirmedLinked by direct reference · 95%
Review and merge
Person recorded
approved
Git host says
approved by reviewer · merged
ConfirmedLinked by direct reference · 95%
Change complete
Agent reported
done
Git history says
reverted after merge
FlaggedLinked by direct reference · 95%
Merged change reverted inside the revert window
Counted in the agent's revert rate · cost attributed to team and model
Illustrative · example run, simulated data

The workflow

From agent session to a change that stays merged

Coding-agent spend lives in usage exports; output lives in your Git host. ThetaLayer joins the two, change by change.

  1. 01
    Coding agent
    Session started
    Recorded in
    Usage export · OpenTelemetry traces

    Session, model, tokens or credits, developer and team.

  2. 02
    Coding agent
    Change written
    Recorded in
    Git host

    Commits and branch, attributed to the agent session.

  3. 03
    Reviewer
    Pull request reviewed
    Recorded in
    Pull requests & reviews

    Review comments, approvals and requested changes.

  4. 04
    CI
    Checks run
    Recorded in
    CI pipeline

    Build and test results on the commit that was merged.

  5. 05
    Maintainer
    Merged
    Recorded in
    Git host

    A merged change — the denominator for cost per merged change.

  6. 06
    Git history
    Held or reverted
    Recorded in
    Git history

    Reverts within the window you set, linked back to the original session.

Sessions link to commits by direct reference where the tool records one, otherwise by developer identity and time window — and the method is always shown.

Direct reference
95%
Business key
85%
Time window
70%

What ThetaLayer shows you

Where coding-agent spend goes, and what it buys

What ThetaLayer is built to surface across coding agents, teams and models — spend joined to merged output, not reported next to it.

Scorecard · Spend

Spend by team, tool and model in one place

e.g. one team's spend concentrated on a premium model for routine refactors — visible next to its merged output instead of spread across three vendor invoices.

Evidence
Usage exports + seat licenses, allocated to teams
Scorecard · Quality

Changes that don't stick

e.g. agent-assisted changes reverted within your chosen window, by repository, tool and model — so a cheap change that's rolled back isn't counted as cheap.

Evidence
Git history: revert of a merged commit
Scorecard · Routing

Where the cheaper agent does as well

e.g. test generation and dependency updates completed by a cheaper agent at a similar merge and revert rate — candidates to route away from the premium tier.

Evidence
Cost per merged change and revert rate by task type
Mandate · Spend caps

Sessions that run through a cap

e.g. an agent stuck in a loop consuming tokens overnight, flagged against the per-session and monthly caps the team agreed.

Evidence
Usage export: spend over time vs. cap
Ledger · Unlinked spend

Spend that never became a pull request

e.g. long agent sessions with no resulting commit or pull request — real cost with no output to show for it.

Evidence
Agent session with no linked commit
Mandate · Repository scope

Agents writing where they shouldn't

e.g. an agent pushing directly to a protected branch, or into a repository outside its team's scope.

Evidence
Git host audit log vs. the agent's mandate

Illustrative examples of what ThetaLayer is built to detect — not results from customer deployments.

Measurement

Descriptive first. Causal only when the design supports it.

Cost per merged change tells you what each tool and team spends per unit of output. On its own, it doesn't tell you that switching tools would change that number — teams, repositories and task mix differ. When you need a causal answer, we help you set up a comparison that can support one.

  • Every comparison labeled descriptive or comparative
  • Task mix shown next to every tool comparison
  • Projected routing savings labeled as modeled
Reading the scorecard
Two kinds of answer
Descriptive · what happened
  • Cost per merged changeteam · tool · model
  • Revert ratewithin N days
  • Cycle timelike for like by task type
Comparative · what would change
  • Matched task types across tools
  • Staggered rollout by team
  • Randomised routing on eligible tasks
Routing savings stay labeled as modeled until a comparison confirms them.
Illustrative

Mandates that fit this work

Caps, tiers and boundaries for coding agents

Rules engineering leaders already talk about — budgets, model tiers, protected branches — written down and checked against every session.

  • Versioned: edit a rule and every historical run is re-checked
  • Detection first: breaches become exceptions for a named owner
  • Enforcement later, only at the tool boundaries you choose
Mandate · Coding agents · Payments teamL3 · act within limits
  • Monthly spend cap
    per team · per developer

    Caps with burn-down; overruns flagged to the team lead.

  • Per-session cap
    tokens or credits per session

    Catches runaway loops early, not at month end.

  • Model tier by task
    premium: complex · standard: routine

    Tests, dependency updates and docs default to the cheaper tier.

  • Protected branches
    no direct pushes to main

    Every change goes through a pull request and human review.

  • Repository scope
    team repositories only

    Writes outside the team's repositories are exceptions.

  • Attributable sessions
    session ↔ developer ↔ commit

    Every agent change traceable to the developer who ran it.

Example mandate · adapted to your policy during the pilot

Metrics on the scorecard

Metrics engineering and finance can both read

Defined per team, tool and model — with the task mix shown next to every comparison.

M01Cost per merged change
Agent spend — tokens, credits and allocated seats — divided by merged pull requests the agent contributed to. Descriptive unless a comparison design supports causal claims.
M02Revert rate
Share of merged agent-assisted changes reverted within N days, with N set by you.
M03Cycle time
Time from first commit to merge for agent-assisted changes, compared like for like by task type.
M04Spend by team, tool and model
Every euro of agent spend allocated to a team and cost center, ready for chargeback.
M05Cap utilization
Spend against per-session and monthly caps, with burn-down.
M06Unlinked spend
Spend on sessions that produced no commit or pull request.

Every metric is defined, versioned and traceable to its source records. Allocated platform fees are labeled as allocated.

Who it's for

For engineering leaders and the people who pay for the tools

VP Engineering

“Which tools earn their cost, team by team?”

Cost per merged change, revert rate and cycle time by tool, model and team.
Head of AI Platform

“How do we route work between premium and cheaper agents?”

Task-type comparisons, with routing savings labeled as modeled.
CFO / FinOps

“Can we cap and charge back agent spend?”

Spend by team and cost center, caps with burn-down, allocated fees labeled as allocated.
Chief AI Officer

“Is coding-agent spend producing output we can see?”

One scorecard across every coding tool and vendor.

How a pilot works here

One of the quickest pilots to start

Usage exports and your Git host often cover most of what's needed. In six weeks we baseline cost per merged change, revert rate and cycle time by team and tool, then propose caps, chargeback and routing rules.

Pilot scope · Software engineeringSix weeks · read-only
Workflow
Agent-assisted changes for one to three teams
Agent runtime
One coding-agent tool or runtime
Systems of record
Git host · CI · usage and billing exports
Access
Read-only. No changes to your agents.
Success criteria
e.g. a target reduction in spend per merged change at an equal revert rate, or caps and chargeback in place
  1. Week 0
    Connect
  2. Week 2
    Baseline
  3. Week 4
    Mandates
  4. Week 6
    Decide
Is cost per merged change a fair measure of productivity?
It's a useful descriptive measure of spend per unit of output, not a full productivity measure. Teams, repositories and task mix differ, so we show task mix next to every comparison and label metrics as descriptive unless a comparison design — matched tasks, a staggered rollout or randomised routing — supports a causal claim.
Which coding tools can it read from?
ThetaLayer is built to read usage and billing exports and traces from coding agents such as Claude Code, Cursor and GitHub Copilot, alongside your Git host and CI. Connector availability is confirmed during pilot scoping.
Does source code leave our network?
No. The collector reads metadata — sessions, token counts, commits, pull-request and CI events — and drops code, diffs and prompts before anything is exported.
Will this be used to rank individual developers?
It's designed to compare tools, models and teams, not to score individuals. We recommend reporting by team and tool, and scope the pilot that way.

Book a Demo

See cost per merged change for your teams.

Book a 30-minute walkthrough. We'll show how agent spend is joined to merged output, and scope a six-week, read-only pilot across one to three of your teams.