Track team usage with analytics - Claude Code Docs
Documentation Index Fetch the complete documentation index at: /docs/llms.txt Use this file to discover all available pages before exploring further. Skip to main content Assistant Responses are generated using AI and may contain mistakes. Claude Code provides analytics dashboards to help organizations understand developer usage patterns, track contribution metrics, and measure how Claude Code impacts engineering velocity.
Access the dashboard for your plan: Plan Dashboard URL Includes Read more Claude for Teams / Enterprise claude.ai/analytics/claude-code Usage metrics, contribution metrics with GitHub integration, leaderboard, data export Details API (Claude Console) platform.claude.com/claude-code Usage metrics, spend tracking, team insights Details Code Review has its own dashboard. For review activity and spend, see View usage . Access analytics for Team and Enterprise Navigate to claude.ai/analytics/claude-code .
Admins and Owners can view the dashboard. The Team and Enterprise dashboard includes: Usage metrics : lines of code accepted, suggestion accept rate, daily active users and sessions Contribution metrics : PRs and lines of code shipped with Claude Code assistance, with GitHub integration Leaderboard : top contributors ranked by Claude Code usage Data export : download contribution data as CSV for custom reporting For per-user token counts and cost estimates, configure OpenTelemetry export , or export the spend report from your organization’s analytics settings, which lists token usage and estimated usage-credit spend per user and per model.
Enable contribution metrics Contribution metrics are in public beta and available on Claude for Teams and Claude for Enterprise plans. These metrics only cover users within your claude.ai organization. Usage through the Claude Console API or third-party integrations is not included. Usage and adoption data is available for all Claude for Teams and Claude for Enterprise accounts. Contribution metrics require additional setup to connect your GitHub organization.
You need the Owner role to configure analytics settings. A GitHub admin must install the GitHub app. Contribution metrics are not available for organizations with Zero Data Retention enabled. The analytics dashboard will show usage metrics only. 1 Install the GitHub app A GitHub admin installs the Claude GitHub app on your organization’s GitHub account at github.com/apps/claude . 2 Enable Claude Code analytics A Claude Owner navigates to claude.ai/admin-settings/claude-code and enables the Claude Code analytics feature.
3 Enable GitHub analytics On the same page, enable the “GitHub analytics” toggle. 4 Authenticate with GitHub Complete the GitHub authentication flow and select which GitHub organizations to include in the analysis. Data typically appears within 24 hours after enabling, with daily updates. If no data appears, you may see one of these messages: “GitHub app required” : install the GitHub app to view contribution metrics “Data processing in progress” : check back in a few days and confirm the GitHub app is installed if data doesn’t appear Contribution metrics cover repositories hosted on github.com.
For repositories on GitHub Enterprise Server , the analytics dashboard shows usage metrics only. Review summary metrics These metrics are deliberately conservative and represent an underestimate of Claude Code’s actual impact. Only lines and PRs where there is high confidence in Claude Code’s involvement are counted. The dashboard displays these summary metrics: PRs with Claude Code : merged pull requests that contain at least one line of code written with Claude Code.
One card shows the count, and one shows the share of all merged PRs LOC with Claude Code : total lines of code (LOC) across all merged PRs that were written with Claude Code assistance. Only “effective lines” are counted: lines with more than 3 characters after normalization. Suggestion accept rate : percentage of times users accept Claude Code’s code editing suggestions, including Edit, Write, and NotebookEdit tool usage Lines of code accepted : total lines of code that Claude Code’s Edit and Write tools added or removed in accepted edits.
This excludes rejected suggestions, and lines deleted later don’t reduce the total. Explore the charts The dashboard includes several charts to visualize trends over time. Measure PRs per user Total PRs per user is the number of PRs merged per day divided by daily active users. Use this to understand how individual productivity changes as Claude Code adoption increases. View pull requests breakdown The PRs with Claude Code chart compares each day’s merged PRs with Claude Code to All PRs .
Toggle to Lines of code view to see the same breakdown by lines of code rather than PR count. Find top contributors The Leaderboard shows the top 10 users ranked by contribution volume. Toggle between: Pull requests : shows PRs with Claude Code vs All PRs for each user Lines of code : shows lines with Claude Code vs All lines for each user Click Export all users to download complete contribution data for all users as a CSV file.
The export includes all users, not just the top 10 displayed. PR attribution When contribution metrics are enabled, Claude Code analyzes merged pull requests to determine which code was written with Claude Code assistance. This is done by matching Claude Code session activity against the code in each PR. Attribution process When a pull request is merged: Added lines are extracted from the PR diff Claude Code sessions that edited matching files within a time window are identified PR lines are matched against Claude Code output using multiple strategies Metrics are calculated for AI-assisted lines and total lines Before comparison, lines are normalized: whitespace is trimmed, multiple spaces are collapsed, quotes are standardized, and text is converted to lowercase.
Merged pull requests containing Claude Code-assisted lines are labeled as claude-code-assisted in GitHub. Time window Sessions from 21 days before to 2 days after the PR merge date are considered for attribution matching. Excluded files Certain files are automatically excluded from analysis because they are auto-generated: Lock files: package-lock.json, yarn.lock, Cargo.lock, and similar Generated code: Protobuf outputs, build artifacts, minified files Build directories: dist/, build/, node_modules/, target/ Test fixtures: snapshots, cassettes, mock data Lines over 1,000 characters, which are likely minified or generated Attribution notes Keep these additional details in mind when interpreting attribution data: Code substantially rewritten by developers, with more than 20% difference, is not attributed to Claude Code Sessions outside the 21-day window are not considered The algorithm does not consider the PR source or destination branch when performing attribution Get the most from analytics Use contribution metrics to demonstrate ROI, identify adoption patterns, and find team members who can help others get started.
Monitor adoption Track the Users and Sessions charts to identify: Active users who can share best practices Overall adoption trends across your organization Dips in usage that may indicate friction or issues Measure ROI Contribution metrics help answer “Is this tool worth the investment?” with data from your own codebase: Track changes in PRs per user over time as adoption increases Compare PRs and lines of code shipped with Claude Code to all PRs and lines of code Use alongside DORA metrics , sprint velocity, or other engineering KPIs to understand changes from adopting Claude Code Identify power users The Leaderboard helps you find team members with high Claude Code adoption who can: Share prompting techniques and workflows with the team Provide feedback on what’s working well Help onboard new users Access data programmatically On the Enterprise plan, the Claude Enterprise Analytics API returns per-user engageme
The rest of this page is on the live site.