Blog
What coding agents cost per merged pull request
Your team uses Claude Code, Cursor or Codex, and somebody in finance has asked what it costs. You have two numbers to hand. One is the seat licence: engineers times a monthly price. The other is a token figure from a usage screen, and it is several times larger or smaller than the first. Neither tells you whether the spend is reasonable.
Cost per merged pull request does. It divides everything you paid for agents in a month by the work that shipped in that month. This post shows how to work it out with your own numbers, and what makes it move.
Every figure in the worked examples is illustrative. The prices and the published averages are real, linked, and were checked on 13 November 2026.
Why do the seat price and the token figure disagree?
They measure different things. The seat price is what you pay. The token figure is what the same usage would cost at API list prices.
On a Claude Team plan a premium seat is
$125 a month billed monthly, and each engineer’s Claude Code usage
draws from an allowance that comes with the seat. Anthropic’s
cost documentation says usage inside that allowance is
not metered in dollars. The dollar figure an engineer sees in /usage is computed on their own
machine from token counts at list price. An engineer on a $125 seat can see $600 of tokens on
that screen and you still pay $125.
The two figures meet in three places:
- Usage credits. Once an engineer passes the seat allowance, further usage is billed if you have turned credits on. That part is real money on top of the seat.
- Enterprise plans. Claude Enterprise is listed as a seat price plus usage at API rates, so the token figure is most of the bill.
- API keys and cloud providers. Engineers who sign in through the Claude Console, Amazon Bedrock or Google Cloud are billed per token, and so is an agent in CI that runs on an API key. There is no seat at all.
Cursor works the same way from the other direction: a seat includes a pool of usage, and its pricing page says third-party models are available at API list price.
So the seat count understates your spend if anyone runs past the allowance or runs agents on an API key, and the token figure overstates it for everyone who stays inside a seat. Use invoices.
How do you work out cost per merged pull request?
Add up what you were charged for coding agents in one calendar month, count the pull requests merged in the same month, and divide.
1. The numerator is every agent charge for the month. Take each from an invoice or a billing page, not from a usage screen.
- Seats, for every tool. Include the seats nobody used.
- Usage credits or overage charged on top of seats.
- API token spend from agents: the Claude Console’s “Claude Code” workspace, the keys your CI review and fix agents use, the cloud bill if you run through Bedrock or Google Cloud.
2. The denominator is merged pull requests. Count them per repository with the GitHub CLI:
gh pr list --state merged --search "merged:2026-10-01..2026-10-31" --limit 1000 --json author \
--jq '[.[] | select(.author.is_bot | not)] | length'
Leave out dependency bots. Their pull requests inflate the count and flatter the result.
3. Divide. Do the same division with engineers as the denominator for the per-engineer figure.
Here is an illustrative month for a twelve-engineer team on API billing.
| Illustrative month | Amount |
|---|---|
| Token spend, 12 engineers at $200 each | $2,400 |
| Token spend, CI review and fix agents | $300 |
| Total agent spend | $2,700 |
| Pull requests merged by people | 180 |
| Cost per merged pull request | $15.00 |
| Cost per engineer | $225 |
The same team on Team premium seats would replace the first row with 12 seats at $125, which is $1,500, plus whatever usage credits were charged. The method is the same with a different numerator.
What is a sensible range?
Anthropic publishes one: across enterprise deployments, Claude Code averages around $13 per developer per active day and $150 to $250 per developer per month, and stays below $30 per active day for 90% of users. That is from the cost documentation.
There is no published figure per pull request, so derive one. Cost per merged pull request is monthly cost per engineer divided by pull requests merged per engineer. At the published range, the arithmetic gives:
| Merged pull requests per engineer per month | At $150 per engineer | At $250 per engineer |
|---|---|---|
| 5 | $30.00 | $50.00 |
| 10 | $15.00 | $25.00 |
| 20 | $7.50 | $12.50 |
This table is arithmetic on Anthropic’s range, not a benchmark of real teams. Your merge rate is the input that matters. A team that ships large pull requests weekly and a team that ships small ones daily can spend the same per engineer and differ by four times per pull request, so compare your number with your own last quarter before you compare it with anyone else’s.
The 90% figure also says the spread between engineers is wide. A per-engineer average is a budgeting number. An engineer at three times the average may be running the migration nobody else wanted.
What does one pull request cost in tokens?
Most of the tokens in an agent session are the conversation being re-read. The agent sends the whole context with every request, and a request goes out each time it uses a tool.
Take an illustrative session that produces one pull request: 60 requests, with a context that averages 80,000 tokens. Priced at Anthropic’s list prices for Sonnet 5.5, which are $2 per million input tokens, $2.50 per million for a five-minute cache write, $0.10 per million for a cache read and $10 per million output tokens:
| Illustrative session on Sonnet 5.5 | Tokens | Cost |
|---|---|---|
| Cache reads, 60 requests of 80,000 | 4,800,000 | $0.48 |
| Cache writes, new content and one miss | 300,000 | $0.75 |
| Uncached input | 20,000 | $0.04 |
| Output | 60,000 | $0.60 |
| Total | $1.87 |
Fewer than one token in eighty is output. The 4.8 million re-read tokens cost $0.48 because they were served from the prompt cache at a twentieth of the input price. At the full input price the same re-reading costs $9.60.
The illustrative team earlier paid $15.00 per merged pull request, eight times this session. The monthly total also pays for retries, review agents and the sessions that never became a pull request.
What moves the number?
Five things move it: model choice, cache use, parallel sessions, retries and abandoned branches.
Model choice. List prices for Opus 5.5 are twice those for Sonnet 5.5 on every line: $4 input, $5 cache write, $0.20 cache read, $20 output. The illustrative session above costs $3.74 on Opus 5.5. A default model set once in a config file doubles or halves the bill for every engineer who never changes it.
Cache use. A cache read costs a twentieth of fresh input on Sonnet 5.5 and a cache write costs 1.25 times. Anthropic’s prompt caching page for Claude Code says token-billed sessions get a five-minute cache lifetime by default. Come back from a meeting to a session holding 80,000 tokens and the next request writes all of it again for $0.20, where a warm read would have cost under a cent. Switching model mid-session does the same. The share of input tokens served from cache is the first ratio to check when spend per engineer looks high.
Parallel sessions. Each session carries its own context, so three agents in three worktrees cost three sessions. Anthropic’s cost documentation puts agent teams at roughly seven times the tokens of a standard session when teammates run in plan mode. Parallel work is often worth it. It should show up as more merged pull requests, and this metric tells you whether it did.
Retries. A session that goes down the wrong path, gets corrected and starts again pays for both attempts, and the second one re-reads the first. The same applies to an agent in CI that pushes a fix, fails the checks and tries again. Retries raise tokens per pull request without raising the count of pull requests.
Abandoned branches. A branch that is never merged adds to the numerator and nothing to the denominator. If the team in the first table merged 180 pull requests and closed 40 unmerged, the $15.00 already includes the cost of those 40. Track the closed-unmerged count beside the metric. When cost per merged pull request rises and tokens per session have not, check this count first.
Where does per-engineer data come from?
From the provider, per user and per day. For engineers who authenticate against a Claude Console organisation, the Claude Code Analytics API returns sessions, commits, pull requests created through Claude Code, tokens by model including cache reads and cache writes, and an estimated cost for each user each day. It does not cover engineers signed in with a subscription seat. For those, Team plans have a spend report export, Enterprise has its own analytics API, and Claude Code’s OpenTelemetry export works on any plan.
Per-key spend is the other route. Give each CI agent its own API key and its cost separates from the engineers’ without any further work. We wrote up how the providers differ on that in attributing AI API costs per key.
Keeping the number current
The division above is a month-end job in a spreadsheet. Plutus keeps it running for the token-billed part of the spend. Connect Anthropic or OpenAI as a cost source and GitHub as an event source, and it syncs spend by model and by API key, with Anthropic’s per-key figures labelled as estimates, next to a daily count of every pull request merged in each repository you list. A unit metric divides the provider’s spend by that count, so cost per merged pull request becomes a chart you can watch. Merged pull requests and releases are marked on the cost charts, and for Anthropic models the AI Overview shows cache-read tokens, cache-write tokens and a cache-hit rate. Seat licences go in as a recurring manual cost and appear beside the synced spend in the Cost Explorer.
Get started free. No credit card, no sales call.