Source · release

Claude Code release 2.1.307

Author
Anthropic
Published
21 October 2026
Added
22 October 2026
Original
https://github.com/anthropics/claude-code/releases/tag/v2.1.307

Summary

Claude Code 2.1.307 (2026-10-21, from the GitHub release feed) arrived on the same day as Claude API version 2026-10-21. It adds a bundled skill command that moves Claude API code to the new version, an OpenTelemetry event for every blocked or prompted tool call, and a Code Review command that ends an "always review" subscription. Most of the rest fixes MCP reliability, autocompaction, and self-hosted runners. The Agent SDKs were released the same day to match it (TypeScript 0.3.307, Python 0.2.171).

Key points

  • API version migration: run /claude-api api-version in a project that calls the Claude API. It rewrites the code for API version 2026-10-21. See API version 2026-10-21 for what changes.
  • Safety telemetry: a new claude_code.safety_event OpenTelemetry event is emitted each time a permission rule, auto mode, a safety check, a hook, or the sandbox stops, prompts, or sends back a tool call. It needs OpenTelemetry export to be set up, and lets you see in a dashboard why agents were blocked.
  • Code Review: comment @claude review stop (or off / pause) on a pull request to end an @claude review always subscription without starting a new review.
  • MCP fixes: HTTP MCP tool calls are no longer sent twice when the connection drops mid-call, because only read-only or idempotent tools are retried. Servers no longer stay "timed out" in headless runs after the computer sleeps. On macOS, claude -p now says why a server "needs authentication" when the keychain is locked. A turn no longer starts without an SDK MCP server's latest tools.
  • Robustness: an unparseable tool call is retried up to twice before the turn fails. Fewer "Autocompact is thrashing" errors in turns that read many PDF pages or images. Forks launched together are each told which launch is theirs, so they are less likely to do each other's work.
  • Settings: axScreenReader and CLAUDE_AX_SCREEN_READER in a settings env block now apply only from user, managed, or --settings settings, not from project files.
  • Self-hosted runners: checkout hooks now stop after 30 minutes by default and fail setup. Raise --checkout-hook-timeout-min, or set it to 0, if yours take longer.
  • Agent SDK (TypeScript) 0.3.307: adds wakeup_source (and scheduled_for) to the command_lifecycle start frame, so a host can tell whether a scheduled wakeup or a task fired. It also adds supportedDialogKinds to the browser SDK query().

Why it matters

The /claude-api api-version command is the quickest way to move a codebase to the new API version, which removes temperature, top_p, and top_k. The safety event lets teams measure how often guardrails fire. That is useful when tuning auto mode or hooks.