← All buyer guides

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.

By Sammy TouraniGTM Engineer at Weave
Published Read Time: 4 min
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 labelWhat it meansHow to use it
ActualThe amount a provider billed, or a contracted seat costReconcile it with invoices
EstimatedTokens priced at published list ratesTreat it as directional spend before discounts and credits
Plugin-observedClaude Code usage priced from per-request tokens, with plan or overage state read from rate limitsRequests inside the plan are $0 and overage uses list rates
Plugin-estimatedClaude Code usage without a rate-limit readingExpect it to overstate cost when a plan covered the request
ModeledUsage priced through a credit, ACU or telemetry pricing modelCheck 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 →

SessionCost labelCostWhat happened
Investigate failing testActual$3.20Found the failing contract
First implementationEstimated$8.40Changed 4 files and failed CI
Repair and add testsActual$5.10Passed CI and merged
Review follow-upPlugin-observed$0.00Covered 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

  1. Did the session merge? Unmerged spend can be research, a rejected approach or abandoned work. Inspect a sample before treating it as waste.
  2. What work merged? Compare cost with code output, review and later reverts. PR count alone hides difficulty.
  3. Which cost source is this? Reconcile actual billing first. Treat estimates as directional.
  4. 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.
  5. 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.

Book a demo