Skip to main content
Back to blog
AI & MCP

How to track Claude Code usage across your team

Nolan Sullivan

Nolan Sullivan

Published · 19 min read

How to track Claude Code usage across your team

TL;DR

Claude Code usage tracking for a team means tokens, cost, sessions, and active users attributed to named people and directory roles, in one view with the other AI clients you pay for. The Speakeasy AI Control Plane gives you that view without running your own telemetry backend: Claude Code sends its OpenTelemetry data to Speakeasy through Claude's managed settings, SCIM directory sync keeps roles in step with your identity provider, and the Costs page shows Claude Code, Cursor, and Codex spend by role and by employee. Claude Code cost figures are client-reported estimates rather than invoice amounts.

Claude Code usage tracking starts with Anthropic's own tools: an analytics dashboard, a spend report, and an OpenTelemetry export. To track Claude Code for a team, send each session's telemetry to one place, tie each session to a person in your directory, and read cost by role next to the other AI clients you pay for. The Speakeasy AI Control Plane does all three in one product.

Most Claude Code usage trackers and monitors are built for one developer. ccusage reads the usage data on a single machine, and Claude Code's /usage command shows token usage for the current session. Both answer "am I near my limit?" The platform lead who owns the AI tooling budget is asking something else: who is spending what, in which role, across Claude Code, Cursor, and Codex.

This post covers what team-level tracking measures, where per-developer trackers and Anthropic's analytics stop, and then walks through the setup in the Speakeasy AI Control Plane. Each step links to the docs for the full reference.

What does Claude Code usage tracking cover for a team?

Team-level tracking needs five measures:

  • Tokens. Input and output tokens per session and model. Claude Code exports them, with session cost, as OpenTelemetry metrics (claude_code.token.usage and claude_code.cost.usage).
  • Cost. By default, Claude Code calculates it at list API prices and includes it in the telemetry it emits.
  • Sessions. The denominator for cost per session.
  • Active users. Members with any token usage in the period, against the total member count, which gives the adoption rate.
  • Model and client. Which models answered, and which AI clients, such as Claude Code, Codex, and Cursor, generated the usage.

Three dimensions make those measures useful to a manager:

  • Person. A spike has an owner you can ask.
  • Directory role. Spend reads by team or department instead of by email address.
  • Client. Claude Code sits next to the other tools on the same budget.

For a sense of scale, Anthropic's docs put the average Claude Code cost across enterprise deployments at around $13 per developer per active day and $150 to $250 per developer per month, with costs below $30 per active day for 90% of users. The same page advises starting with a small pilot group to establish a baseline before a wider rollout, and a team tracker produces that baseline.

Claude Code's cost figures in this post are estimates rather than lines on an invoice. Where this setup stops explains why.

Aren't per-developer trackers enough?

For a single developer, they are. ccusage reads local usage data from coding agent CLIs, including Claude Code, Codex, and OpenCode, and turns it into daily, weekly, monthly, and session reports. It runs with one command, npx ccusage@latest.

Inside Claude Code, the Session block of /usage shows detailed token usage for the current session. Anthropic notes that this block is meant for API users, and that for Pro, Max, and Ultra subscribers the session cost figure isn't relevant for billing.

A team needs three more things:

  • Aggregation. Each tracker reads one machine or one session. Comparing ccusage totals with the license bill means collecting them from each laptop by hand.
  • Identity. A laptop's totals don't say who the developer is in your directory, which team they sit on, or whether they've changed teams since last month.
  • Other clients. ccusage covers several CLIs, including Codex, but not Cursor, and only on the machine it runs on. Cursor seats and Codex usage land on different bills, and a manager wants them in one view.

On flat-fee plans, the API-equivalent cost a tracker shows can be higher than what the company pays, because usage inside the subscription isn't billed per token. On Teams and Enterprise plans, the extra spend is usage past the seat allowance, and spotting it needs a team view.

