Skip to content

Analytics

Where to find Claude Code adoption, contribution and spend analytics for Team, Enterprise and Console customers, and how PR attribution is worked out.

Sooner or later someone in finance or leadership asks whether Claude Code is paying for itself. The analytics dashboards are the quickest answer: they show who is using it, how much code it contributes to merged pull requests, and (for API customers) what it costs. Which dashboard you get depends on how your organisation pays.

PlanWhereWhat you get
Claude for Teams or Enterpriseclaude.ai/analytics/claude-codeUsage, GitHub-backed contribution metrics, a leaderboard, CSV export
API through the Claude Consoleplatform.claude.com/claude-codeUsage, spend, per-person team insights

If you need per-user token counts or cost in your own tooling rather than a dashboard, export telemetry with OpenTelemetry. Team and Enterprise admins can also download a spend report from the organisation's analytics settings, which lists token usage and estimated usage-credit spend by user and by model.

Team and Enterprise dashboard

Admins and Owners can open it. It has four parts:

  • Usage: lines of code accepted, suggestion accept rate, daily active users and sessions.
  • Contributions: merged PRs and lines shipped with Claude Code's help, which needs the GitHub integration.
  • Leaderboard: the top contributors by Claude Code usage.
  • Export: contribution data for every user as CSV.

Turning on contribution metrics

Usage data is there from day one. Contribution metrics are in public beta and need GitHub connecting. They only count members of your claude.ai organisation, not Console API or third-party usage, and they work with both GitHub Cloud and GitHub Enterprise Server.

Warning: Organisations with zero data retention do not get contribution metrics. Their dashboard shows usage only.

You need a GitHub admin and a Claude Owner:

  1. The GitHub admin installs the Claude GitHub app on the organisation from github.com/apps/claude.
  2. The Claude Owner opens claude.ai/admin-settings/claude-code and switches on Claude Code analytics.
  3. On the same page, the Owner switches on GitHub analytics.
  4. The Owner completes the GitHub sign-in and picks which GitHub organisations to include.

Expect data within about 24 hours, then daily refreshes. Two holding messages you might see: "GitHub app required" (the app is not installed) and "Data processing in progress" (wait a few days, and check the app if nothing arrives).

The headline numbers

These figures are intentionally conservative. Only code where Claude Code's involvement is clear is counted, so treat them as a floor.

MetricMeaning
PRs with CCMerged PRs containing at least one line written with Claude Code
Lines of code with CCEffective lines in merged PRs written with Claude Code. An effective line has more than three characters after normalisation; blank lines and lines of only brackets or trivial punctuation are excluded
PRs with Claude Code (%)Share of all merged PRs containing Claude Code-assisted code
Suggestion accept rateHow often people accept Claude Code's edits through the Edit, Write and NotebookEdit tools
Lines of code acceptedLines Claude wrote that were accepted in sessions. Rejections are excluded, and later deletions are not tracked

Charts

  • Adoption: daily active users and sessions per day.
  • PRs per user: PRs merged per day divided by daily active users, plotted with the user count. Handy for watching individual throughput as adoption grows.
  • Pull requests: merged PRs per day split into with and without Claude Code. Switch to Lines of code to see the same split by lines.
  • Leaderboard: top ten users, toggled between pull requests (with Claude Code against all PRs) and lines of code. Export all users downloads every user, not just the ten shown.

How PR attribution works

When a pull request merges, Claude Code's analysis:

  1. takes the added lines from the diff;
  2. finds Claude Code sessions that edited matching files within the time window;
  3. matches PR lines against Claude Code output using several strategies;
  4. calculates assisted and total line counts.

Lines are normalised first: whitespace trimmed, runs of spaces collapsed, quotes standardised, everything lowercased. PRs with assisted lines get a claude-code-assisted label in GitHub, which means you can also query attribution straight from GitHub by searching for that label.

Rules worth knowing when you read the numbers:

  • Window: sessions from 21 days before to 2 days after the merge date count. Anything older is ignored.
  • Rewrites: code a developer changed by more than 20% is not attributed.
  • Branches: source and target branches are not considered.
  • Excluded files: lock files (package-lock.json, yarn.lock, Cargo.lock and friends), generated code such as Protobuf output and minified files, build directories (dist/, build/, node_modules/, target/), test fixtures such as snapshots, cassettes and mock data, and any line over 1,000 characters.

Using the data

What I look for when reviewing a client's dashboard after a rollout:

  • Adoption shape. A steady climb is good. A dip a week or two in usually means friction: a proxy issue, a permissions annoyance, or nobody answering questions. The champion kit helps here.
  • ROI. Compare PRs per user before and after adoption, and with versus without Claude Code. Put it next to DORA metrics or sprint velocity rather than presenting it alone.
  • Power users. The leaderboard is a ready-made list of people to ask for prompting tips, honest feedback and help onboarding colleagues.

Programmatic access

On Enterprise, the Claude Enterprise Analytics API returns per-user engagement, usage and cost reports across Claude surfaces, Claude Code included. A Primary Owner creates a key with the read:analytics scope at claude.ai/analytics/api-keys. It is not available on Teams.

Console (API) dashboard

API customers open platform.claude.com/claude-code. You need the UsageView permission, which the Developer, Billing, Admin, Owner and Primary Owner roles all have. The same daily per-user metrics are available programmatically through the Claude Code Analytics API with an Admin API key. GitHub contribution metrics are not offered here.

The dashboard shows:

  • Lines of code accepted and suggestion accept rate, defined as above.
  • Activity: daily active users and sessions.
  • Spend: daily API cost in dollars alongside user count.

The team insights table lists everyone who has authenticated to Claude Code. API key users appear by key identifier and OAuth users by email, each with spend this month and accepted lines this month.

Note: Console spend figures are estimates for analytics. Your billing page has the real costs.

Sessions routed through an LLM gateway with a gateway credential do not report usage metrics to this dashboard; see Connect Claude Code to an LLM gateway.