What did this pull request cost in AI tokens?
Trace AI coding spend from agent sessions to merged pull requests. See which costs are billed or estimated, what Weave connects and how to review expensive work.
On this page
Weave answers this question by connecting AI coding costs, agent sessions and merged pull requests. Token Intelligence reports what each person, tool and model cost. Agent Observability joins session cost to the work that merged, then links each merge to Weave's code output estimate and review data.
That connection changes the budget conversation. An expensive session that produced a difficult migration needs different treatment from a session that looped, stopped or produced a change that was later reverted. A provider bill can show the cost. Weave helps you inspect what the spending produced.
Start with the cost source
The same dollar figure can mean different things. Before assigning cost to a PR, identify how Weave collected it.
Scroll horizontally if needed →
| Weave cost label | What it means | How to use it |
|---|---|---|
| Actual | The amount a provider billed, or a contracted seat cost | Reconcile it with invoices |
| Estimated | Tokens priced at published list rates | Treat it as directional spend before discounts and credits |
| Plugin-observed | Claude Code usage priced from per-request tokens, with plan or overage state read from rate limits | Requests inside the plan are $0 and overage uses list rates |
| Plugin-estimated | Claude Code usage without a rate-limit reading | Expect it to overstate cost when a plan covered the request |
| Modeled | Usage priced through a credit, ACU or telemetry pricing model | Check the configured rate before comparing tools |
Weave shows these labels in the person-level cost drill-down. The AI tool cost documentation lists the source for each supported tool, including Claude Code, Cursor, GitHub Copilot, Codex, OpenRouter, Devin and Windsurf.
Follow the session to the merged work
Open the expensive person, tool or model in Weave's AI report. Then inspect the agent sessions behind the spend. Agent Observability shows the session timeline, loop patterns and spend to outcome. Session detail depends on the agent traces you connect.
For each merge, Weave links the code output estimate and review history. The output estimate measures the expert effort represented by the change. Review data adds rounds before merge, review depth and later reverts. You can compare a routine generated update with a hard refactor before deciding whether the spend was justified.
For a session routed through Weave Router, the session cost API returns the actual cost and the cost of the requested model. It also returns input, output, cache-creation and cache-read tokens. That separates model choice from the amount of work the session performed.
Review an illustrative PR
The figures below are illustrative. They show how to review a PR without combining billed, estimated and subscription-covered usage into a single unlabeled number.
Scroll horizontally if needed →
| Session | Cost label | Cost | What happened |
|---|---|---|---|
| Investigate failing test | Actual | $3.20 | Found the failing contract |
| First implementation | Estimated | $8.40 | Changed 4 files and failed CI |
| Repair and add tests | Actual | $5.10 | Passed CI and merged |
| Review follow-up | Plugin-observed | $0.00 | Covered by plan |
This PR has $8.30 in actual cost and $8.40 in estimated cost. Report them separately. If the PR represents substantial expert effort, passed review cleanly and stayed in production, the spend may be reasonable. If failed first implementations are common, change task instructions, verification steps or model choice before raising the budget.
Check coverage before you trust the total
A PR-level view only covers sessions that link to a PR. Before relying on it, ask how many sessions and how many dollars link to a merged PR, and keep the rest visible. Sessions and PRs do not map neatly, and some spend never produces a merge. Report shared and unmatched spend as its own lines instead of forcing a precise split.
Questions to ask before cutting spend
- Did the session merge? Unmerged spend can be research, a rejected approach or abandoned work. Inspect a sample before treating it as waste.
- What work merged? Compare cost with code output, review and later reverts. PR count alone hides difficulty.
- Which cost source is this? Reconcile actual billing first. Treat estimates as directional.
- Did the requested model fit the work? Compare routed-session cost with requested-model cost to test whether easier steps could run on cheaper models.
- What will you change? Choose a single intervention: task scope, a codified workflow, review standards, model routing or the allowance.
Weave's Q3 report found that $23 of every $100 of traced agent-session spend went to sessions that completed and merged. Another $17 merged without a completion signal. That population excluded a single organization responsible for 77% of traced spend, so use the result as context and inspect your own sessions. Read the State of Engineering report.
Connect AI spend to merged work
Connect source control and 2 or 3 AI coding tools. Reconcile a month against invoices, then open the 10 most expensive sessions and the PRs they produced. See Token Intelligence, explore Agent Observability or book a demo.
See the work behind your AI spend
Compare code output, AI cost and quality, then inspect the work behind the trend.
Related guides
AI ROI tools for engineering teams
Compare AI investment using explicit cost definitions and measured code output.
AI Cost Observability Tools: Coding Agents, LLM Apps and Cloud Spend Compared
Compare tools for coding costs, LLM requests and cloud bills.
The Intelligence Layer for Software Factories
How code, agent sessions and AI spend connect to engineering decisions.