> For the complete documentation index, see [llms.txt](https://docs.revenium.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.revenium.io/track-and-control-costs/analyze-ai-tooling-spend/github-integration.md).

# GitHub Integration

Connecting GitHub to Revenium adds output data — shipped pull requests — to the AI Coding Dashboard. Without GitHub, the dashboard measures AI assistant activity: sessions, tokens, cost. With it, you can cross-reference that spend against what developers actually deliver, surfacing per-developer productivity metrics and attributing pull requests to AI-assisted commits.

## What connecting GitHub adds

Once connected, the Claude Code **Adoption** tab's Value by User table gains three additional columns:

| Column              | Description                                                                                                 |
| ------------------- | ----------------------------------------------------------------------------------------------------------- |
| **PRs Merged**      | Total pull requests merged by this developer in the selected period                                         |
| **PRs with Claude** | PRs where at least one commit includes a Co-Authored-By trailer matching your configured detection patterns |
| **Cost/PR**         | Total AI spend divided by PRs merged — the cost side of a basic productivity ratio                          |

These columns let you ask: are high-spend developers also shipping the most? Which developers are getting the most delivered per dollar of AI spend? Is AI adoption actually showing up as more code delivery?

## Which tools support PR data

PR attribution currently appears on the **Claude Code** tab only. The detection mechanism is pattern-based rather than tool-specific (see [AI co-author detection patterns](#ai-co-author-detection-patterns) below), so commits from any tool that includes a matching Co-Authored-By trailer are counted. However, the PR columns are only wired into the Claude Code Value by User table — Cursor, Gemini CLI, and Claude Cowork tabs do not display PR data.

## Prerequisites

* A GitHub personal access token with `repo` and `read:org` scopes, or a GitHub App installation with equivalent permissions
* Developer email addresses in Revenium must match the email addresses on their GitHub commits for per-developer attribution to work

## Setting up the integration

GitHub is managed under **Connections → Integrations** in the product, on the same tab as the [Slack](/integrations/slack.md) integration. Connect with a GitHub personal access token (or GitHub App installation) carrying the scopes listed in [Prerequisites](#prerequisites) above. The connection screen shows the last successful validation timestamp and offers a **Sync now** action; data refreshes on its natural cadence otherwise. Either integration on the tab can be reconfigured or disconnected without affecting the other.

### Connecting multiple organizations

You can connect more than one GitHub organization to a single Revenium account. Add each organization from the GitHub connect modal; each connection carries its own credential, and PR attribution is drawn from every connected organization. This suits teams whose code is split across separate GitHub organizations rather than concentrated in one.

### Choosing repositories with the repo picker

When you connect an organization, the connect modal presents a **repository picker** listing the repositories the connection can access, so you can select exactly which repositories to track instead of scanning everything. The picker refetches its list when you switch organizations, so it always reflects the repositories available in the organization you're currently configuring.

## Configuring the integration

Open the GitHub settings dialog from the integrations page to refine repository scope and detection patterns.

### Allowed repositories

You can also scope scanning to specific repositories through the **Allowed repos** field, listing them one per line in `owner/repo` format:

```
myorg/backend-api
myorg/mobile-app
```

Leave this field empty to scan all repositories available to the connection.

### AI co-author detection patterns

Revenium identifies AI-assisted commits by scanning each commit's Co-Authored-By trailer and author email for patterns you configure. A PR is attributed when **any commit** in it matches **any configured pattern**.

Patterns are specified one per line. Matching is case-insensitive substring matching on commit messages and exact matching on email addresses. Each pattern must be at least 3 characters.

The default pattern is:

```
noreply@anthropic.com
```

This matches the standard Co-Authored-By footer that Claude Code adds to commits. If your team uses additional tools or custom commit templates, add the corresponding patterns:

```
noreply@anthropic.com
cursor-ai
your-internal-bot@yourcompany.com
```

{% hint style="info" %}
Patterns are configured at the organization level and apply to all dashboards and all team members. There is no per-tool or per-team pattern configuration.
{% endhint %}

### Managing user mappings

Per-developer attribution depends on the email address on a developer's GitHub commits matching the email Revenium has on file. When those don't line up — or when someone commits under more than one address — you can adjust the mapping directly rather than leaving the attribution wrong.

* **Edit an existing mapping** to correct which Revenium user a GitHub identity resolves to.
* **Map multiple GitHub accounts to one corporate email**, so a developer who commits from more than one GitHub account still rolls up to a single person.

Consolidating accounts this way keeps per-developer metrics — PRs merged, PRs with AI assistance, and cost per PR — accurate for people who work across more than one GitHub identity.

## Team filtering and PR scope

The team filter on the Claude Code dashboard applies to AI completion metrics (sessions, tokens, cost). PR data is org-scoped: the PRs Merged and PRs with Claude columns always reflect the developer's activity across the entire organization (or across your allowed repositories list), not filtered by team. To limit PR scope to a specific team's repositories, add those repositories to the Allowed repos field.

## Troubleshooting

**No PR data appears after connecting:**

* Allow up to 15 minutes for the initial sync to complete
* Confirm the token has `repo` and `read:org` scopes
* Verify the token is valid and not expired — Revenium shows validation status on the integrations page

**Coding assistant-attributed PR count is lower than expected:**

* A PR is attributed to an AI Coding assistant only if at least one commit contains a matching Co-Authored-By trailer. This is user or organization-configurable, and not all Claude Code sessions automatically produce these — check whether commits in those PRs include the trailer
* Confirm the repositories containing the expected PRs are accessible to your token (or listed in Allowed repos)
* Inspect commit metadata in the relevant repository to confirm whether Co-Authored-By trailers appear in the commits you expected to count

**Developer PR counts are not attributed correctly:**

* The email address on the developer's GitHub commits must match the email address Revenium has on file for that user
* GitHub allows per-commit email overrides — developers using a different email for AI-assisted commits will not be matched


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.revenium.io/track-and-control-costs/analyze-ai-tooling-spend/github-integration.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
