# Claude Code 2.1.307

By Steven Van · 2026-10-21

The release adds an API version migration command and a safety-event telemetry signal, plus fixes for MCP connections on macOS and Linux.

Claude Code 2.1.307 adds a command for moving Claude API code to a newer API version and a new OpenTelemetry event for safety interventions. It also fixes several MCP and model-configuration bugs. The changelog entry is on [GitHub](<https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md#21307>), and the product page for [Claude Code](<https://creatorstoolbox.com/tools/claude-code>) is on this site.

## What was added

- /claude-api api-version moves Claude API code to API version 2026-10-21.

- The claude\_code.safety\_event OpenTelemetry event is emitted for each tool call that a permission rule, auto mode, a safety check, a hook or the sandbox stopped, prompted or sent back.

## Fixes

- Requests no longer fail with a model-not-found error when CLAUDE\_CODE\_DISABLE\_1M\_CONTEXT is set and the model is an alias with the \[1m\] suffix, such as opus\[1m\].

- The prompt-caching-scope beta header is no longer sent behind custom ANTHROPIC\_BASE\_URL gateways or on Foundry, where it has no effect.

- A turn no longer sometimes starts without an SDK MCP server's latest tools when a background task is running.

## MCP connection fixes

- On macOS, MCP servers no longer show "needs authentication" in claude -p while the login keychain is locked. They now say why, and the next run after an unlock connects without a new sign-in.

- MCP servers are no longer reported as timed out, or left failed in headless runs, when a macOS or Linux computer went to sleep while they were connecting.

- HTTP MCP tool calls are no longer sent twice when the connection closes mid-call. Only read-only or idempotent tools are now retried.

![Claude Code](<https://claude.com/images/icon-512x512.png>)

Claude Code

Anthropic's agentic coding tool — Claude in your terminal, IDE, desktop app and browser, reading and editing your codebase, running commands, opening pull requests and working on tasks in the cloud.

[View Claude Code →](<https://creatorstoolbox.com/tools/claude-code>)

Sources

[Original source](<https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md#21307>)

[Read Claude Code 2.1.307 on Creators Toolbox](<https://creatorstoolbox.com/blog/claude-code-claude-code-2-1-307>)

---
Canonical source: https://creatorstoolbox.com/blog/claude-code-claude-code-2-1-307
