Claude Code integration
Enabling Claude Code metrics with Analytics API or OpenTelemetry monitoring
Read more about Swarmia's other AI coding tool integrations and measuring the productivity impact of AI tools.
There are multiple ways to run Claude Code, each with a different set of supported integration options for getting your data into Swarmia. For a quick overview of the options and compatibility, see the table below. You can just go to Settings → AI tools → Claude Code, click "Add new", and Swarmia guides you through the setup.

If you're unsure which authentication method you're using, see How do I know which authentication method I'm using? below.
Claude Console
(API-based billing)
Team or Enterprise plan
(Seat-based billing)
Cloud providers
(Amazon Bedrock, Google Vertex AI, Microsoft Foundry, and LiteLLM)
Analytics API
✅ Recommended
❌ Not available
❌ Not available
OpenTelemetry: managed settings in Claude.ai
❌ Not available
✅ Recommended
❌ Not available
OpenTelemetry: managed settings in MDM
✔️ Available
✔️ Available
✅ Recommended (requires user email)
OpenTelemetry: shared project settings
✔️ Available
✔️ Available
❌ Not available
We recommend using Claude Code's default attribution settings for commit and PR messages, since those are used in Swarmia's automatic AI assistant detection.
Analytics API
Analytics API availability:
✅ Claude Console
❌ Team or Enterprise plan
❌ Cloud providers
If you're unsure which authentication method you're using, see How do I know which authentication method I'm using? below.
Create a Claude Code Admin API key (note that these differ from the standard API keys) and copy it to Settings → AI tools → Claude Code in Swarmia. You need to be a Claude organization admin to create Admin API keys. We fetch 30 days of historical activity data upon connection.
The historical enabled users don't include people who had a license but got removed before you connected Claude Code to Swarmia.
OpenTelemetry monitoring
Claude Code OpenTelemetry monitoring is currently in alpha test and will soon be released to all Swarmia customers. Please reach out to [email protected] for more information.
Claude Code’s OpenTelemetry monitoring lets your users send event-level data directly to Swarmia.
To enable the integration, add the following JSON to all your users' Claude Code settings. There are multiple ways to distribute the settings, which are explained below. See the Claude Code's settings precedence for more information about the priority order of settings.
"OTEL_RESOURCE_ATTRIBUTES": "[email protected]"is required only if you're using Claude Code via cloud providers (Amazon Bedrock, Google Vertex AI, Microsoft Foundry, and LiteLLM) so that Swarmia can match the activity to the right author.Replace
<AUTHORIZATION_TOKEN>with a key you can generate in Settings → AI tools → Claude Code by clicking "Add new" and "Click to reveal".
The OpenTelemetry monitoring option has these limitations:
No historical backfill: Swarmia collects the events in real time, and there's no way to fetch data from the time before you enabled the integration.
No data on idle users: Swarmia receives only usage data, so there's no visibility into people who have a license but are not using it. Consequently, enabled users only include active users.
Below are the different ways to distribute the settings.
Managed settings in Claude.ai
Managed settings in Claude.ai availability:
❌ Claude Console
✅ Team or Enterprise plan
❌ Cloud providers
If you're unsure which authentication method you're using, see How do I know which authentication method I'm using? below.
Add the JSON configuration to the Claude.ai managed settings.

Claude Code users will see a warning when you update the managed settings:

Managed settings in MDM
Managed settings in MDM availability:
✅ Claude Console
✅ Team or Enterprise plan
✅ Cloud providers (requires user email)
If you're unsure which authentication method you're using, see How do I know which authentication method I'm using? below.
Deploy the JSON configuration via device management (e.g., MDM) to all users, e.g., /Library/Application Support/ClaudeCode/managed-settings.json. These are enforced for all users. Read more in Claude Code Docs.
Shared project settings
Shared project settings availability:
✅ Claude Console
✅ Team or Enterprise plan
❌ Cloud providers
If you're unsure which authentication method you're using, see How do I know which authentication method I'm using? below.
Add the JSON configuration in shared project settings files in each repository (.claude/settings.json). The users can override these with their personal settings.
Frequently asked questions
How do I know which authentication method I'm using?
Claude Console:
You pay per API usage
You see activity at platform.claude.com/claude-code
Team or Enterprise plan:
You pay a fixed monthly fee per license and also have access to Claude.ai
You see activity at claude.ai/analytics/claude-code
Cloud providers:
You have one of these environment variables set:
CLAUDE_CODE_USE_BEDROCK(AWS Bedrock)CLAUDE_CODE_USE_VERTEX(Google Vertex AI)CLAUDE_CODE_USE_FOUNDRY(Microsoft Foundry)ANTHROPIC_BASE_URL(LLM gateway, such as LiteLLM)
Analytics API: Why do you need a Claude Code admin API key? Isn't that a bit excessive?
We'd love to ask for fewer permissions, but the Claude Code Analytics API requires an admin key. You can read more about our data access here.
OpenTelemetry monitoring: How long does it take for the data to become visible?
The timestamp in Settings → AI tools → Claude Code → OpenTelemetry monitoring shows the latest event Swarmia has received in real time. The AI tool metrics are calculated from the events once a day, so it can take up to 24 hours for the data to become visible.

Last updated
Was this helpful?