How does Anthropic track Claude Code usage for teams?

Anthropic offers several first-party ways to monitor Claude Code usage across an organization, and they're the natural place to start if your AI spend is mostly Claude.

  • Analytics dashboard (Teams and Enterprise). At claude.ai/analytics/claude-code, Admins and Owners see usage metrics (lines of code accepted, suggestion accept rate, daily active users, and sessions), contribution metrics with a GitHub integration, a leaderboard, and a data export. For per-user token counts and cost estimates, Anthropic's docs point to OpenTelemetry export or the spend report rather than the dashboard itself.
  • Spend report. The spend report in org analytics shows estimated spend per user and per model, with CSV export, updated daily. It covers usage-credit spend and appears once usage credits are turned on. Usage inside the seat allowance isn't metered in dollars. Admins can also set spend limits at the organization, group, or individual member level.
  • Enterprise Analytics API. On the Enterprise plan, this API returns per-user usage and cost reports across Claude surfaces, including Claude Code.
  • Claude Console dashboard (API customers). At platform.claude.com/claude-code, a team insights table shows per-user Spend, which Anthropic labels an estimate for analytics purposes. The Claude Code Analytics API returns daily per-user metrics with an Admin API key.
  • OpenTelemetry export. Claude Code can export telemetry through OpenTelemetry to track usage, costs, and tool activity, and administrators can set it for all users through managed settings. The OTEL_RESOURCE_ATTRIBUTES variable adds custom attributes such as department=engineering,team.id=platform,cost_center=eng-123 to every metric and event, so you can filter by team and track cost per cost center. Anthropic describes OpenTelemetry as the only option that streams per-user token and cost metrics into your own observability stack in near real time.

Three things fall outside these tools' scope:

  • Other clients. The dashboards, spend report, and analytics APIs report on Claude surfaces, so Cursor and Codex spend sits somewhere else.
  • Running the backend. OpenTelemetry streams the data into your own stack, which means running the collector and backend yourself, starting from the Docker Compose, Prometheus, and OpenTelemetry setups in Anthropic's monitoring guide.
  • Directory changes. Team attributes such as department and cost_center are values written into configuration, so they change when someone edits that configuration rather than when your directory changes. Anthropic's Claude apps gateway can stamp identity provider group membership onto exports as user.groups, but it's built for Amazon Bedrock, Claude Platform on AWS, Google Cloud, Microsoft Foundry, and API deployments. Its sign-in takes the place of a Teams or Enterprise login.

Anthropic's tools may be all you need if every AI tool your company pays for is a Claude product, you already run an observability backend, and team attributes kept in configuration are enough for your reporting.

If any of those don't hold, the Speakeasy AI Control Plane covers each gap. Cursor and Codex spend arrive through provider integrations and appear on the same Costs page as Claude Code. Claude Code sends its telemetry to a Speakeasy endpoint, so there's no collector or backend to run. And SCIM directory sync maps groups and attributes such as department to roles that follow your identity provider as people move teams.

How to track Claude Code usage across your team in Speakeasy

Most of the steps below happen in the Speakeasy dashboard at ai.speakeasy.com. Step 4 happens in Claude's admin settings, and step 8 starts in Cursor and OpenAI. Steps 1 to 5 get Claude Code telemetry flowing, step 6 ties it to your directory, and step 7 reads the result. Steps 8 and 9 are optional.

