Claude Code v2.1.300, released October 14, 2026, adds the OpenTelemetry GenAI attributes to its trace spans: gen_ai.provider.name, gen_ai.conversation.id, gen_ai.tool.name and error.type. It also splits cache writes on the api_request event into cache_creation_5m_tokens and cache_creation_1h_tokens.1 If you send Claude Code's telemetry to a monitoring tool, it can now read more of it without custom mapping. You can also see which cache writes cost 2 times the base input price.

What changed

Claude Code can send three kinds of OpenTelemetry data to an endpoint you choose. Metrics count sessions, tokens, cost and lines of code. Events record each prompt, tool result and API request. Traces, in beta, give one span tree per prompt.2 Until this release, its spans carried only a few attributes from the GenAI semantic conventions, the shared names OpenTelemetry defines for AI calls, such as gen_ai.request.model.2 In June, a feature request asked Anthropic to follow those conventions more fully.3

v2.1.300 adds these to trace spans:1

AttributeWhat it tells you
gen_ai.provider.nameWhich AI provider served the call
gen_ai.conversation.idWhich conversation a span belongs to, so you can group a session's spans
gen_ai.tool.nameWhich tool a tool span ran
error.typeWhat kind of error a failed span ended with

And on the api_request event, cache writes are now split by how long the cache entry lives:1

AttributeWhat it tells you
cache_creation_5m_tokensTokens written to the 5 minute cache
cache_creation_1h_tokensTokens written to the 1 hour cache

Why standard names matter

A monitoring tool that supports the GenAI conventions reads spans by those names. When Claude Code uses them, the tool knows which span is a model call, which is a tool call, and which belongs to which conversation, without you writing a mapping. Guides written before this release map more of Claude Code's own names by hand, so check the date on any guide you follow.

In practice, three things get easier:

  • Reading one session. Group by gen_ai.conversation.id and you get one conversation's spans together.
  • Finding failures. Filter on error.type to see which calls failed and how, instead of parsing messages.
  • One view across Claude. The Claude API's new trace export uses the same conventions, so tool calls from Claude Code and from an agent in your product can sit in one view. We explain that export in Claude API OpenTelemetry: trace your agents in your own monitoring.4

The cache split, and why it is about cost

Claude caches the start of a prompt so the next request does not pay full price for it again. Writing to the cache costs more than a normal input token, reading from it costs much less, and the price depends on how long the entry lives:5

Cache operationPrice, relative to base input
5 minute write1.25 times
1 hour write2 times
Read0.1 times on most models, less on some newer ones

Before v2.1.300, Claude Code reported cache writes as one number, cache_creation_tokens.2 You could not tell how much of it was written at the higher 1 hour price. The release adds the two new fields next to it, split by lifetime. With the split, a cost chart built on api_request events can price the two kinds separately, and you can see whether long-lived cache entries are a real part of your spend.1

One thing to keep: cache_read_tokens and the cache write counts sit next to input_tokens, they are not inside it. To get the total the GenAI conventions call gen_ai.usage.input_tokens, add input, cache read and cache write tokens together.2 More on where token spend goes in LLM observability and cost.

Also new: auto mode decisions (v2.1.301)

A day later, v2.1.301 added classifier_verdict and permission_mode to the tool_decision event. You can now tell a tool call that auto mode's classifier allowed or blocked apart from one a permission rule decided. With OTEL_LOG_TOOL_DETAILS=1, a classifier_category also names the built-in rule a block matched.6 For a team that runs Claude Code in auto mode, that is the audit trail of what it was allowed to do on its own.

How to turn it on

Telemetry is off until you turn it on, and traces need a second, beta switch.2 Put the variables in your shell, or in the env block of your Claude Code settings so the whole team gets them. This example sends all three signals to Fixter, which takes OTLP over HTTP:2,7

terminal
export CLAUDE_CODE_ENABLE_TELEMETRY=1
export CLAUDE_CODE_ENHANCED_TELEMETRY_BETA=1   # traces are beta
export OTEL_TRACES_EXPORTER=otlp
export OTEL_METRICS_EXPORTER=otlp
export OTEL_LOGS_EXPORTER=otlp
export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
export OTEL_EXPORTER_OTLP_ENDPOINT=https://ingest.fixter.dev
export OTEL_EXPORTER_OTLP_HEADERS="Authorization=Bearer <your Fixter API key>"

