FinOps for AI: per-commit cost attribution

mooracle1 pts0 comments

FinOps for AI: Same Game, Higher Stakes | Mooracle<br>Skip to main content

← Back to blog Updated May 19, 2026.

Your team ships a feature. Copilot burns tokens across dozens of completions. Claude runs an agentic session or three. The monthly bill arrives as a lump sum. Which feature cost what? Nobody knows.

Think of it like planning poker with blank cards. Everyone holds up a number, nobody checks after the game. Except the stakes are much higher now — and the whales at this table can always fold and walk away from Copilot.

Contents<br>This is the FinOps gap for AI-assisted development: work is metered at the API level, invisible at the feature level. Cloud FinOps solved the same problem for infrastructure years ago — attribute cost to whatever consumed it. AI coding needs the same treatment.

The practice this article argues for: measure AI cost per work item, feature, or PR. The data is already there — token counts on every API response, rates on every model. The gap is just between the API and git log. Closing it is a tooling problem with several reasonable answers. I’ll suggest one I built; the practice is the point.

Pick whichever unit lets your team compare tasks apples-to-apples — USD, AIC (GitHub’s AI Credits, 1 AIC = $0.01), or raw tokens — and stay consistent. From here on I’ll use “AI cost” generically; switch units in your head as needed.

Why It’s a Real Number Now

On June 1, 2026, GitHub Copilot moves to usage-based billing in AI Credits (AIC). Every plan ships with a monthly AIC allowance, and consumption is metered per token against a published per-model rate card. A single agentic session can burn 600 AIC ($6) or more. The sticker price is the allowance; the question is whether your team’s actual consumption fits inside it.

Until now, “how much will this feature cost in AI?” was a curiosity. After June 1, it’s a planning input — a finite, hard-cap budget like any cloud quota.

The good news: unlike human effort, AI work comes with a receipt. Every AI call has a token count. Every token has a published rate. When Claude Sonnet generates an auth module, the cost isn’t “about three days of senior engineer time” — it’s 47,000 input tokens and 12,000 output at $3/$15 per million: 32 AIC ($0.32). The data exists at the API level. It just doesn’t reach the commit.

The Commit Receipt

The cleanest place to attribute AI cost is the commit itself. Capture per-request token counts from your assistant, compute cost against the published rate card, and append the total as a git trailer on the commit it belongs to. Then git log is the cost ledger.

A commit with all three trailers attached looks like this:

feat: add OAuth2 login flow

Copilot-Est-Cost: $0.41<br>Copilot-AI-Credits: 41.30<br>Copilot-AI-Credits-Models: Claude Sonnet 4.6=39.45,GPT-4.1=1.85<br>(Copilot-AI-Credits is the default trailer; the per-model breakdown and USD-equivalent are opt-in via settings.)

Cost is denominated in AI Credits (1 AIC = $0.01) — the same unit GitHub bills in starting June 1, plan-invariant across Pro, Business, and Enterprise. Copilot Budget reads raw token counts (input, output, cache reads, cache creation) per request and maps them to AIC against the published per-model rate card. The math doesn’t change on June 1, so trailers written today match what GitHub will start billing — no migration step. Whatever produces the trailers, the trailers are the artifact: aggregate across a branch for cost per feature, across a week for a number you can verify against the AIC allowance.

You can wire this up several ways: a CI step that scrapes API logs, a post-commit hook reading provider session files, or an editor extension doing capture inside the IDE. For GitHub Copilot, I wrote one — Copilot Budget, a VS Code extension that reads Copilot’s session metadata and writes these trailers via prepare-commit-msg. MIT-licensed, works on any plan. If you’re on Claude Code, Cursor, or a custom API, the practice is the same; the connector will be different.

main

feat/auth

$6.15<br>3 commits

feat/dashboard

$43.05<br>14 commits · context-heavy

feat/rate-limit

$2.70<br>2 commits

SPRINT<br>$51.90

under budget

over budget

merge to main

The pattern shows fast. A clean auth flow takes 3 commits and $6.15. A dashboard refactor takes 14 commits and $43.05 — the model had to hold the whole design system in context for each variation. That’s a prompt-architecture problem you can only diagnose from the data.

Cost Hotspots

The receipt does more than total spend — it surfaces cost hotspots: work items where the model burns disproportionate tokens. Treat them as investment signals.

A feature that runs up $5 of AI cost across a week of agentic sessions isn’t just costly. The model is doing the same shape of work repeatedly, with no scaffolding to reuse, and you’re paying tokens to rebuild context every session. That’s a tooling gap with a price tag attached.

The response is the same kind of work you’d do to onboard a new engineer faster — write...

cost copilot commit feature model work

Related Articles