Claude Code 2.1.300 splits cache writes by lifetime in OTel

A one-hour cache write costs twice the base input price and a five-minute write costs 1.25 times, yet Claude Code's OpenTelemetry stream used to report both as one number. Version 2.1.300, according to the release notes on Github, splits that number into two counters and adds standard GenAI attributes to trace spans.
At a glance
- Beyond telemetry, /advisor arrives on Claude Platform on AWS, but nothing runs until you pick an advisor with /advisor, advisorModel or --advisor, and CLAUDE_CODE_DISABLE_ADVISOR_TOOL=1 turns the feature off.
- The api_request event gains cache_creation_5m_tokens and cache_creation_1h_tokens, while trace spans pick up attributes such as gen_ai.provider.name, gen_ai.conversation.id, gen_ai.tool.name and error.type from the OpenTelemetry GenAI conventions.
- The catch: the notes do not say which Claude Code requests write to the one-hour tier, so the new counters show the split without explaining how the client chooses it.
If you have not followed prompt caching closely, the API's usage block already carried cache_creation_input_tokens and cache_read_input_tokens, and those are the fields people check to confirm cache hits. Claude Code's telemetry reported cache writes as a single lump. The one-hour lifetime started as a beta. According to Agno Documentation, it was switched on with the header extended-cache-ttl-2025-04-11.
The api_request event now splits cache writes into 5-minute and 1-hour counts
The change lands in the OpenTelemetry api_request event, the one Claude Code sends for API requests. It gains two fields, cache_creation_5m_tokens and cache_creation_1h_tokens. Each counts the tokens written to the cache with that lifetime, so a dashboard can show the two tiers side by side where it used to show a single write total.
Trace spans get a matching upgrade. They now carry attributes from the OpenTelemetry GenAI semantic conventions, among them gen_ai.provider.name, gen_ai.conversation.id, gen_ai.tool.name and error.type. These names come from a shared convention that Claude Code did not invent, so a backend that already understands GenAI spans can group them by provider, conversation or tool without custom mapping.
Two telemetry fixes come with it. tool_result events now keep git_commit_id after git commit -q in repositories using reftable ref storage. A prompt that a mod's prompt.submit hook rewrote or dropped is also no longer recorded as typed in the user_prompt event, the interaction span or session title requests.
/advisor reaches Claude Platform on AWS with no advisor running by default
/advisor now works on Claude Platform on AWS. No advisor runs until you choose one, either with the /advisor command, the advisorModel setting or the --advisor flag. Setting CLAUDE_CODE_DISABLE_ADVISOR_TOOL=1 turns the tool off entirely.
One fix changes what happens with MCP. If the API rejected an MCP tool's input schema, the conversation used to fail with a 400 error on every turn. Claude Code now sends that tool without parameters for the rest of the conversation, and the session keeps going.
Hooks get stricter too. updatedInput returned by PreToolUse and PermissionRequest hooks is now validated like Claude's own input: unknown keys are dropped, and input the tool rejects denies the call. Agent hooks now respect their model setting. Aliases like haiku resolve, a subagent's model no longer overrides it, and an unavailable model falls back to the caller's instead of allowing the action.
Mods gain virtualText, a prompt.change hook and a transcript view
Mods get more control over the interface. virtualText in prompt decorations draws text in the prompt box that never enters the draft or the submitted prompt. The new prompt.change hook fires when the box's text changes without a typed edit: a recalled history entry, a clear, an undo or a plugin's fill.
$.ui.view({ agentId }) shows an agent's transcript in the main view, and $.ui.view({}) goes back. The agent.spawn hook could only refuse workflow agents before; now it can rewrite their prompt and model. A dir prop on Text handles right-to-left text, which on Windows and in VS Code's terminal reads in that direction and sits flush right.
Elsewhere, large requests to api.anthropic.com are now gzip-compressed even with telemetry disabled, and CLAUDE_CODE_GZIP_REQUEST_BODIES=0 turns that off. Local transcripts also record each request's system prompt, tools and parameters, so a transcript you share can reproduce a request exactly. claude remote-control drops its --sandbox and --no-sandbox flags, which never did anything.
One-hour cache writes cost 2x base input, five-minute writes 1.25x
Prompt caching works on prefixes. According to Claude Platform Docs, the API checks whether the start of a prompt, up to a cache breakpoint, is already cached from a recent request. If it is, the API reuses it. If not, it processes the whole prompt and caches the prefix once the response begins. The docs put the default lifetime at 5 minutes, refreshed at no extra cost each time the entry is used.
Think of it as a parking meter: a cheap short slot that resets every time you come back, or a pricier long one. Five-minute writes cost 1.25x base input and one-hour writes cost 2x, while reads cost the same under either. The Claude Platform Docs table for Claude Sonnet 5.5 lists $2 per million input tokens, $2.50 for 5-minute writes, $4 for 1-hour writes and $0.10 for hits.
The match is strict. Any change to the prefix, even whitespace or a reordered tool definition, invalidates the cache without returning an error. According to Caching.ai, if requests arrive further apart than the lifetime, you pay the write premium on every call and never collect a read.
The notes do not say how Claude Code picks a lifetime for its own requests, or whether you can steer that choice, so the counters show the split without explaining it. They also give no figures on how much spend typically lands in each tier. In our view, the MCP fallback is the right trade, though a tool sent without parameters likely leaves Claude calling it with nothing to fill in.
What the two counters will reveal
The new fields arrive with 2.1.300, so only events from this version on carry the per-tier split. Events from earlier versions keep the single lump. Your own dashboards can now answer whether one-hour writes in your sessions turn into reads or just cost the premium. How Claude Code assigns requests to each tier is still not documented in these notes.
Up next
Claude's slash commands reshape one answer three ways, Video
Type /dashboard after Claude analyzes your spending, and the same chat returns it as a dashboard, per Claude's account, with matching commands for a doc or a design. Have you ever redone an analysis in a new chat just to get it in another format?
Related stories
- Claude Code 2.1.299 compacts idle chats before cache expiry
- Claude Code 2.1.288 brings back the prompt you Ctrl+C'd
- Subagents in Claude Code 2.1.296 can compact early
- Claude Code 2.1.295 hooks can fail closed when they break
- Claude Code 2.1.292 gives sub-agents their own effort dial
- Claude Code 2.1.290 gives mod hooks the subagent's ID
Comments
No comments yet. Be the first.
Join the conversation
Sign in to leave a comment. It appears after moderation.

