Claude Code 2.1.307 moves API code to version 2026-10-21

Claude Code 2.1.307, published on October 21, adds an api-version mode to the bundled /claude-api skill. The mode moves your code to Claude API version 2026-10-21, and that version breaks requests that work today: send temperature, top_p or top_k and you get a 400 error.
The same release, per the release notes on Github, adds a claude_code.safety_event OpenTelemetry event, stops HTTP MCP tool calls from being sent twice, and puts a 30-minute default timeout on self-hosted runners’ checkout hooks.
What api-version has to rewrite
Version 2026-10-21 is a dated anthropic-version value that Anthropic released the same day. It is available on the Claude API, Claude Platform on AWS, Microsoft Foundry and Google Cloud. Anthropic’s migration guide says that on Amazon Bedrock it works only with Claude 4.7 and later models. The guide lists the changes code has to handle:
- A request that sends
temperature,top_portop_kreturns a 400 error, “even at the parameter’s default value”. - A
documentblock placed directly in anassistantmessage returns a 400. - A
textblock with a non-emptycitationsarray in ausermessage returns a 400. - Admin API and Enterprise Analytics responses drop the old names of renamed fields:
rolesbecomesrole_ids,workspace_idbecomesscope,actor.emailbecomesactor.email_address,summariesbecomesdata.
New SDK major versions send 2026-10-21 by default: Python 2.0.0, TypeScript 1.0.0, C# 13.0.0, Go 2.0.0, Java 3.0.0, PHP 1.0.0, Ruby 2.0.0 and the ant CLI 2.0.0. They are licensed under Apache 2.0 instead of MIT. What the sampling change does model by model is in our breakdown of the version.
One event for every stopped tool call
The new claude_code.safety_event fires for each tool call that a permission rule, auto mode, a safety check, a hook or the sandbox stopped, prompted for or sent back. It follows version 2.1.300 on October 14, which added GenAI semantic-convention attributes to trace spans.
Two fixes touch auto mode. The /permissions > Recently denied view now shows the denied shell command, and the local auto mode classifier no longer ignores an approval made there when it checks a retried command; approving a row names the command instead of its description. And when Claude uses up its WebSearch budget, the notice now also tells it not to query search engines through a browser or computer use.
Runners and MCP
When an HTTP MCP connection closed mid-call, the tool call could go out twice; now only read-only or idempotent tools, the ones safe to run twice, are retried. On self-hosted runners, a checkout hook is stopped after 30 minutes by default and the session’s setup fails; raise --checkout-hook-timeout-min or set it to 0 if yours needs longer. Stopping the runner, or archiving or requeueing a session, during its checkout hook no longer leaves the hook’s processes running and the runner’s slot held. Unparseable tool calls are now retried up to twice before the turn ends with an error, and setModel() in the Agent SDK waits up to 15 seconds, instead of 5, for the API to confirm a model.
Our analysis
What we checked
On October 22 we searched the 2.1.307 linux-x64 binary for the new mode and the new event, and read the matching documentation pages.
The api-version mode is in the build and comes with its own migration reference file, though the Claude API skill’s docs page did not list it that day. The safety event splits interventions more finely than the five sources the release notes name, separating managed policy from permission rules and an auto mode block from a case with no verdict.
- The skill’s mode list includes
api-version, and the binary bundlesshared/api-version-migration.md. The platform docs page for the skill namespreserved-thinking-migration,managed-agents-onboardandmanaged-agents-secureas subcommands. - The monitoring docs at code.claude.com covered
tool_decisionbut notsafety_event. - Event attributes include
tool_class,tool_name,tool_use_id,sandbox_violation_countandsandbox_enabled. For tools on an internal list,tool_nameis replaced with"other_tool".classifier_categoryis sent only behind a gate we did not identify; its link toOTEL_LOG_TOOL_DETAILScomes from the documentation, not from a measurement. - Source values in code are
managed_policy,permission_rule,permission_mode,hook,auto_mode_blockandauto_mode_no_verdict, plus a safety-check branch. A hook that sends a call back is taggedpost_tool_useorpost_tool_use_failure.
Up next
Anthropicanalysis
Claude API’s first new version since 2023 drops temperature
“Even at the parameter’s default value”: Claude API version 2026-10-21 returns a 400 for any request that sets temperature, the first official version since 2023. Do your Claude calls still set temperature, or do you leave the default?
Related stories
- Claude Code 2.1.305 repairs requests on Vertex and Bedrock
- Claude Code 2.1.301 stops waiting out distant usage limits
- Claude Code 2.1.300 splits cache writes by lifetime in OTel
- Claude Code 2.1.299 compacts idle chats before cache expiry
- Subagents in Claude Code 2.1.296 can compact early
- Claude Code 2.1.295 hooks can fail closed when they break
Comments
No comments yet. Be the first.
Join the conversation
Sign in to leave a comment. It appears after moderation.

