Skip to content

Claude Code Analytics

The Claude Code Analytics integration reports the usage, productivity and estimated cost of Claude Code. It reads a daily report from your Anthropic API organisation.

ℹ This integration covers Claude Code billed through the Anthropic API. You manage that organisation in the Claude Console at platform.claude.com. Usage on Claude Team seats can be missing. Claude Enterprise seats are not covered. For those seats, use Claude Code telemetry.

To compare the ways that SenseOn can see Claude Code, refer to Which Claude Code Source Do You Need.

Before You Start

Requirement What it needs to be
Who creates the key An admin of the Anthropic API organisation
Key scope Organization. A key with a narrower scope cannot read the usage report
Key owner A service account. Do not use a key that is linked to a person

Anthropic deactivates a key that is linked to a person when that person leaves the organisation. The integration then stops.

Set Up the Integration

In the Claude Console at platform.claude.com:

  1. As an organisation admin, go to API keys.
  2. Select Create API key.
  3. Set Scope to Organization.
  4. Link the key to a service account.
  5. Select the shortest expiry that suits you.
  6. Copy the key.

In the SenseOn Platform:

  1. Select Integrations in the main side menu.
  2. Select Set up a new integration. For the set-up page, refer to Data Connectors.
  3. Select the Claude Code Analytics card.
  4. In API key, paste the key. SenseOn stores the key in an encrypted form and never shows it again.
  5. Select Connect.

⚠ Replace the integration when the key expires. Delete the integration and create it again with a new key.

When the Data Arrives

SenseOn reads the report one time each day. Each read covers one whole UTC day. For this reason, the first data shows the day after you connect.

What Each Record Holds

SenseOn stores one record for each developer or API key for each day. A record holds these values:

  • The number of sessions
  • The lines of code that Claude Code added and removed
  • The commits and pull requests that Claude Code made
  • The edits that developers accepted and rejected, for each tool
  • The input, output and cache tokens
  • The cost that Anthropic estimates, for each model

A record never holds prompts, code or conversation content. The Anthropic report does not contain them. SenseOn only reads the report and never changes anything in your organisation.

Where the Data Shows

SenseOn stores the records in the ai_usage_metric table. Query the table in Hunt Lab. A developer who signs in to Claude Code with a personal Console account shows by email address. Usage through an API key shows by the name of the key.