Skip to content
BENIBIX Learn

CLAUDE_CODE_ENABLE_TELEMETRY

AI⌨️ Claude CodeConfiguration

Also known as CLAUDE_CODE_ENABLE_TELEMETRY=1

Set to 1, it sends metrics and logs to your own collector.

Think of it like

It is like you fit a meter to your own house. You read it, not the power firm.

Example

Emma wants a chart of how many tokens her team uses each day. She turns this on and points it at the team's collector.

Why it matters

It lets a team see its own use, cost and errors in the tools it already has.

Definition

CLAUDE_CODE_ENABLE_TELEMETRY set to 1 turns on OpenTelemetry. Claude Code can then send stats and logs to a tool you run. You need it before any OTEL export setting works. Set it in your shell, user settings or managed settings. Project settings skip it.

Example code

bash
export CLAUDE_CODE_ENABLE_TELEMETRY=1
export OTEL_METRICS_EXPORTER=otlp
export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
claude
Send metrics to a local collector.
This switch opens the lower road.

Common mistake

Thinking it sends more data to Anthropic. It sends data to the place you set, not to Anthropic.

Key takeaways

  1. 1
    Turns on OpenTelemetry. Set 1.
  2. 2
    To your collector. Not Anthropic.
  3. 3
    Needed first. Before exporters.

Compare