How usage data reaches the Costs pageThree sources send usage to the Speakeasy AI Control Plane. Claude Code: managed settings push the observability plugin and its OpenTelemetry settings, and it sends tokens and cost per session. Cursor, optional: usage and spend through the Cursor Admin API, split out by client. Codex, optional: usage and spend through OpenAI Compliance Logs, split out by client. Directory sync over SCIM brings in groups and department attributes, which map to roles. The AI Control Plane ties each Claude Code session to a person and each person to their roles, and the Costs page shows usage by role, by employee, and by client.TEAM USAGE TRACKINGHow usage data reaches the Costs pageSTEP 4Claude CodeManaged settings push theobservability plugin and itsOpenTelemetry settings.Sends tokens and cost per session.STEP 8 · OPTIONALCursorUsage and spend through the CursorAdmin API, split out by client.STEP 8 · OPTIONALCodexUsage and spend through OpenAICompliance Logs, split out by client.STEP 6 · IDENTITY PROVIDERDirectory sync (SCIM)Groups and departmentattributes map to roles.ATTRIBUTIONSpeakeasy AI Control PlaneTies each Claude Code sessionto a person, and each personto their roles.STEP 7Costs pageBy roleBy employeeBy clientHow usage data reaches the Costs pageThree sources send usage to the Speakeasy AI Control Plane. Claude Code: managed settings push the observability plugin and its OpenTelemetry settings, and it sends tokens and cost per session. Cursor, optional: usage and spend through the Cursor Admin API, split out by client. Codex, optional: usage and spend through OpenAI Compliance Logs, split out by client. Directory sync over SCIM brings in groups and department attributes, which map to roles. The AI Control Plane ties each Claude Code session to a person and each person to their roles, and the Costs page shows usage by role, by employee, and by client.TEAM USAGE TRACKINGHow usage data reachesthe Costs pageSTEP 4Claude CodeManaged settings push the observabilityplugin and its OpenTelemetry settings.Sends tokens and cost per session.STEP 8 · OPTIONALCursorUsage and spend through the CursorAdmin API, split out by client.STEP 8 · OPTIONALCodexUsage and spend through OpenAICompliance Logs, split out by client.STEP 6 · IDENTITY PROVIDERDirectory sync (SCIM)Groups and departmentattributes map to roles.ATTRIBUTIONSpeakeasy AI Control PlaneTies each Claude Code sessionto a person, and each personto their roles.STEP 7Costs pageBy roleBy employeeBy client

Before you start

  • Speakeasy admin. The Organization setup board and the Observability pages need the org:admin scope, as does changing the logging settings. The default Admin role holds it and the Member role doesn't.
  • Claude plan and role. Claude offers server-managed settings, set in its admin console, on Teams and Enterprise plans only. Seeing and editing them takes the Owner or Primary Owner role in the Claude organization.
  • Identity provider. Step 6 uses SCIM directory sync from your identity provider. Single sign-on and directory sync depend on the Speakeasy organization's plan.
  • Other providers (optional). Step 8 needs someone who can create a read-only Cursor Admin API key, and an OpenAI API key with access to compliance logs.

Step 1: Turn on logging

In the Speakeasy dashboard, open the Organization setup board from Finish organization setup at the bottom of the organization sidebar. Its Enable logging step turns on Enable Logs, Record Tool I/O, and Agent Session Capture at once. The same switches live under Organization settings > Settings > Logging & Telemetry. Costs and Agent Sessions need Agent Session Capture, which captures user prompts and assistant responses from supported coding agents.

Record Tool I/O stores the inputs and outputs of tool calls. Stored payloads may expose sensitive data, so enable it deliberately.

Tool logs and agent sessions are kept for 90 days and then age out automatically.

Step 2: Publish the plugin marketplace

On the same board, complete the Publish plugin marketplace step. It runs once per project and publishes a private GitHub repository that acts as the team's plugin marketplace for Claude Code, Cursor, and Codex. It ships with the core observability plugin, which collects usage metrics and enforces authorization, and plugins you build later publish to the same repository.

Step 3: Create a Hooks API key

Open Organization settings > Settings > API Keys, create a new API key with the Hooks scope, and copy it. Step 4 uses it, and the same key also works for Claude Cowork if you instrument it later.

Step 4: Push the observability plugin to Claude Code with managed settings

This step follows Speakeasy's Anthropic plugin docs and uses the same managed settings Anthropic documents for configuring OpenTelemetry, so it reaches Claude Code across your Claude organization without anyone editing a file on their laptop.

