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.
- Agent usage & billing exports
- Git host
- Pull requests & reviews
- CI pipelines
- Revert history
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.
- 01Coding agentSession startedRecorded inUsage export · OpenTelemetry traces
Session, model, tokens or credits, developer and team.
- 02Coding agentChange writtenRecorded inGit host
Commits and branch, attributed to the agent session.
- 03ReviewerPull request reviewedRecorded inPull requests & reviews
Review comments, approvals and requested changes.
- 04CIChecks runRecorded inCI pipeline
Build and test results on the commit that was merged.
- 05MaintainerMergedRecorded inGit host
A merged change — the denominator for cost per merged change.
- 06Git historyHeld or revertedRecorded inGit 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.
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.
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.
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.
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.
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.
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.
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
- Cost per merged changeteam · tool · model
- Revert ratewithin N days
- Cycle timelike for like by task type
- Matched task types across tools
- Staggered rollout by team
- Randomised routing on eligible tasks
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
- Monthly spend capper team · per developer
Caps with burn-down; overruns flagged to the team lead.
- Per-session captokens or credits per session
Catches runaway loops early, not at month end.
- Model tier by taskpremium: complex · standard: routine
Tests, dependency updates and docs default to the cheaper tier.
- Protected branchesno direct pushes to main
Every change goes through a pull request and human review.
- Repository scopeteam repositories only
Writes outside the team's repositories are exceptions.
- Attributable sessionssession ↔ developer ↔ commit
Every agent change traceable to the developer who ran it.
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
“Which tools earn their cost, team by team?”
“How do we route work between premium and cheaper agents?”
“Can we cap and charge back agent spend?”
“Is coding-agent spend producing output we can see?”
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.
- 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
- Week 0Connect
- Week 2Baseline
- Week 4Mandates
- Week 6Decide
FAQ
Common questions
Is cost per merged change a fair measure of productivity?
Which coding tools can it read from?
Does source code leave our network?
Will this be used to rank individual developers?
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.