Beta
Start for free

ResourcesExplainer

Claude Code analytics explained: What it measures and how to read it

Claude Code analytics shows how much your organization uses Claude Code and how much it contributes to merged pull requests. What you see depends on how you access Claude Code: Claude for Teams and Claude for Enterprise get contribution metrics through GitHub, while the API (Claude Console) shows daily spend.

To read the numbers correctly, you need to know how contribution is counted and that every cost figure is an estimate. I opened Claude Code's /usage 26 times to check how close I was to my usage limits and rate limits, not what I'd spent. Below, we'll cover the 2 analytics dashboards, how contribution metrics are calculated, which usage isn't covered, how to read the cost figures, and how to get per-user numbers.

What's in this article?

Start with what the dashboards show, then learn how to read the contribution and cost numbers and how to pull per-user data.

What does Claude Code analytics show?

Claude Code analytics is Anthropic's set of dashboards for tracking how an organization uses Claude Code. It reports adoption and contribution to pull requests by organization, user, day, and merged pull request. According to the analytics documentation, which dashboard you get depends on how you access Claude Code.

AccessWho can view itWhat it shows
Claude for Teams or Claude for EnterpriseAdmins and OwnersLines of code accepted, suggestion accept rate, daily active users and sessions, contribution metrics through GitHub, a leaderboard, and CSV export
API (Claude Console)Roles with the UsageView permissionLines of code accepted, suggestion accept rate, daily active users and sessions, daily spend, and per-user spend and lines this month

The Claude for Teams and Claude for Enterprise dashboard also charts trends: daily active users and sessions (Adoption), pull requests merged per day divided by daily active users (PRs per user), and pull requests merged per day split by whether Claude Code was involved (Pull requests). Lines of code accepted counts lines users accepted during their sessions and doesn't track later deletions.

How are contribution metrics calculated?

Contribution metrics match the diff of each merged pull request against Claude Code session activity. They're a public beta feature: a GitHub admin installs the Claude GitHub app on your organization's GitHub account, and a Claude Owner turns the feature on in settings.

When a pull request merges, the calculation runs in this order.

  1. Extract added lines from the pull request diff. Auto-generated files such as lock files, generated code, build directories, and test fixtures are excluded.
  2. Find Claude Code sessions that edited the same files. Sessions from 21 days before to 2 days after the merge are considered1.
  3. Normalize, then match. Whitespace, quotes, and letter case are normalized, and pull request lines are matched against Claude Code output using several strategies.
  4. Total AI-assisted lines and all lines. Merged pull requests that contain lines written with Claude Code get a claude-code-assisted label in GitHub.

Lines that developers rewrote by more than 20% aren't attributed to Claude Code1, and matching doesn't consider the pull request's source or destination branch. The documentation describes these metrics as deliberately conservative, an underestimate that counts only lines and pull requests where Claude Code's involvement is clear.

  1. Anthropic, Claude Code documentation, "Track team usage with analytics" (2026; retrieved September 30, 2026). ↩↩

Which usage isn't covered?

Contribution metrics cover only users in your claude.ai organization on the Team or Enterprise plan. They don't include usage through the Claude Console API or third-party integrations.

Organizations with Zero Data Retention (ZDR) enabled can't use contribution metrics, so their dashboard shows usage metrics only. The Console dashboard for API customers doesn't offer contribution metrics either at this time. Usage through Amazon Bedrock, Google Cloud's Agent Platform, or Microsoft Foundry isn't covered by the dashboards or the Claude Code Analytics API, because Claude Code doesn't send metrics from your cloud back to Anthropic (cost documentation).

How should you read the cost figures?

None of the cost figures from Claude Code or its analytics is an invoice amount. Read them in 3 groups, depending on where they appear.

  • Claude Code's /usage and telemetry: Claude Code calculates these from token counts at list price. Setting modelPricing in managed settings applies your contracted rates, but the figures remain estimates, not an invoice (cost documentation).
  • The Console dashboard: The dashboard for API customers shows daily and per-user spend. The documentation calls these figures estimates for analytics purposes and points you to your billing page for actual costs (analytics documentation).
  • The Claude for Teams and Claude for Enterprise dashboard: The documentation doesn't list cost among the dashboard's contents. For estimated spend per user and per model, export the spend report from your organization's analytics settings (analytics documentation). The spend report covers usage-credit spend, and usage inside the seat allowance isn't metered in dollars (cost documentation).

In my own setup, every cost display on my machine showed zero or nothing. A cost-logging hook I'd installed recorded 2,352 rows, and every amount was zero. The Stats tab of /usage (/stats) also showed zero cost, and the token compression tool I was running couldn't look up prices for newer models, so it showed no amount at all. A zero or a blank tells you little until you check where the figure appears and how it's calculated.

Our docs page on how to distribute with managed settings covers distributing settings like modelPricing.

How do you get per-user numbers?

Pull per-user numbers with the API or export that matches how you access Claude Code. The analytics documentation and the cost documentation list these options.

  • Enterprise plan: The Claude Enterprise Analytics API returns per-user usage and cost across Claude surfaces, including Claude Code. It isn't available on the Team plan.
  • Team and Enterprise: Export the spend report CSV from your organization's analytics settings. It lists token usage and estimated spend per user and per model.
  • Console: The Claude Code Analytics API returns the same daily per-user metrics as the dashboard. It requires an Admin API key.
  • Contribution data: Search GitHub for pull requests labeled claude-code-assisted.

The cost documentation describes OpenTelemetry export as working on every setup and as the only option that streams per-user token and cost metrics into your own observability stack in near real time. OTEL_METRICS_INCLUDE_REPOSITORY, which adds repository attributes to telemetry, is off by default and requires Claude Code v2.1.269 or later (monitoring documentation)2. I hadn't configured Claude Code's OpenTelemetry export. Our docs page on how to configure Claude Code covers sending telemetry to Harnessforce.

  1. Anthropic, Claude Code documentation, "Monitoring" (2026; retrieved September 30, 2026). ↩

How can Harnessforce help?

Claude Code analytics answers questions about adoption and contribution by organization, user, and merged pull request. None of the displays I relied on told me how much I'd spent on which issue or pull request. Harnessforce looks at the same AI runs issue by issue, answering how many times AI ran on each issue, what it cost, and how CI and review went.

Harnessforce can help you:

  • Follow every issue: For each issue, see how many times AI ran, what it did, what it cost, and how CI and review went, then inspect traces, logs, and metrics.
  • See it on the issue: The issue page brings together linked pull requests and runs, and their history.
  • Roll up runs by issue: Total run counts and cost by issue on the Sessions page.
  • Link runs to pull requests: Harnessforce links runs to issues and pull requests and puts CI and review results next to them. Inferred links are labeled as inferred.
  • Work alongside your tools: Harnessforce doesn't replace the tools you already use; it runs alongside them.

Learn more on the Read the history page, talk to us.


This article was written with AI assistance and reviewed by the author.