First, collect the values. Plugins sit under the Model Context Protocol (MCP) gateway: open MCP Gateway > Plugins, then open the Install menu on the Observability card, choose GitHub installation (preferred), then Claude Code. The Install instructions sheet shows the values for <marketplace-name>, <marketplace-git-url>, and <org>.

Then switch to Claude. In your Claude organization's admin settings on claude.ai, open the Claude Code tab (claude.ai/admin-settings/claude-code), scroll to Managed settings, and select Manage. Merge this JSON into the dialog, replacing the placeholders with the values from the sheet and <MY_KEY> with the Hooks key from step 3:

{
  "extraKnownMarketplaces": {
    "<marketplace-name>": {
      "source": {
        "source": "git",
        "url": "<marketplace-git-url>"
      },
      "autoUpdate": true
    }
  },
  "enabledPlugins": {
    "<org>-observability@<marketplace-name>": true
  },
  "env": {
    "CLAUDE_CODE_ENABLE_TELEMETRY": "1",
    "FORCE_AUTOUPDATE_PLUGINS": "1",
    "OTEL_EXPORTER_OTLP_ENDPOINT": "https://ai.speakeasy.com/rpc/hooks.otel",
    "OTEL_EXPORTER_OTLP_HEADERS": "Speakeasy-AI-Project=default,Speakeasy-AI-Key=<MY_KEY>",
    "OTEL_EXPORTER_OTLP_PROTOCOL": "http/json",
    "OTEL_LOGS_EXPORTER": "otlp",
    "OTEL_METRICS_EXPORTER": "otlp"
  }
}

Two details catch people out:

  • Use the exact marketplace name. The extraKnownMarketplaces key and the @ suffix in enabledPlugins must both be the marketplace name shown in Speakeasy, not the GitHub repository name. On a mismatch, Claude Code skips auto-update or the plugin without an error.
  • Expect a trust prompt. Claude treats the OpenTelemetry exporter endpoint as sensitive, so everyone in the Claude org sees a security approval prompt in their next interactive session, at the next start or within an hour in a running session. If a developer rejects the settings, Claude Code exits. Tell developers before you save.

The env block ties sessions to people: Speakeasy uses Claude's OpenTelemetry exporter to associate Claude sessions with users, and the same telemetry powers the cost and token metrics. Without it, Speakeasy has no way to know who ran which session.

Step 5: Confirm telemetry is flowing

Restart Claude Code and confirm the plugin appears under /plugin → Installed (you may need to scroll). Then run any tool call, either through an MCP server or by asking Claude to run echo hi there. Back in Speakeasy, open Observability > Tool Logs, and the call should appear right away. For a local tool call, set the Type filter to include local tools.

Step 6: Sync your directory so usage maps to roles

Telemetry now names a person, and directory sync gives that person a role. Directory sync uses SCIM: the identity provider pushes users, groups, group memberships, and profile attributes such as department and job title, and the platform applies each change automatically. Single sign-on works with SAML 2.0 providers such as Okta, Entra ID, and Google Workspace, and with any OpenID Connect provider.

Connect your identity provider under Organization settings > Team > IDP and SSO. Once the directory is connected, select Configure role mappings on the same IDP and SSO page:

  • Map a group. Find the group, select Assign role, and pick a role. Each group maps to one role.
  • Map an attribute value. Select Map by attribute, pick an attribute such as department_name, a value, and a role. Use this when groups don't match the split you want to report on, such as one role for a whole department.

Mapping each department_name value to its own role gives every department a row in the role table in step 7.

Roles then follow the directory: when a person joins or leaves a group, they gain or lose that group's role as soon as the change syncs, and deprovisioning someone in the identity provider ends their membership and role assignments right away.

People who use AI tools before they have a member account still appear on Identities by the email address their tools report, and their earlier activity links to their account once they're provisioned and sign in.

