> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agent.golf/llms.txt
> Use this file to discover all available pages before exploring further.

# How Agent Golf Counts Project Spend

> How the spend of a pull request rolls up to issues, projects, and initiatives, and why some views split it.

Agent Golf measures spend on pull requests. Each Linear item gets the spend of the pull requests that [link](https://docs.agent.golf/linear/pull-request-links.md) to it or to the items below it.

## The spend of a pull request

A pull request's spend is its inference cost plus its CI cost. This is the **Cost** on the pull request page.

* **Inference Cost**: the cost of its sessions while each session worked on this pull request. A model request that counts for more than one pull request splits evenly between them. Manual links add no cost. See [Cost of a pull request](https://docs.agent.golf/dashboard/attribution.md#cost-of-a-pull-request).
* **CI Cost**: the cost of the pull request's GitHub Actions runs. See [CI Cost](https://docs.agent.golf/dashboard/metrics.md#ci-cost).

### The period

A pull request counts in the selected period when GitHub last updated it in that period. It then brings its full spend, including the spend of sessions that ran before the period. The **Pull Requests** page uses the same rule, so a pull request that gets a new comment next month moves to next month.

Without the **View Team Activity** permission, the roadmap counts only your own sessions in the inference cost. The answer then reads "Your project spend was …".

## The roll-up

Spend rolls up along the Linear hierarchy:

* An issue counts the pull requests that link to it and to its sub-issues.
* A project counts the pull requests of its issues.
* An initiative counts the pull requests of its projects and its sub-initiatives.

Pull request 1 costs 300 dollars and links issue PLAT-1 in the project Search and issue PLAT-7 in the project Billing. Pull request 2 costs 100 dollars and links issue PLAT-2 in Search. Pull request 3 costs 50 dollars and links no issue. Search counts 400 dollars, Billing counts 300 dollars, and the initiative Growth above both counts 400 dollars.

Pull request #1 links issues in two projects. Each project counts it in full, so the project rows add up to $700.
The initiative counts each pull request once: $400. Pull request #3 links no issue, so it is unplanned.

Each item counts a pull request once, even when the pull request links to several of the item's issues.

A milestone is not a step of the roll-up. See [Milestone spend](#milestone-spend).

## Why the rows can add up to more than the total

A table row shows the full spend of each of the item's pull requests, so a pull request in two projects shows in full in both rows. The **All Projects** rows can then add up to more than **Project Spend**. In the example, the rows add up to $700, and the project spend is $400.

The same is true for **Initiatives**: a pull request in two initiatives counts in both. "Shares can add up to more than 100% when a pull request is in more than one initiative."

An initiative's page names the difference. For example: "The projects add up to $700. 1 pull request is in more than one project, so this initiative counts it once: $400." Select **Show Shared Pull Requests** to see them.

## Split views

Three views show how the spend divides. In these views, a pull request in more than one item gives each item an equal part of its spend. So the parts add up to the total, and an amount can be lower than in the tables.

### Spend by Initiative

**Spend by Initiative** on the roadmap splits the period's spend:

* A pull request in N top-level initiatives gives each initiative 1/N of its spend. Inside an initiative, the pull request's projects split that part the same way.
* **No Initiative** holds the spend of pull requests that reach a project, but no initiative.
* **Unplanned** holds the [unplanned spend](#unplanned-spend).

The initiatives, **No Initiative**, and **Unplanned** add up to the period's spend.

### Spend by priority

**Spend by Priority** splits the spend by each project's Linear priority: **Urgent**, **High**, **Medium**, **Low**, and **No Priority**. A pull request in N projects gives each project 1/N, under that project's priority. A project without a priority counts under **No Priority**. **Unplanned** shows apart. The priorities and **Unplanned** add up to the period's spend.

### Milestone spend

On a project page, each milestone shows its spend. A pull request counts for the project's milestones whose issues it links to directly. A pull request in N milestones of the project gives each 1/N of its spend. Milestones of other projects do not change this part. A pull request counts once in each milestone.

The milestones do not always add up to the project. A pull request of an issue with no milestone counts in no milestone. An issue row shows the full spend of its pull requests.

### Example

The numbers of the diagram above:

| View | Values | Sum |
| - | - | - |
| Answer | Project spend $400 (89%). Unplanned spend $50. | \$450 |
| **All Projects** rows | Search $400, Billing $300 | $700, more than $400 |
| **Spend by Initiative** | Growth $400 (Search $250, Billing $150), Unplanned $50 | \$450 |
| **Spend by Priority** | High $250, Medium $150, Unplanned \$50 | \$450 |

Pull request #1 gives \$150 to each of its two projects in the split views.

## Unplanned spend

A pull request is unplanned when it reaches no project and no initiative. For example:

* It links to no Linear issue.
* It links only to issues with no project.
* Its issue is archived, or Agent Golf did not import it.

**Unplanned Spend** is the spend of the unplanned pull requests, plus the spend with no pull request. The spend with no pull request has two parts:

* The requests in the period of the sessions that link to no pull request.
* The CI runs with no pull request that finished in the period.

The roadmap, the **Project Spend** card of the Dashboard and the Team page, and the `get_roadmap` MCP tool show the same amount. On each of them, the project share is a share of the period spend: the pull requests updated in the period, plus the spend with no pull request.

**Linked Pull Requests** counts the pull requests of active contributors in the period that link to at least one Linear item on your roadmap. An active contributor is a user with a linked GitHub account and a session in the period, so pull requests of bots such as Renovate do not count. An archived item does not count. A pull request that links only to an issue with no project is linked, but unplanned.

## Progress

The progress of an item is "N of M" issues done. It counts each issue below the item once, with its sub-issues. It does not count canceled or archived issues. Progress does not depend on the period.

## Spend of a user

The **Priority Mix** on the **Team** page and the **Projects** section of a user page count one user's spend with other rules. See [Priority Mix](https://docs.agent.golf/linear/dashboard-and-team.md#priority-mix).

## Budgets

A budget sets an amount of spend for an initiative or a project. A budget counts spend by the UTC month in which it happened, not by the period of the pull request. See [Project Budgets](https://docs.agent.golf/linear/project-budgets.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.