⌨️CLAUDE_CODE_ENABLE_TELEMETRY
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
Example code
bash
export CLAUDE_CODE_ENABLE_TELEMETRY=1
export OTEL_METRICS_EXPORTER=otlp
export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
claudeCommon mistake
Key takeaways
- 1Turns on OpenTelemetry. Set 1.
- 2To your collector. Not Anthropic.
- 3Needed first. Before exporters.