MergeCost
Cost review for pull requests

That “small refactor” could cost $12,000 a month. Find out before you merge it.

MergeCost puts the monthly AWS + AI bill impact of every pull request right into code review — with the exact line that causes it and how to fix it.

1 repository free for 30 days No credit card One-click setup Your source code never leaves your CI
mergecost commented on PR #482 · “Add AI summaries to feed” bot
Estimated cost impact +$11,531 – $14,152 / month
base c7b9e88 → head b0aa93a · 200,000 requests/day · confidence: medium
EndpointChange per requestMonthly
GET feed/+50 LLM calls (gpt-4o-mini)+$11,506 – $14,063
GET feed/+50 DB queries (N+1)+$15 – $74
GET feed/+3.9 KB of logs+$9 – $14
N+1 query in shop/views.py:20 — use select_related('author') on the queryset feeding this loop.
LLM call per item in shop/llm.py:16 — batch items into one call, or cache results.

Real output from our Django demo app. Your numbers come from your tests, your traffic and current prices.

The problem

Code review catches bugs.
Nobody reviews the bill.

The most expensive lines in your codebase pass every test, look harmless in a diff, and get approved in minutes. They only show up weeks later — as a line item nobody can explain.

The N+1 that passed review

One missing select_related turns 1 query into 51 — on every page view. Tests pass with 5 rows. Production has 50 per page and millions of views.

# looks innocent for post in posts: names.append(post.author.name) # 1 query per post

The LLM call inside a loop

“Add a summary to each item” ships as one API call per item. 50 calls per request at 200,000 requests a day is a five-figure monthly bill — for one endpoint.

for item in items: item.summary = summarize(item.body) # $$$ per item

The debug log that never left

A friendly logger.info on a hot path writes gigabytes a day into CloudWatch. Ingestion is billed per GB, and nobody remembers adding it.

for row in rows: logger.info("processing %s", row)

The payload that kept growing

An extra serializer field, an unpaginated list, a paid API called per request. Each change is tiny. Together they quietly raise egress and third-party fees every month.

fields = "__all__" # +40 KB per response
Why it hurts

You find out a month too late — and you pay for every day in between.

Cloud and AI bills arrive long after the code that caused them. By then the change is buried under hundreds of commits, the author has moved on, and the money is already spent.

😬 Today

  • Day 0 — PR approvedTests green. Reviewers look at logic, not cost.
  • Day 1 — DeployedThe extra queries and API calls start running on every request.
  • Day 30 — The invoiceAWS and OpenAI are up. Finance asks why. Nobody knows.
  • Day 35 — The huntEngineers dig through dashboards and git history to find which change did it.

✅ With MergeCost

  • Minute 0 — PR openedYour CI runs your tests on the old and new code.
  • Minute 5 — Cost comment“+$12k/month. Here is the line. Here is the fix.”
  • Minute 15 — Fixed in reviewThe author batches the calls before anyone merges.
  • Day 30 — Nothing to explainThe expensive version never shipped.

💸 Money you can't get back

Every day an expensive change runs in production is billed. A fix after the invoice saves next month — not this one.

🧭 Blame you can't assign

Billing dashboards show which service got expensive, not which pull request. Tracing it back takes hours of senior engineering time.

📈 AI makes it volatile

With LLM features, cost per request can jump 100× from a single line. Your margins now depend on code review.

The solution

Every pull request gets a price tag.

MergeCost measures what your code actually does, not what it looks like it does — then turns it into dollars your team understands.

01 / MEASURE

Runs your existing tests twice

On the PR's base and head commits, inside your own GitHub Actions runner. No new tests to write.

02 / COMPARE

Sees every endpoint change

Database queries and N+1 patterns, LLM calls and real token usage, paid API calls, log bytes and response size — per request.

03 / PRICE

Comments the monthly cost

Scaled to production data sizes, multiplied by your real traffic and current AWS and AI prices. With the line and the fix.

Measured, not guessed

Query counts and token usage come from real execution of your code — not from pattern matching on a diff.

The line and the fix