Step 7: Read usage and cost by role and employee

Open Observability > Costs, the page introduced with AI Cost Control. Headline metrics for the period show Total Tokens with the session count, Total Cost, Active Users against the member count, and the number of AI Clients. Charts below them split spend by client and requests by model, and the Most costly sessions and Top spenders panels show where spend concentrates.

Two tables answer the team question:

  • The role table shows, per role: users, total cost with its share of spend, average cost per user, input tokens, output tokens, and sessions. Members without an assigned role appear under "no role".
  • The employee table shows, per member: input, output, and total tokens, cost, cost per session, sessions, and share of total spend.

Toggle between Tokens and Cost ($) to switch the measure, and filter by date range, agent, and account type. An AI-assistant mode answers natural-language questions over the same data.

Check the label before you share a number. Flat-fee plans (Claude Max, Pro, and Team) include usage in the subscription, so the dashboard shows Cost only when an admin has declared every contributing account as metered, and Est. cost for any mix that includes flat-rate or undeclared accounts.

To see where a costly session's tokens went, open it in Observability > Agent Sessions for the full transcript with tool calls, token usage, and duration. Claude Code sessions carry per-turn usage: tokens in, tokens out, cache reads, the model that answered, and the cost of each turn.

For tool-level usage, MCP Insights under Observability > MCP & Tools ranks the most used servers, tools, and clients, and the busiest people.

Step 8 (optional): Add Cursor and Codex spend

Of the clients sending telemetry, only Anthropic's report dollar costs. Cursor and Codex sessions show token counts when the observability plugin is installed in those clients, but without a provider integration they add $0 to the cost totals. Two integrations under Organization settings > Settings > AI Integrations fill the gap:

  • Cursor. In Cursor's dashboard, open the Team API keys settings, click New API Key, set its scope to Read-only, and copy the key. Back on the AI Integrations page, select Configure on the Cursor provider and paste it into the Cursor Admin API key field. The Cursor integration imports usage and spend for every seat through Cursor's Admin API, roughly every hour, and captures no prompt or response content.
  • Codex. The OpenAI Compliance Logs integration imports Codex and ChatGPT usage and spend. In OpenAI's platform console, create an API key with access to compliance logs and copy your organization ID, which starts with org-. Back on the AI Integrations page, select Configure on the OpenAI Compliance Logs provider and enter both. Codex cloud surfaces such as web tasks and GitHub code review emit no device telemetry, so this feed is their only token source.

Once both are connected, Cursor and Codex spend appears on the same Costs page as Claude Code, split out in the Usage by Client chart.

Step 9 (optional): Export to your observability stack

Data export sends normalized OTLP logs, metrics, and traces from each project to Langfuse, Datadog, Grafana Cloud, an OpenTelemetry Collector, or another OTLP/HTTP destination. Configure it under Organization settings > Data > Exports.

Where this setup stops

These limits come with tracking Claude Code usage from client telemetry, whichever tool reads it.

Claude Code's cost figures are estimates. Claude Code computes cost at list price by default, so if your organization pays contracted rates, the figures in /usage, the status line, and OpenTelemetry don't match your bill. Anthropic's modelPricing managed setting changes what Claude Code reports to match your rates. Speakeasy sums the cost each client reports rather than recomputing it, so its totals carry the client's pricing, including figures the Costs page labels Cost.

Seat usage isn't billed per token. On Claude Teams and Enterprise plans, each member's Claude Code usage draws from a per-seat allowance, and usage inside that allowance isn't metered in dollars. An API-equivalent figure for seat usage shows how heavily the seat is used, not what it cost, which is why Speakeasy labels mixed or flat-rate figures Est. cost.

Server-managed settings need a Teams or Enterprise Claude plan. The step 4 route reaches developers who use Claude Code through your Claude organization on one of those plans.

