Claude Code Analytics: How to Measure Adoption, Cost, and ROI
To measure Claude Code ROI, connect its usage and costs to completed work, then check review effort and downstream quality. Sessions and accepted edits show activity. They do not establish how much useful work reached production or whether Claude Code caused an improvement.
This guide explains which first-party data sources to evaluate and how to build a defensible pilot. Product documentation was reviewed on September 22, 2026.
What Claude Code analytics can tell you
Anthropic provides different analytics surfaces for different account types. Confirm the team's deployment and plan before selecting an integration.
Scroll horizontally if needed →
| Source | Available evidence | Important boundary |
|---|---|---|
| Team and Enterprise dashboard | Adoption, accepted edits, and GitHub contribution metrics | Contribution metrics require setup, are in public beta, and exclude Console API usage and organizations with Zero Data Retention enabled. |
| Claude Console dashboard | Usage and estimated API spending | It does not include the Team and Enterprise GitHub contribution integration. |
The distinction between acceptance and contribution matters: accepted lines are session activity, while contribution reporting matches Claude Code activity to merged GitHub work. Accepted lines do not track later deletions. See Anthropic's analytics documentation.
For programmatic reporting, Anthropic separates the Claude Code Analytics API for Claude Platform organizations from the Claude Enterprise Analytics API for Enterprise organizations. They use different credentials and cover different data. Verify the correct source in the analytics API overview.
The Claude Code Analytics API supplies daily user records with sessions, code changes, tool decisions, token consumption, and model-level cost estimates. A daily record helps allocate activity to a person and period; it should not be treated as a direct receipt for an individual merged PR.
For finer operational visibility, Claude Code supports OpenTelemetry exports for usage, costs, and tool activity. Collection must be configured, and the exported fields and privacy settings need review. Telemetry is useful for diagnosing usage patterns, but it is not a substitute for the billing ledger or source-control record. See the monitoring guide.
Calculate spending before calculating return
Maintain two views of cost:
- Actual expense: subscription charges and additional usage billed for the measurement period, adjusted for credits and contractual terms.
- Usage allocation: token or model estimates used to distribute that expense across developers, repositories, or workflows.
Do not add an API-price estimate for subscription-included usage to the full subscription invoice. That would count the same economic input twice. Likewise, a token estimate should not be described as realized cash savings unless the billed expense actually changed.
Choose a consistent allocation rule for shared or subscription costs and disclose it. If repository attribution is unavailable, report cost at the team level instead of distributing it with false precision. Preserve an unallocated category for activity that cannot be matched.
For example, suppose a team incurred $1,200 in AI expenses during a month and merged 60 eligible PRs. Its team-level AI cost per merged PR is $20. This is an illustrative efficiency ratio, not a claim that every PR used Claude Code, that each PR cost $20, or that the team earned a financial return.
Connect usage to merged work and quality
Start with a stable identity mapping between the AI account and the source-control author. Then record the repository, associated commits, PR identifier, merge date, and attribution method. Distinguish direct contribution evidence from a developer using Claude Code during the same week.
Keep these stages separate:
Scroll horizontally if needed →
| Stage | Question to answer |
|---|---|
| AI interaction | Did the developer use Claude Code? |
| Accepted edit | Did the developer keep a suggestion at that moment? |
| Merged work | Did the relevant change pass review and enter the codebase? |
| Delivered outcome | Did it ship successfully and avoid substantial rework? |
One PR can include human work and several AI tools. Count the PR once in the output denominator and label overlapping tool attribution rather than claiming the entire result for each tool.
Pair output with review effort, reversions, follow-up fixes, and production incidents over a defined observation window. Compare similar work types and report sample size. A higher PR count can reflect smaller changes; a shorter review duration can reflect simpler tasks. Neither observation alone proves a productivity gain.
Our AI ROI measurement methodology explains how to keep cost, attribution, output, and quality definitions consistent.
Run a pilot that answers a real decision
- Choose the decision. For example, decide whether to expand Claude Code to another team or change a model policy.
- Establish a baseline. Record comparable work before the change. If feasible, use a staggered rollout and a similar comparison group.
- Validate coverage. Reconcile a sample of users, costs, and PRs against the original systems. Record missing accounts and unmatched activity.
- Observe delivery and quality. Use the same inclusion rules before and after adoption, allowing enough time for reviews and follow-up defects.
- Explain alternative causes. Account for staffing, project mix, release schedules, and other tooling changes. Present observational findings as associations.
Share the purpose and reporting access with developers. Use the results to improve tooling and workflows; prompt volume and accepted lines should not become individual performance targets.
Where Weave fits
Token Intelligence focuses on AI usage and spending, while Code Intelligence examines engineering output and code signals. Evaluate them together when the decision spans Claude Code and other coding tools.
During a trial, ask Weave to trace a representative expense through its attribution method to reviewed work. Confirm coverage for your account type, source-control setup, and required history. A useful answer makes both the supported connection and any missing evidence visible.
Make AI Engineering Simple
Effortless charts, clear scope, easy code review, and team analysis