Send Claude Code and Cowork telemetry

Send Claude Code and Cowork OpenTelemetry data to SecureAuth Agent Authority to see token usage per user and model

When you finish, you can see how many tokens each person uses in Claude Code and Claude Cowork, and on which models. Both apps send this usage over OpenTelemetry (OTel) to SecureAuth Agent Authority's …/claude ingest endpoint, and it appears on the LLM Usage tab in Enforcement traffic.

Claude Code

Add the telemetry block to Claude Code's managed settings. Because managed settings apply to every user on a machine, shipping this file through your device-management tooling turns telemetry on for the whole organization automatically (no per-developer setup).

{
  "env": {
    "CLAUDE_CODE_ENABLE_TELEMETRY": "1",
    "OTEL_METRICS_EXPORTER": "otlp",
    "OTEL_LOGS_EXPORTER": "otlp",
    "OTEL_EXPORTER_OTLP_PROTOCOL": "http/protobuf",
    "OTEL_EXPORTER_OTLP_ENDPOINT": "<endpoint>/claude",
    "OTEL_EXPORTER_OTLP_HEADERS": "Authorization=Bearer <token>",
    "OTEL_LOG_TOOL_DETAILS": "1"
  }
}

Replace <endpoint> with the OTLP endpoint shown when you created the ingest key (for example, https://telemetry.your-gateway-host/api/v1/telemetry) and <token> with the saai_ingest_… key.

OTEL_LOG_TOOL_DETAILS attaches each tool call's parameters: the bash command, MCP server and tool names, and the skill or subagent invoked.

Across a large fleet it is worth cutting the bandwidth each machine spends on telemetry: add "OTEL_EXPORTER_OTLP_COMPRESSION": "gzip" to that same env block. The gateway accepts gzip only, and answers any other value with a 415 naming the codings it supports. The 4 MiB payload limit applies twice, to the compressed upload and again to the batch after it decompresses, so compression buys bandwidth rather than a bigger batch.

Claude Cowork

For Claude Cowork, configure telemetry in the Claude desktop app under Admin settings → Cowork:

FieldValue
OTLP endpoint<endpoint>/claude
OTLP protocolhttp/protobuf
OTLP headersAuthorization=Bearer <token>

In the same Cowork configuration, set otlpContentCapture: ["toolDetails"] to attach the bash command, MCP server and tool names, and skill or subagent to each tool event.

Next steps

  • Enforcement traffic – see per-user and per-model token trends once data starts flowing.
  • Telemetry – the full OpenTelemetry rollout model, including how to push configuration to every machine.

On this page