Send Claude Code telemetry to Agent Authority

Send Claude Code and Claude Cowork OpenTelemetry token and cost data to SecureAuth Agent Authority for per-user LLM usage analytics.

Claude Code and Claude Cowork emit OpenTelemetry usage data — tokens, cost, and sessions per user. Point them at your gateway's …/claude ingest endpoint to populate the LLM Usage tab in Analytics.

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

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

On this page