Skip to main content
PR AI cost estimates how much AI coding agent usage went into each pull request. Weave looks at every prompt an engineer sends to their coding agent, works out which PR that prompt contributed to, and adds the prompt’s cost to that PR. It works with Claude Code, Codex, and other coding agents that report to Weave through a Weave plugin. The number is shown as Estimated API-equivalent AI cost, so it reflects how much AI work went into the PR rather than what your invoice says. When the coding agent’s telemetry reports a cost for a request, as Claude Code does, Weave uses that cost as is, even when it’s $0. Otherwise Weave prices the request’s tokens at list rates. For billed spend per engineer, see AI tool costs.

Where you’ll see it

  • PR drill-downs: an Estimated API-equivalent AI cost column on PR lists across Weave reports
  • Projects and workstreams: AI spend and AI cost per output for each project, task, and workstream, rolled up from the PRs linked to them
PR AI cost is enabled per organization. Contact your Weave representative to turn it on.

How it works

1

Collect priced prompts

The coding agent’s Weave plugin reports each prompt with its session, git branch, repository, and the files the agent read, edited, or touched with shell commands. Weave prices each prompt from the cost its telemetry reports, or from its token usage at list rates when no cost is reported.
2

Find candidate PRs

Weave matches the prompt’s branch and repository to PRs opened from that branch. A prompt can count toward a PR from up to 14 days before the PR was opened until it closes.
3

Anchor prompts to a PR

A prompt is anchored to a PR when the files it worked on are files that PR changed. With git attribution installed, a prompt is also anchored when its session made a commit that ended up in the PR.
4

Attribute the surrounding prompts

Prompts in the same session that didn’t touch PR files themselves, such as planning, questions, or debugging, are attributed to the PR when they fall between two prompts anchored to it, or when they lead up to its first anchored prompt.
Prompts on main, master, develop, or dev, and prompts that can’t be tied to any PR, are left out of PR AI cost. They still count toward AI tool costs.

Supported coding agents

Requirements

PR AI cost only covers work from engineers whose machines meet these requirements. If only some of your engineers have them set up, PR AI cost will look sparse, because PRs written without them show little or no cost.

For every coding agent

  • The coding agent’s Weave plugin is installed on each engineer’s machine. The plugin reports the branch, repository, and file activity for each prompt. Without it, Weave can’t tie a prompt to a PR.
  • Each engineer’s plugin account is connected to their Weave member. Prompts from unlinked accounts aren’t counted.
  • The repository is connected to Weave. The repository the engineer works in must match a repository synced from your code platform, so Weave can see its PRs and changed files.
  • Work happens on a feature branch. Prompts sent while on main, master, develop, or dev aren’t attributed.
  • The plugin’s content categories allow git and file data. Keep git_context, file_paths, and tool_io allowed in your organization’s content policy. Without them, the plugin can’t report the branch or files a prompt touched.

Claude Code

  • Install the Claude Code plugin on each engineer’s machine.
  • Connect Claude Code telemetry to Weave. Weave uses Claude Code’s native telemetry for the cost of each request, and the plugin to tie each request to its branch and files.

Codex

  • Install the Codex plugin on each engineer’s machine. It turns on Codex’s native telemetry for usage and cost, and its hooks capture the branch and files each turn changed.
  • Trust the Weave hooks when Codex asks after install. Without them, Codex reports cost but not branch or file activity.
Git attribution isn’t required, but we strongly recommend it for accurate results. Git-ai records which AI session wrote the code in each commit, which lets Weave tie a prompt to a PR through the commit itself instead of relying only on branch names and file paths. This matters most when an engineer’s git workflow doesn’t line up neatly with their PRs:
  • The PR is opened from a different branch than the one the code was written on, such as after a rename, cherry-pick, or from a worktree or fork
  • Files the agent edited were later renamed, moved, or reverted, so they no longer appear in the PR’s changed files
  • The plugin missed the file activity for a prompt, or the agent changed files only through shell commands
  • The work happened well before the PR was opened
Install git attribution on the same machines as the coding agent plugin, with its hooks configured for each coding agent.

FAQ

The PR was most likely written without a supported coding agent, or on a machine without the coding agent’s Weave plugin. Other common causes are an unlinked plugin account, work done on a default branch, or a content policy that blocks git and file data. Installing git attribution helps when the PR was opened from a different branch than the one the code was written on.
PR AI cost only includes prompts that can be tied to a PR, and it uses the cost the coding agent reports or list-rate token pricing rather than your billed rates. Requests the agent reports at $0 add nothing. AI tool costs include all usage, seat costs, and billed amounts from provider APIs.
Yes. When a prompt matches more than one PR, Weave splits its cost evenly across those PRs.
Last modified on November 2, 2026