Claude Code 2.1.300 splits cache writes by lifetime in OTel

Claude Code 2.1.300, released October 14, splits prompt-cache writes by lifetime in its OpenTelemetry data. The api_request event gains cache_creation_5m_tokens and cache_creation_1h_tokens, one counting writes to the 5-minute cache and the other writes to the 1-hour cache.
Until now those writes arrived as one combined number. The release notes on Github list the change next to GenAI attributes on trace spans, new mod APIs, changes to hook behaviour and a long list of fixes.
The two tiers are billed at different rates. A cache write costs 1.25 times the input price with the 5-minute lifetime and twice the input price with the 1-hour lifetime. A cache read costs about a tenth of the input price. Anthropic’s prompt caching docs give Claude Sonnet 5.5 at $2 per million input tokens, $2.50 for 5-minute writes and $4 for 1-hour writes. For Claude Opus 5.5 they list $4, $5 and $8.
Claude Code itself works around the one-hour cache. The previous release, 2.1.299, compacts a conversation of 200K+ tokens after about 54 minutes idle, so the compaction lands before its one-hour prompt cache expires. With the new fields, the more expensive 1-hour writes finally get a figure of their own in the telemetry.
Trace spans now carry attributes from OpenTelemetry’s GenAI semantic conventions, among them gen_ai.provider.name, gen_ai.conversation.id, gen_ai.tool.name and error.type. The release also fixes two telemetry bugs. When a mod’s prompt.submit hook rewrote or dropped a prompt, the user_prompt event, the interaction span and session title requests still recorded it as typed. And tool_result events were missing git_commit_id after git commit -q in repositories that use git’s reftable ref storage.
A few other changes affect existing configurations and defaults:
updatedInputfromPreToolUseandPermissionRequesthooks is now validated like Claude’s own input. Unknown keys are dropped, and input the tool rejects denies the call.- Agent hooks now use their configured model. Aliases like
haikuresolve, and if the model is unavailable the hook falls back to the caller’s model. Before this release it allowed the action. /advisorarrives on Claude Platform on AWS. No advisor runs until you pick one with/advisor,advisorModelor--advisor, andCLAUDE_CODE_DISABLE_ADVISOR_TOOL=1turns it off.- Large requests to api.anthropic.com are now gzip-compressed even with telemetry disabled.
CLAUDE_CODE_GZIP_REQUEST_BODIES=0turns compression off. claude remote-controlno longer has--sandboxand--no-sandbox, which never did anything. Passing either one now exits with an error, andsandbox.enabledin settings is the way to sandbox sessions.
Mods get virtualText for prompt decorations, $.ui.view for opening an agent’s transcript and a prompt.change hook. Many of the remaining fixes cover session resume, worktrees and reftable repositories.
One fix changes what happens when the API rejects an MCP tool’s input schema. Before, that error made the conversation fail with a 400 on every turn. Now Claude Code sends that tool without parameters for the rest of the conversation.
Up next
OpenAI flags Chinese models as risky after its own breaches
Cleaning up after OpenAI’s models broke in this July, Hugging Face ran the Chinese GLM 5.2 on its own servers. And OpenAI’s CFO now calls Chinese models a cyber risk. For security work, does your team stick to Western models or pick whatever works?
Related stories
- Claude Code 2.1.301 stops waiting out distant usage limits
- Claude Code 2.1.299 compacts idle chats before cache expiry
- Claude Code 2.1.288 brings back the prompt you Ctrl+C’d
- Claude Code on desktop folds an iPhone Duo to test layouts
- Claude Code 2.1.318: login expiry warning, runner log change
- Claude Code 2.1.312 stops overwriting big CLAUDE.md files
Comments
No comments yet. Be the first.
Join the conversation
Sign in to leave a comment. It appears after moderation.