Every finding points to file.py:line with a concrete suggestion, like select_related('author') or batching.

Your real traffic

A tiny middleware reports requests per route, so estimates use what production actually does.

Budget gates

Set fail_above: 500 and any PR that adds more than $500/month fails the check until someone signs off.

Untested code, too

A static scan flags database, HTTP, LLM and log calls added inside loops — even where no test reaches.

Savings you can show

The dashboard totals the monthly cost your team avoided before merge. Easy to share with finance.

Why nothing else catches this

Your tools see infrastructure and invoices. Not the code in between.

MergeCost runs inside your own CI, so it can measure your code changes without your code ever leaving it.

Covers app code changesBefore mergeMonthly $ per changePoints to the line
Code reviewYesYesNoOnly if someone notices
Infrastructure-as-code cost toolsNo — infra files onlyYesFor infraNo
APM & cloud billing dashboardsPartlyNo — after deployBy serviceNo
MergeCostYesYesYesYes
Try it

What would one LLM call per item cost you?

Move the sliders to match one of your endpoints. This is exactly the kind of change MergeCost flags in review.

Assumes 75% input / 25% output tokens. Prices per million tokens, verified November 2026.

This one change would add
$0
$0 per year
MergeCost Team is $49/month.
Private by design

Your source code never leaves your CI. Only measurements do.

Tests run on your own GitHub Actions runner. MergeCost only receives numbers: query counts, token counts and byte sizes per endpoint.

🔒 No source code uploaded

Only per-endpoint numbers leave CI — never files or code lines. Generated SQL text can be redacted with one setting.

🕶️ No user data

The production middleware sends route templates and counts — never URLs, headers, bodies or personal data.

🔑 Keys you control

Keys are stored hashed, shown once, and revocable from the dashboard at any time.

Works with your stack

Drop it into the tests you already have.

One click opens a setup pull request tailored to your stack. No new tests, no application code changes.

DjangoDjango REST FrameworkFastAPI StarletteFlaskSQLAlchemyCelery pytestmanage.py testOpenAIAnthropic Node.jsExpressFastifyNestJS JestVitestPrismapgmysql2 AWSGitHub Actions Rails — nextGo — planned Java — plannedPHP — plannedGitLab CI — planned
Pricing

Pays for itself the first time it catches something.

Start free on one repository. Upgrade when it has proven itself.

Free trial

$0 for 30 days
  • 1 repository
  • Every feature included
  • Production traffic SDK
  • No credit card
Start free trial

Growth

$199 / month
  • Unlimited repositories
  • 20,000 PR runs / month
  • 1-year history
  • Priority support
Start with a free trial

Prices in USD. Taxes may apply. Payments handled by Dodo Payments.

Questions

Before you ask

How accurate are the numbers?

Query counts, LLM calls and token usage are measured by running your code. Dollar figures are shown as a range with a confidence level (high, medium or low), based on where your traffic numbers and prices come from. The full formulas are in how it works.

How long does setup take?

About two minutes: sign in with GitHub, install the MergeCost GitHub App on your repository, and click Set up automatically. MergeCost creates the API key secret and opens a pull request with the workflow and config for your stack. Review it, merge it, done.

Will it slow down our CI?

It runs your tests on the base and head commits, so the job takes about twice your test time. The base result is cached by commit, so pushes to the same PR only re-run the head.

What if a code path has no tests?

A static scan flags database, HTTP, LLM and log calls added inside loops, listed as “possible risks”. They carry no dollar amount because there was nothing to measure.

Does my source code get sent anywhere?

No. Everything runs in your CI. Only per-endpoint numbers are sent to compute the estimate. See security & data.

What happens after the trial?

Pick Team or Growth to keep getting cost comments. If you don't, the comments stop. Your workflows keep passing, and nothing is billed automatically.

Using another stack?

Rails is next, then Go, Java and PHP. Leave your email and stack, and we'll tell you the day it's ready.

Stop paying for code nobody priced.

Put a price tag on every pull request — before it reaches production and your invoice.

Start your free 30-day trial →
No credit card1 repository freeCancel anytime