# Connecting Claude Code

Engineering Delivery can show how your teams use Claude Code: sessions, models, cost, tools, and how each team's use changes over time. It reads this from Claude Code's own telemetry, or from Anthropic's usage report. This page explains the three ways to connect it, what each one gives you, what happens to the data you already have, and how accounts are linked to people. [The Claude Code place](/docs/engineering-delivery/claude-code) explains what you then see.

You set it up in Engineering Delivery's **Setup**, in the **Claude Code telemetry** card. Everything is read at team level, and Claude Code's prompt text is never read.

## Which way should I choose?

There are three ways in. You can use more than one.

- **A. Send telemetry to Solidafy** (recommended). Claude Code sends its metrics and events straight to Solidafy. You get everything: usage, cost, tools, permission decisions and sessions, close to live.
- **B. Read it from your own Azure.** Claude Code sends to your Azure Application Insights, and Solidafy reads it from your Log Analytics workspace. You get the same metrics and events, as often as the pull runs. You keep the data in Azure and pay Azure for it.
- **C. Anthropic usage report.** Connect Anthropic with an admin key in Setup. You get daily totals per person: sessions, edits, models and cost. No tools, MCP servers, sessions or security events.

If you already collect Claude Code telemetry in Solidafy, you do not need to set anything up again. See [Already collecting? Your history is kept](#already-collecting-your-history-is-kept).

## A. Send telemetry to Solidafy

Claude Code has built-in OpenTelemetry support. You turn it on with a few settings that point it at Solidafy's receiver. The receiver writes what arrives into your environment, and Engineering Delivery reads it from there. Setup gives you everything to paste.

The quickest way sets it once for your whole team, in claude.ai. The card shows it first, in four steps.

### 1. Create your key

In the **Claude Code telemetry** card, choose how long the key lasts (**30 days**, **90 days** or **Never**) and press **Create your key**. The key holds the `otel:ingest` permission and nothing else: it can send telemetry, and cannot read your data. Making it is recorded in the audit log.

The key is shown once. Setup puts it straight into the text to paste, and forgets it when you leave. Copy it before you leave Setup. If you lose it, make a new one.

### 2. Open claude.ai managed settings

Press **Open claude.ai**. It opens [Organization settings > Claude Code > Managed settings](https://claude.ai/admin-settings/claude-code). Anthropic's [server-managed settings guide](https://code.claude.com/docs/en/server-managed-settings) says these settings need a Claude for Teams or Claude for Enterprise plan, and only an **Owner** or **Primary Owner** can change them.

### 3. Paste this and save

Copy the block from Setup and paste it into the managed settings. The card shows the receiver address to send to and fills it in for you. If the card says the receiver address is not configured, ask Solidafy support for it. The block looks like this, with your address and key filled in:

```json
{
  "env": {
    "CLAUDE_CODE_ENABLE_TELEMETRY": "1",
    "OTEL_METRICS_EXPORTER": "otlp",
    "OTEL_LOGS_EXPORTER": "otlp",
    "OTEL_EXPORTER_OTLP_PROTOCOL": "http/protobuf",
    "OTEL_EXPORTER_OTLP_ENDPOINT": "<the address shown in Setup>",
    "OTEL_EXPORTER_OTLP_HEADERS": "x-api-key=<your key>",
    "OTEL_METRICS_INCLUDE_REPOSITORY": "true",
    "OTEL_METRICS_INCLUDE_VERSION": "true",
    "OTEL_METRICS_INCLUDE_ENTRYPOINT": "true",
    "OTEL_LOG_MANAGED_SETTINGS": "1"
  }
}
```

What each line does:

- `CLAUDE_CODE_ENABLE_TELEMETRY` turns telemetry on.
- `OTEL_METRICS_EXPORTER` and `OTEL_LOGS_EXPORTER` send both metrics (counts such as sessions, tokens and cost) and events (such as each tool call and its permission decision).
- `OTEL_EXPORTER_OTLP_PROTOCOL`, `OTEL_EXPORTER_OTLP_ENDPOINT` and `OTEL_EXPORTER_OTLP_HEADERS` say how, where and with which key to send it.
- `OTEL_METRICS_INCLUDE_REPOSITORY` tags each metric and event with the repository the session works in, taken from its `origin` remote, so numbers split by repository. Needs Claude Code 2.1.269 or later.
- `OTEL_METRICS_INCLUDE_VERSION` and `OTEL_METRICS_INCLUDE_ENTRYPOINT` add the Claude Code version and how the session was started to its metrics.
- `OTEL_LOG_MANAGED_SETTINGS` adds which managed settings each session runs, as setting names with every value redacted, and a digest. Needs Claude Code 2.1.274 or later.

Each engineer approves the settings once, when Claude Code asks, and restarts Claude Code. Managed settings come first: no one can change the address or the key in their own settings.

### 4. Check that data is arriving

Press **Check again**. The card says **Data is arriving** or **Waiting for the first data**, when the latest data arrived, and how many rows came in the last 3 days. Claude Code sends metrics once a minute, so check a few minutes after someone has used it. If Setup says it could not check just now, the settings are still right; try again later.

### Other ways to put the settings

Under **Other ways to connect**, the card has the same settings for two other places.

claude.ai's settings do not reach people who sign in with a Console API key, or who use Bedrock, Vertex or a custom `ANTHROPIC_BASE_URL`. Use a managed file for them.

**Just me.** To try it on your own machine, open `~/.claude/settings.json` (make it if it is not there) and add the lines to its `env` block, keeping any other settings the file has. Or put them in your shell profile, such as `~/.zshrc`, as `export` lines. Then restart Claude Code.

**Managed file (IT).** Save the block as `managed-settings.json` and put it on every machine with your device management (MDM) or IT tooling, at the path [Anthropic's managed settings guide](https://code.claude.com/docs/en/managed-settings) gives:

- macOS: `/Library/Application Support/ClaudeCode/managed-settings.json`
- Linux and WSL: `/etc/claude-code/managed-settings.json`
- Windows: `C:\Program Files\ClaudeCode\managed-settings.json`

Then restart Claude Code on each machine. In Claude Code, `/status` lists the managed file under Setting sources.

A repository's own `.claude/settings.json` cannot turn telemetry on or choose where it goes: Claude Code ignores those settings in a repository. Repositories are named for you by `OTEL_METRICS_INCLUDE_REPOSITORY`.

### Choose whether to send skill, MCP server and tool names

Under **Other ways to connect** is a checkbox, **Also send skill, MCP server and tool names**. It is off by default.

- **Off:** Claude Code names your own skills, MCP servers, subagents and plugins only as `custom`, `third-party` or `custom_skill`. Allow lists and required skills in the Claude Code policy cannot match them, and the place says why those names read as custom.
- **On:** Setup adds `OTEL_LOG_TOOL_DETAILS=1` to what you paste. Claude Code's [monitoring guide](https://code.claude.com/docs/en/monitoring-usage) says this sends "Bash commands, MCP server and tool names, skill names, user-authored workflow names, and tool input."

Know what turning it on sends: the commands Claude Code runs and what it passes to each tool travel with the telemetry, and land as sent wherever the telemetry is kept, such as the receiver's tables in your environment or your Azure workspace. Engineering Delivery never reads or shows them; only the names count, and none of the app's own tables holds command text or tool input. It is your choice.

Prompt text is a separate setting, `OTEL_LOG_USER_PROMPTS`. Setup never adds it. Claude Code does not send prompts unless it is set, and Engineering Delivery never reads them either way.

### Split by project

To split by project too, add `OTEL_RESOURCE_ATTRIBUTES` to the `env` block, such as `"OTEL_RESOURCE_ATTRIBUTES": "project=checkout"`. Values take no spaces, commas or equals signs.

### If nothing arrives

- Telemetry is on: `CLAUDE_CODE_ENABLE_TELEMETRY` is `1`, and both exporters are `otlp`.
- The endpoint, protocol and key header are exactly as pasted, with a key that has not expired.
- Each engineer approved the settings and restarted Claude Code.
- `claude doctor` shows the **Managed settings (remote)** line, which says whether claude.ai's settings loaded. People on a Console API key need the managed file.
- Your firewall or proxy lets Claude Code reach the receiver.

Anthropic's [Claude Code monitoring guide](https://code.claude.com/docs/en/monitoring-usage) explains every telemetry option in full.

## B. Read it from your own Azure

Choose this if your organisation already sends Claude Code telemetry to Azure Application Insights, or wants to keep it in Azure.

1. **Send Claude Code's telemetry to Application Insights**, following your own Azure setup. Solidafy reads the rows whose role name is `claude-code`.
2. **Create a service principal** in Microsoft Entra ID, and give it the **Log Analytics Reader** role on the workspace that holds your Application Insights data.
3. **Connect Azure Log Analytics** in Solidafy's **Data Sources**, with your tenant ID, the service principal's client ID and secret, and the workspace ID.

The connector pulls Claude Code's metrics and events into two tables, `claude_code_metrics` and `claude_code_logs`. Engineering Delivery finds those tables and reads them. It never changes them.

Two things to know:

- Data arrives daily, not close to live.
- Azure charges you for ingesting and keeping the data, under your own retention rules.

## C. Anthropic usage report

Choose this for a quick start, or when you cannot change how Claude Code is set up. In Engineering Delivery's **Setup**, connect **Anthropic** with an admin key from your Anthropic organisation.

The usage report gives daily totals per person: sessions, edits, models and an estimate of cost. It does not include tools, MCP servers, sessions or security events. The cost is Anthropic's estimate at API prices, not your bill.

## Already collecting? Your history is kept

If your environment already holds Claude Code telemetry, Setup finds it by the shape of its tables, wherever it is:

- the tables Solidafy's receiver writes, `otel.otel_metrics` and `otel.otel_logs`;
- a table your own pipeline flattened those metrics into;
- the tables an Azure Log Analytics pull landed (way B).

The Claude Code telemetry card then says **Already kept here, with its history**, and lists each table it found. The app reads them from their first day, so your whole history shows, not only what arrives from now on. Reading existing history needs an admin to agree when the app is set up or updated. Your tables are only read, never changed or removed.

After that, the app reads the last few days on every run, and reads every table in full once a month. The monthly read catches data that was sent late, and picks up the history of any table found since. A table found after setup shows its recent days at once and its older history after the next monthly read. Nothing is lost in between.

If the same data is sent twice, for example because a machine sent it again, it is counted once. The app recognises each datapoint and event by what it is, not by when it arrived.

## Link Claude Code accounts to people

Claude Code reports who used it by email address, or by account ID when there is no email. To count that use for the right team, each account is linked to a person, the same way code and tracker accounts are. The numbers then follow the person to their team.

In Engineering Delivery's **Settings**, under **People**, the **Claude Code users** list shows the accounts no one holds yet: "Not linked yet: N of M accounts seen". The most used accounts come first, 50 at a time; link them and the next ones show.

Each account may carry a suggestion: a person whose email matches, or a match from an alias list or people list your environment already keeps. Suggestions are never applied on their own. Link an account to a person, or to a new person, and pick their team in the same step. Like every setting, it goes into your draft and changes nothing until you apply.

## Where it shows up

- **Claude Code:** a place of its own on the app's rail, with Usage, Outcomes, Standards and Security. See [The Claude Code place](/docs/engineering-delivery/claude-code).
- **Brief:** in the [Your teams](/docs/engineering-delivery/overview-and-focus#your-teams) table, the Claude Code column shows how many of each team's engineers used it in a typical week, and the [Highest Claude Code adoption](/docs/engineering-delivery/overview-and-focus#team-badges) badge can appear.

## Privacy

- Every screen is at team level. A team smaller than the smallest team shown on its own (3 engineers by default, set in Settings) is not shown on its own, so no one can be singled out.
- The one exception is the by person view, and it is off by default. When an admin turns it on in the Claude Code policy, only environment admins can open it, and every opening is recorded in the audit log. See [By person](/docs/engineering-delivery/claude-code#by-person).
- Prompt text is never read.
- Your existing tables are only read, never changed.
- Data stays in your Solidafy environment, or in your Azure workspace with way B.

## Learn more

- [Claude Code monitoring guide](https://code.claude.com/docs/en/monitoring-usage), Anthropic's reference for every telemetry setting
- [Setting it up](/docs/engineering-delivery/setup), for connecting your other tools
- [The Claude Code place](/docs/engineering-delivery/claude-code), for what you see once it is connected
- [AI](/docs/engineering-delivery/ai), for AI spend, budgets and payback
