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:
- As an organisation admin, go to API keys.
- Select Create API key.
- Set Scope to Organization.
- Link the key to a service account.
- Select the shortest expiry that suits you.
- Copy the key.
In the SenseOn Platform:
- Select Integrations in the main side menu.
- Select Set up a new integration. For the set-up page, refer to Data Connectors.
- Select the Claude Code Analytics card.
- In API key, paste the key. SenseOn stores the key in an encrypted form and never shows it again.
- 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.