Claude Code 2.1.300 ships OpenTelemetry GenAI trace spans for agents

Today's build standardizes agent telemetry on the GenAI schema, splits prompt-cache write tokens by lifetime, and adds in-view subagent transcripts.

Nowline OCT 15 1:00 PM banner

Top AI stories from the last hour

Top AI stories from the last hour

Copy markdown

  • Agent traces now speak the GenAI standard

    2.1.300 tags trace spans with OpenTelemetry's GenAI semantic-convention attributes, so Claude Code and Agent SDK runs drop into Grafana, Datadog, Sentry, or any OTLP backend using the same schema every other GenAI tool emits — no custom mapping to read tool calls, latency, and token counts. Traces stay behind the CLAUDE_CODE_ENHANCED_TELEMETRY_BETA=1 flag; metrics and logs are already on.

  • Prompt-cache writes split by lifetime

    The OTel api_request event now breaks cache-write token counts out by cache lifetime, so 5-minute and 1-hour prompt-cache writes show up separately. You can finally attribute prompt-cache spend and tune your cache TTLs against real per-request numbers instead of guessing.

  • Inspect and steer your subagents in place

    A new $.ui.view({ agentId }) call renders any agent's transcript in the main view with a tap back, and the agent.spawn hook can now rewrite a workflow agent's prompt and model before it runs. Mod and workflow authors get to read and redirect fan-out agents without losing their place.

  • The whole agent run nests inside your app's trace

    The Agent SDK propagates W3C trace context into the CLI, so a query() fired inside an active span becomes a child span — and even Bash commands the agent runs can nest their own spans underneath. One trace shows your app, the model calls, every tool, and subagent delegation as a single tree.

  • Content export stays opt-in

    Default telemetry is structural — durations, model names, tool names, token counts — so it's safe to ship. Prompt text, tool inputs and outputs, and raw Messages API bodies only export when you set OTEL_LOG_USER_PROMPTS, OTEL_LOG_TOOL_CONTENT, or OTEL_LOG_RAW_API_BODIES. Flip those on only where your pipeline is cleared to store that data.