AnthropicReleases

· Power user · Claude Code

Illustration: a plain wooden pencil with an eraser, lying on a diagonal, on black.
Illustration

Claude Code 2.1.307 can move your code to the new Claude API version

A new /claude-api api-version command does the migration Anthropic shipped on Wednesday, and a fix stops some HTTP MCP tool calls from running twice.

If you have Claude API code to move to the new API version, update Claude Code and run /claude-api api-version. Claude Code 2.1.307, out Wednesday afternoon, added the command "to move Claude API code to API version 2026-10-21," per the CHANGELOG. It follows Wednesday's API version release, and Anthropic's developer account pointed to it the same day: "You can use the /claude-api skill in Claude Code to update, or walk through each change in the migration guide."

What changed#

Version 2.1.307 reached npm at 4:47 PM ET Wednesday. 2.1.308 followed at 12:19 AM ET Thursday with only "Bug fixes and reliability improvements." When we checked at 5:56 AM ET Thursday, stable, latest and next all pointed to 2.1.308. For 2.1.304 to 2.1.306, see our Oct 21 story.

Before 2.1.3072.1.307 and later
Moving code to a new API versionBy hand, from the migration guide/claude-api api-version updates the code, then switches requests to the new version
HTTP MCP tool call when the connection closes mid-callCould be sent twiceOnly read-only or idempotent tools are retried
Tool calls a rule, auto mode, a safety check, a hook or the sandbox stopped, prompted or sent backNo dedicated event in the CHANGELOGOne claude_code.safety_event OpenTelemetry event per call
Unparseable tool callEnded the turn with an errorRetried up to twice first

Why it matters#

The new API version breaks code that sends sampling parameters, as we covered in what breaks and how to upgrade. @ClaudeDevs said Anthropic plans "to release versions more often so you can handle breaking changes before a new model requires them." Our read: if that happens, a repeatable migration command saves work on every future version, not just this one.

The MCP fix matters if your agents write to other systems. Our read: a tool call sent twice could, for example, open a ticket twice. The CHANGELOG says 2.1.307 "Fixed HTTP MCP tool calls being sent twice when the connection closed mid-call."

How to use it#

  1. Run claude update, then claude --version, and confirm 2.1.307 or later.
  2. On a new branch, map the work first with this prompt (ours, untested):
Before you change anything, list every file in this repo that calls the Claude API, which SDK and version it uses, and every place that sends temperature, top_p or top_k. Flag any call to a model older than Claude 4.7 on Amazon Bedrock. Then stop and wait for me.
  1. Run /claude-api api-version.
  2. Read the diff, then run your tests. The migration guide lists the first SDK versions that use 2026-10-21 and says to "upgrade to them," so expect a dependency bump.

Good to know#

  • Check the diff against the known breaks. The two to watch are a removed temperature on models such as Claude Sonnet 4.6, and pre-4.7 models on Amazon Bedrock, which can't move. Both are in our Oct 21 story.
  • You don't have to move yet. @ClaudeDevs wrote: "2023-06-01 is not deprecated."
  • It is a prompt, not a script. The skills docs say bundled skills "are prompt-based." Treat the result as a pull request to review.
  • The new event isn't documented yet. At 5:56 AM ET Thursday the monitoring docs, which cover turning on telemetry with CLAUDE_CODE_ENABLE_TELEMETRY=1, had no safety_event, so its fields are unknown. Don't build alerts on it yet.

What to watch: when the monitoring docs describe claude_code.safety_event, and when Anthropic ships its next API version.

Steps

  1. Update with claude update (or npm i -g @anthropic-ai/claude-code@latest) and confirm claude --version shows 2.1.307 or later.
  2. Open Claude Code in the repository that calls the Claude API, on a new branch.
  3. Run /claude-api api-version and let it update the code and switch requests to 2026-10-21.
  4. Review the diff, especially any removed temperature, top_p or top_k, and any calls to pre-4.7 models on Amazon Bedrock.
  5. Run your tests against 2026-10-21 before you merge.

Sources

  1. github.com
  2. registry.npmjs.org
  3. code.claude.com
  4. platform.claude.com
  5. x.com
  6. x.com
  7. code.claude.com

Something wrong? Tell the bot