Token counts measure spend and adoption. They don't measure productivity, since high usage can mean the most useful work on the team or a session stuck in a loop. Anthropic's contribution metrics, which count PRs and lines of code shipped with Claude Code assistance, are aimed at output instead, and they're in public beta on Teams and Enterprise plans.

What to do next

Start with a pilot, as Anthropic's cost guide suggests: map one team's directory group to a role, and use a week of that role's numbers on the Costs page as the baseline before a wider rollout. AI cost tracking covers the wider practice of attributing AI spend across providers, and the agent plugin explainer covers the kind of plugin that carries the telemetry. The same observability plugin also powers shadow MCP detection.

To try it on your own team, sign up for the AI Control Plane, or talk to us about rolling it out across your Claude organization.

Frequently asked questions
How do I track Claude Code usage for my team?
Anthropic's analytics dashboard and spend report cover Claude Code for Teams and Enterprise organizations, and the Console dashboard covers API customers. For per-user token and cost metrics in your own stack, configure Claude Code's OpenTelemetry export through managed settings. To attribute usage and cost to directory roles, a control plane such as the Speakeasy AI Control Plane collects the same telemetry, syncs the directory over SCIM to show cost by role and by employee, and adds Cursor and Codex spend to the same page through provider integrations.
Does Claude Code have a usage analytics dashboard?
Yes. On Teams and Enterprise plans, Admins and Owners see Claude Code usage analytics at claude.ai/analytics/claude-code, including lines of code accepted, suggestion accept rate, daily active users, and sessions, with a leaderboard and a data export. API customers get a dashboard in the Claude Console at platform.claude.com/claude-code, whose team insights table shows estimated spend per user. For per-user token counts and cost estimates, Anthropic's docs point to OpenTelemetry export or the spend report. In Speakeasy, the Costs page shows Claude Code tokens and estimated cost by role and by employee, with Cursor and Codex spend split out by client once those integrations are connected.
Can I see Claude Code cost per developer?
Yes. Anthropic's spend report lists estimated usage-credit spend per user and per model on Teams and Enterprise plans, and the Claude Console's team insights table shows per-user spend for API customers. In Speakeasy, the employee table on the Costs page shows each member's tokens, cost, cost per session, sessions, and share of total spend. All of these figures are estimates rather than invoice amounts.
Does Claude Code support OpenTelemetry?
Yes. Setting CLAUDE_CODE_ENABLE_TELEMETRY=1 enables telemetry, the OTEL_* exporter and endpoint variables choose where it goes, and the metrics include claude_code.cost.usage for session cost in USD and claude_code.token.usage for tokens. Administrators can set it for all users through managed settings, and OTEL_RESOURCE_ATTRIBUTES adds custom attributes such as department or cost center to every metric and event.
Why do Claude Code cost figures differ from my bill?
Claude Code computes cost at list price by default, so if your organization pays contracted rates, the figures in /usage, the status line, and OpenTelemetry won't match your bill until an admin sets the modelPricing managed setting. Flat-fee plans also include usage in the subscription, and usage inside a Teams or Enterprise seat allowance isn't metered in dollars, so an API-equivalent figure can be higher than what you pay.
How much does Claude Code cost per developer?
Anthropic's docs put the average across enterprise deployments at around $13 per developer per active day and $150 to $250 per developer per month, with costs below $30 per active day for 90% of users. Anthropic recommends starting with a small pilot group and using tracking tools to establish your own baseline before a wider rollout.
Can I track Claude Code usage alongside Cursor and Codex?
On one machine, ccusage reports Claude Code, Codex, OpenCode, and other coding agent CLIs from local data. For a team, Speakeasy's Costs page shows Claude Code usage from the observability plugin and Claude's OpenTelemetry export next to Cursor spend from Cursor's Admin API and Codex spend from OpenAI Compliance Logs. Cursor and Codex sessions that the observability plugin captures show token counts, and the integrations add their cost.

AI everywhere.

Control here.