Claude Code telemetry
Claude Code can send its own usage metrics to Lore through OpenTelemetry, on any plan: Pro, Max, Team and Enterprise. This is the way to see Claude Code usage for seat-based plans. Anthropic’s admin APIs don’t cover Claude Team at all.
For each person, and optionally each repository, Lore receives:
- tokens by type (input, output, cache read, cache write) and by model;
- the API-equivalent cost: what that usage would cost at API prices. It is estimated, never billed, because on a seat plan you pay per seat;
- sessions, active time, lines of code, commits and pull requests.
Only metrics are sent. The configuration below never enables OpenTelemetry logs, so prompts, responses and tool output are never sent to Lore. Lore has no endpoint that would accept them.
Requires an active Pro plan and an org Owner to set it up.
Create an ingest key
In the Lore panel, open Claude Code Telemetry and click Create key. Copy the key; it is shown only once.
An ingest key can only send telemetry to your org. It can’t read or change anything in Lore, so it is safe to distribute to every developer machine. Revoke it anytime from the same page.
Configure Claude Code
The same page generates the configuration with your org’s endpoint and the key filled in. It is an env block:
{
"env": {
"CLAUDE_CODE_ENABLE_TELEMETRY": "1",
"OTEL_METRICS_EXPORTER": "otlp",
"OTEL_EXPORTER_OTLP_PROTOCOL": "http/json",
"OTEL_EXPORTER_OTLP_ENDPOINT": "https://registry.lore.infraestrutura.app/v1/orgs/<your-org>/otlp",
"OTEL_EXPORTER_OTLP_HEADERS": "Authorization=Bearer <your ingest key>",
"OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE": "delta",
"OTEL_METRICS_INCLUDE_REPOSITORY": "true"
}
}- Personal: each developer merges it into
~/.claude/settings.json. They can remove it. - Org-enforced (recommended): deploy it once for everyone through Claude Code’s managed settings, using the claude.ai console, Intune or another MDM. Developers can’t turn it off. See Org rollout.
OTEL_METRICS_INCLUDE_REPOSITORY adds the repository (owner/name) to each metric, for usage per repository. Remove it if you don’t want repository names sent.
Record what you pay per seat
On the same page, enter the plan, the number of seats and the price per seat per month. If the price isn’t in USD, also enter the conversion rate (1 USD = ? of your currency). The rate is yours, and Lore shows it next to every converted figure.
Org rollout
Telemetry is only as complete as the number of seats sending it. Instead of asking every developer to edit their settings, deploy the configuration once through Claude Code’s managed settings. Managed settings take precedence over everything a developer sets, so they can’t turn telemetry off. The panel’s Claude Code Telemetry → Org rollout tab generates everything below, with your endpoint and key filled in.
Use a dedicated ingest key per channel (for example “Intune” or “claude.ai console”), so you can revoke one channel without touching the others. The panel fills the key into the files in your browser only.
The channels:
| Channel | Best for | Who does it |
|---|---|---|
| claude.ai console | Claude Team/Enterprise, with or without MDM | A Claude Owner |
| Intune (macOS / Windows) | Devices managed by Microsoft Intune | Endpoint admin |
| Other MDM or manual | Jamf, Kandji, Group Policy, Linux | Endpoint admin |
claude.ai console or MDM?
Both deliver the same JSON, and in both cases developers can’t override it. The difference is what the configuration is tied to: the claude.ai console follows the account, and MDM follows the device.
| claude.ai console | MDM (Intune, Jamf…) | |
|---|---|---|
| Applies to | Every session signed in with your organization’s Claude account, on any computer (including personal ones) and in cloud sessions | Every Claude Code session on company devices, whatever account is signed in |
| Personal Claude account on a company device | Not covered: settings reach organization accounts only | Covered. The personal email shows up flagged as a non-member, outside the seat comparison |
Console API key, Bedrock, Vertex, Foundry or a custom ANTHROPIC_BASE_URL | Not covered | Covered |
| Developer’s personal computer | Covered, if they sign in with the organization account | Not covered |
| Can a developer bypass it? | Rejecting the approval prompt closes Claude Code, so it is effectively mandatory. On an unmanaged device, someone who knows how can tamper with the local cache | Not without admin rights on the device: the file is protected by the OS, and the MDM restores it if it is deleted |
| Effort | Paste the JSON once | A script in the MDM, and enrolled devices |
| First run | A one-time approval prompt for each developer | No prompt |
Where to start: if everyone uses Claude through your Team or Enterprise seats, the claude.ai console alone covers every seat, and gives the same result in the Seats view. Add MDM when you also want:
- usage from personal or API-key accounts on company devices (shadow AI);
- enforcement that doesn’t depend on local files staying untouched;
- coverage of sessions that bypass Anthropic sign-in (Bedrock, Vertex).
Combining both is fine. The console ranks higher, so the exporter settings come from it, and MDM covers what the console can’t reach. Since the values are the same, nothing conflicts. Use a different ingest key per channel, so you can revoke one without affecting the other.
claude.ai console (Team and Enterprise)
- In claude.ai, open Admin Settings → Claude Code → Managed settings. This requires the Owner or Primary Owner role in Claude.
- Paste the JSON from the panel. If the editor already has settings, add the
enventries to them instead of replacing everything. - Save.
Claude Code fetches these settings for every session signed in with your organization’s Claude account, on any device, at startup and then hourly. Two things developers will notice:
- a one-time approval prompt, because the settings define a telemetry endpoint (
OTEL_EXPORTER_OTLP_ENDPOINT); - the exporter starts on the next launch of Claude Code, not in sessions already open.
This channel doesn’t reach sessions that use Bedrock, Vertex, Foundry or a custom ANTHROPIC_BASE_URL. Use an MDM channel for those machines.
Intune: macOS
Download the install script from the panel. It installs /Library/Application Support/ClaudeCode/managed-settings.d/lore-telemetry.json, a drop-in that merges with any existing managed-settings.json without modifying it. It validates the JSON before installing, because a malformed managed file would stop Claude Code from starting, and it is safe to run repeatedly.
-
In the Intune admin center , go to Devices → macOS → Scripts → Add.
-
Upload the install script and use these settings:
Setting Value Run script as signed-in user No (runs as root) Hide script notifications on devices Yes Script frequency Every 1 day, so the file is restored if someone removes it Max number of times to retry if script fails 3 -
Assign it to the group that uses Claude Code.
Intune: Windows
Download the install script (.ps1) from the panel. It installs C:\Program Files\ClaudeCode\managed-settings.d\lore-telemetry.json with the same guarantees. It also writes UTF-8 without a BOM, since Windows PowerShell’s default BOM would make the file unreadable to Claude Code.
-
In the Intune admin center , go to Devices → Windows → Scripts and remediations → Platform scripts → Add.
-
Upload the install script and use these settings:
Setting Value Run this script using the logged on credentials No (runs as SYSTEM) Enforce script signature check No, unless your org signs scripts Run script in 64 bit PowerShell Host Yes -
Assign it to the group that uses Claude Code.
Platform scripts run once per device. To have Intune restore the file if it is deleted, use the same script as the remediation script of a Remediation.
Other MDM or manual
Place the panel’s JSON (env only) as managed-settings.d/lore-telemetry.json in Claude Code’s system directory. It must be readable by all users and writable only by administrators:
| OS | Directory |
|---|---|
| macOS | /Library/Application Support/ClaudeCode/managed-settings.d/ |
| Windows | C:\Program Files\ClaudeCode\managed-settings.d\ |
| Linux / WSL | /etc/claude-code/managed-settings.d/ |
The panel’s scripts also work with Jamf, Kandji and similar tools. Anthropic publishes MDM templates for profiles and Group Policy.
How managed sources combine
Claude Code reads managed settings from, in order:
- the claude.ai console;
- an MDM profile (
com.anthropic.claudecode) or registry policy (HKLM\SOFTWARE\Policies\ClaudeCode); - managed-settings files and their drop-ins.
Normally the first source with settings wins. The env block, however, merges per variable across these sources (Claude Code 2.1.223 or later), so Lore’s drop-in still applies when your org already has a policy elsewhere.
The exception: the OpenTelemetry exporter variables (OTEL_EXPORTER_OTLP_*) travel as a unit from the highest source that sets any of them. If your org already sends Claude Code telemetry to another collector through a higher source, Lore’s exporter settings are ignored. In that case, put Lore’s values in that higher source instead. Details: Claude Code managed settings .
Verify and roll back
- Verify: on a machine, open a new Claude Code session and run
/status, whose setting sources line names the managed source, orclaude doctor, whose “Managed settings (remote)” line applies to the claude.ai console. Within a minute of use, the person appears under Who is sending telemetry in the panel. - Roll back: remove the
enventries in the claude.ai console, or unassign the install script and deploy the panel’s removal script, which deletes onlylore-telemetry.json. Revoking the key stops ingestion immediately, whatever the channel.
Reading the Seats view
Under AI Usage → Seats, Lore compares, for each person, their API-equivalent usage with the seat cost over the same period:
- Usage ÷ seat above 1×: the seat is worth more than it costs. That person would pay more on the API.
- Well below 1×: the seat is underused.
- Seats that sent no telemetry are counted separately.
Two kinds of usage are left out of the comparison:
- Claude Code run with a Console API key is billed through the API, not the seat. If the org also has the Anthropic Admin connector, Lore uses its Claude Code Analytics to tell these sessions apart.
- Emails that aren’t org members. The ingest key proves the org, not the person: the email is the one Claude Code reports.
Freshness
Claude Code sends metrics about once a minute. Lore folds them into daily usage on its hourly sync, so figures appear in AI Usage within about an hour.
Troubleshooting
Run claude --debug and look for lines marked [3P telemetry].
| Symptom | Cause | Fix |
|---|---|---|
401 | Missing, wrong or revoked key | Check OTEL_EXPORTER_OTLP_HEADERS and that the key is active |
415 | Protocol isn’t http/json | Set OTEL_EXPORTER_OTLP_PROTOCOL=http/json (gRPC and protobuf are not supported yet) |
402 | The org’s plan isn’t Pro | Upgrade the org |
| Panel warns about rejected points | Cumulative temporality | Set OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE=delta |
| Nobody under “Who is sending telemetry” | Settings not loaded | Restart Claude Code after changing settings, then use it for a minute |
Coverage
Only Claude Code sends telemetry. Usage of claude.ai chat and Claude Desktop on Team plans is still not visible: Anthropic provides no API for it.
Cowork
Claude Cowork usage is received the same way, configured once in claude.ai with the same kind of ingest key: see Cowork telemetry.