# CLAUDE_CODE_ENABLE_TELEMETRY

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

**Field:** Artificial Intelligence  
**Category:** Claude Code  
**Also known as:** CLAUDE_CODE_ENABLE_TELEMETRY=1

## Think of it like

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

## 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

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.

## 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.

## Why it matters

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

## Common mistake

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

## Three principles

- **Turns on OpenTelemetry.** Set 1.
- **To your collector.** Not Anthropic.
- **Needed first.** Before exporters.

## Related terms

- [DISABLE_TELEMETRY](https://learn.benibix.com/term/ai/disable-telemetry-variable)
- [OTEL_LOG_USER_PROMPTS](https://learn.benibix.com/term/ai/otel-log-user-prompts-variable)
- [LLM Observability](https://learn.benibix.com/term/development/llm-observability)
- [Claude Code Monitoring (OpenTelemetry)](https://learn.benibix.com/term/ai/claude-code-monitoring)

## Told apart from

- [CLAUDE_CODE_ENABLE_TELEMETRY vs DISABLE_TELEMETRY](https://learn.benibix.com/compare/claude-code-enable-telemetry-variable-vs-disable-telemetry-variable): People think the ENABLE and DISABLE telemetry switches are the on and off of one thing. They are two roads. The first sends logs and stats to a tool you run. The second stops the usage data Claude Code sends home. You can set both. Your own team sees it all, and nothing goes home.

![Two separate roads: usage data to Anthropic, and OpenTelemetry to your own collector.](https://learn.benibix.com/diagrams/env-telemetry-flows.svg)

---

Source: https://learn.benibix.com/term/ai/claude-code-enable-telemetry-variable
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