For another tool, change the endpoint, protocol and header to what it expects. Update Claude Code to v2.1.300 or later to get the new attributes; claude --version tells you where you are.

Content stays out by default. Prompt text, tool details, tool output and responses each have their own switch (OTEL_LOG_USER_PROMPTS, OTEL_LOG_TOOL_DETAILS, OTEL_LOG_TOOL_CONTENT, OTEL_LOG_ASSISTANT_RESPONSES), and whatever you turn on goes only to your endpoint, never to Anthropic.2 Anthropic's own analytics are a different channel, which we explain in cc-plugin-telemetry: what this built-in Claude Code mod sends.

What is still not standard

  • Token usage. Claude Code still does not set gen_ai.usage.* attributes. Its docs map its own fields: cache_read_tokens to gen_ai.usage.cache_read.input_tokens, and cache_creation_tokens to gen_ai.usage.cache_write.input_tokens.2
  • Traces are beta. Span names and attributes can still change between versions, so check the release notes before you build alerts on them.2
  • It watches Claude Code, not your app. This is telemetry about your team's sessions: what they cost, which tools ran, what failed. It says nothing about how your product behaves for your users.

That last point is where we come in. Fixter is monitoring for teams that build with coding agents: you send your app's logs and traces over the same standard OpenTelemetry, and Fixter finds the issues and bugs in production and tells you what broke and why. You pull them into Claude Code over MCP and fix them there. If you want Claude Code to read your app's logs, start with how to connect Claude Code to your logs.

Key takeaways

  • Claude Code v2.1.300 adds gen_ai.provider.name, gen_ai.conversation.id, gen_ai.tool.name and error.type to trace spans
  • Cache writes are split into 5 minute and 1 hour; 1 hour writes cost 2 times base input, 5 minute writes 1.25 times
  • v2.1.301 adds auto mode classifier decisions to tool_decision events
  • Traces need CLAUDE_CODE_ENHANCED_TELEMETRY_BETA=1 on top of CLAUDE_CODE_ENABLE_TELEMETRY=1
  • Token usage still uses Claude Code's own names, not gen_ai.usage.*

Frequently asked questions

Does Claude Code follow the OpenTelemetry GenAI semantic conventions?

More than before. Since v2.1.300 (October 14, 2026), its trace spans carry GenAI attributes such as gen_ai.provider.name, gen_ai.conversation.id, gen_ai.tool.name and error.type, on top of the few it already had, such as gen_ai.request.model. Token usage is the exception: Claude Code still does not set gen_ai.usage.* attributes, and its docs explain how to map its own token fields to them.

How do I turn on Claude Code traces?

Set CLAUDE_CODE_ENABLE_TELEMETRY=1 and CLAUDE_CODE_ENHANCED_TELEMETRY_BETA=1, then OTEL_TRACES_EXPORTER=otlp with an OTLP endpoint, protocol and headers. Traces are in beta. Metrics and events need OTEL_METRICS_EXPORTER and OTEL_LOGS_EXPORTER as well.

What are cache_creation_5m_tokens and cache_creation_1h_tokens?

Two attributes on Claude Code's api_request event, added in v2.1.300. They split the tokens written to the prompt cache by how long the cache entry lives: 5 minutes or 1 hour. A 1 hour cache write costs 2 times the base input price, a 5 minute write 1.25 times, so the split shows which part of your cache spend costs more.

Does Claude Code's OpenTelemetry send my prompts?

Not by default. Prompt text, tool details, tool output and assistant responses are each behind their own switch, such as OTEL_LOG_USER_PROMPTS and OTEL_LOG_TOOL_DETAILS. Whatever you turn on goes only to the endpoint you configure, never to Anthropic.

Is Claude Code's OpenTelemetry the same as cc-plugin-telemetry?

No. cc-plugin-telemetry is a built-in mod that sends Claude Code's own analytics to Anthropic. The OpenTelemetry export sends data about your sessions to an endpoint you choose. They are turned on and off separately.