
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.307 | 2.1.307 and later | |
|---|---|---|
| Moving code to a new API version | By 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-call | Could be sent twice | Only 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 back | No dedicated event in the CHANGELOG | One claude_code.safety_event OpenTelemetry event per call |
| Unparseable tool call | Ended the turn with an error | Retried 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#
- Run
claude update, thenclaude --version, and confirm 2.1.307 or later. - 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.
- Run
/claude-api api-version. - Read the diff, then run your tests. The migration guide lists the first SDK versions that use
2026-10-21and 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
temperatureon 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 nosafety_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
- Update with claude update (or npm i -g @anthropic-ai/claude-code@latest) and confirm claude --version shows 2.1.307 or later.
- Open Claude Code in the repository that calls the Claude API, on a new branch.
- Run /claude-api api-version and let it update the code and switch requests to 2026-10-21.
- Review the diff, especially any removed temperature, top_p or top_k, and any calls to pre-4.7 models on Amazon Bedrock.
- Run your tests against 2026-10-21 before you merge.