claudekit / updates / claude-code-2-1-307
[ PATCH · ]

Claude Code 2.1.307

Adds `/claude-api api-version` to move Claude API code to API version `2026-10-21`, and a `claude_code.safety_event` OpenTelemetry event for each tool call a permission rule, auto mode, a safety check, a hook or the sandbox stopped, prompted or sent back. Also fixes HTTP MCP tool calls being sent twice and MCP servers failing while the macOS login keychain was locked or the computer went to sleep.

Official announcement →

This article is a summary based on official documentation.

What changed

Claude Code 2.1.307 shipped on October 21, 2026. It adds /claude-api api-version for moving Claude API code to a new API version, a claude_code.safety_event OpenTelemetry event for tool calls that a safety mechanism stopped, prompted or sent back, and @claude review stop for Code Review. The fixes span MCP server connections and retries, autocompact and cloud sessions, the permissions menu, subagents and the Agent SDK, the desktop app and Cowork, self-hosted runners and the VS Code extension.

New features

  • /claude-api api-version

    Moves Claude API code to API version 2026-10-21. This is the API version your code calls, not the Claude Code version.

  • claude_code.safety_event OpenTelemetry event

    Emitted for each tool call a permission rule, auto mode, a safety check, a hook or the sandbox stopped, prompted or sent back, so you can see in your monitoring which mechanism acted on which call.

  • [VSCode] Notice when voice dictation stops by itself

    When voice dictation stops on its own (15 seconds without recognized speech, or the 2-minute limit), the microphone button now says why and that the text so far is kept.

  • [Code Review] @claude review stop

    @claude review stop (also off and pause) ends an @claude review always subscription on a pull request without starting a new review.

Key improvements

  • Recovery from unparseable tool calls

    Claude Code now retries an unparseable tool call up to twice before ending the turn with an error.

  • Fork subagents launched together

    Each fork subagent is now told which launch is its own, so forks are much less likely to try to start each other’s work.

  • Browser sign-in

    The success page now appears as soon as sign-in completes, without waiting for your account profile to load.

  • Web search errors in cloud and self-hosted runner sessions

    A search refused with a 403 that gives a reason now shows that reason instead of a generic “Authentication error”.

  • Time to first reply in cloud sessions

    Faster when one of the desktop app’s MCP servers can’t connect.

  • Remote Control connect time

    Faster for sessions whose transcript contains large pasted images or PDF reads.

Changed behavior

  • WebSearch budget notice

    When the WebSearch budget is used up, the notice Claude gets now also tells it not to query search engines in a browser or through computer use.

  • axScreenReader scope

    The axScreenReader setting and CLAUDE_AX_SCREEN_READER in a settings env block apply only from user, managed or --settings settings. This has been the case since 2.1.305.

  • [Self-hosted runner] Checkout hook timeout

    Checkout hooks are now stopped after 30 minutes by default, failing the session’s setup. If yours needs longer, raise --checkout-hook-timeout-min or set it to 0.

  • [Self-hosted runner] Certificates for Anthropic-managed git

    The certificate file built for Anthropic-managed git now filters its trusted certificates as the CLI does; a [runner:warn] line gives the number left out.

  • [VSCode] “Still open somewhere else” notice

    Now also covers a Claude process left over from an extension restart, which usually ends on its own within about 10 minutes.

  • [VSCode] Certificate handling

    Voice dictation and the extension’s own requests now filter their trusted certificates as the CLI does. The extension’s requests also trust the NODE_EXTRA_CA_CERTS file named in the environment or in user settings.

Bug fixes

Models & gateways

  • Requests failing 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 being sent behind custom ANTHROPIC_BASE_URL gateways and on Foundry, where it has no effect.

MCP

  • MCP servers showing “needs authentication” in claude -p on macOS while the login keychain was locked; they now say why, and the next run after an unlock connects without a new sign-in.
  • MCP servers being reported as timed out, and staying failed in headless runs, when a macOS or Linux computer went to sleep while they were connecting.
  • HTTP MCP tool calls being sent twice when the connection closed mid-call; only read-only or idempotent tools are now retried.
  • A turn sometimes starting without an SDK MCP server’s latest tools when a background task was running.

Autocompact & cloud sessions

  • Some “Autocompact is thrashing” errors in turns that read many PDF pages, images or other large tool results.
  • /autocompact in cloud sessions going back to the default window after the session restarted.
  • A conversation cleared with /clear sometimes coming back when a cloud or self-hosted runner session restarted.
  • CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS being ignored in Claude apps gateway sessions.
  • Telemetry from Claude Desktop sessions behind a Claude apps gateway being rejected when OTEL_EXPORTER_OTLP_HEADERS is set.

Permissions & command menu

  • /permissions > Recently denied not showing the denied shell command, and auto mode’s local classifier ignoring an approval from there when it checks a retried command; approving a row now names the command, not its description.
  • /help and the / command menu showing long model-facing descriptions for bundled skills such as /claude-api instead of their short descriptions.

Subagents & Agent SDK

  • Subagent transcripts recording placeholder token usage and an empty stop reason for streamed responses.
  • Model switches through the Agent SDK’s setModel(), and apps built on it, being refused when the API took more than 5 seconds to confirm the model; Claude Code now waits up to 15 seconds.

Desktop app & Cowork

  • A background command stopped through a connected app being reported to Claude as stopped by the user (such as the desktop app archiving an idle session); the notice now names its output file.
  • WebFetch in Cowork cloud sessions reporting a tool error when a site answered with a 4xx status or a robots.txt refusal; it is now a normal result, as in local sessions.
  • Write tools on a directly configured GitHub MCP server showing a form that closed without creating anything in the desktop app’s Code tab.
  • Artifact tool reads failing with a connection reset when the server had closed a reused connection.

Self-hosted runner

  • Sessions with --use-anthropic-git-proxy committing a .claude/settings.local.json left in the clone by an earlier session.
  • Archiving or requeueing a session, or stopping the runner, during its checkout hook leaving the hook’s processes running and the runner’s slot held.

VS Code extension & cloud sessions

  • [VSCode] A long prompt expanded with Show more covering the whole chat panel; a pinned prompt is now capped at 40% of the panel and scrolls.
  • [VSCode] Part of a list item or table cell with LaTeX math pasting as a new list or table in rich text editors.
  • [VSCode] Dictation failing behind a TLS-inspecting proxy when NODE_EXTRA_CA_CERTS is set only in ~/.claude/settings.json; it now also follows CLAUDE_CODE_CERT_STORE.
  • [Cloud sessions] The repository picker saying “No repositories match” while a search was still running; it now shows “Searching…” until the results arrive.
  • [Cloud sessions] The “Waiting for a runner” status on self-hosted environments being cut off; with on-demand runners it now counts up from your last message and shows failed attempts.

Notes

  • If you need to move Claude API code to a newer API version, /claude-api api-version moves it to API version 2026-10-21.
  • If your HTTP MCP servers have tools that are not read-only or idempotent, they are no longer retried when the connection closes mid-call. The call won’t run twice, but it may now surface as a failure.
  • If a self-hosted runner checkout hook takes longer than 30 minutes, session setup now fails. Raise --checkout-hook-timeout-min or set it to 0.
  • If you set axScreenReader or CLAUDE_AX_SCREEN_READER in project settings, it hasn’t applied since 2.1.305. Move it to user, managed or --settings settings.
  • If a pull request has @claude review always on, @claude review stop now turns it off.