Claude Code v2.1.307: /claude-api Version Control, Safety Event Telemetry, and MCP Reliability Fixes

✍️ OpenClawRadar📅 Published: October 22, 2026🔗 Source
Ad

Claude Code v2.1.307 ships two developer-facing additions — API version pinning for Claude API code and per-tool-call safety telemetry — alongside a long list of MCP, runner, and session-state fixes.

New: API version pinning and safety event telemetry

  • /claude-api api-version moves Claude API code to API version 2026-10-21. Useful when you need generated API calls to target a specific dated version rather than whatever the model defaults to.
  • A new OpenTelemetry event, claude_code.safety_event, fires for each tool call that a permission rule, auto mode, a safety check, a hook, or the sandbox stopped, prompted, or sent back. That gives you a structured trail of every intervention in your agent loops instead of inferring it from transcripts.

Notable fixes

  • 1M context aliases: requests no longer fail with model-not-found when CLAUDE_CODE_DISABLE_1M_CONTEXT is set and the model is an alias with the [1m] suffix, e.g. opus[1m].
  • Prompt caching: the prompt-caching-scope beta header is no longer sent behind custom ANTHROPIC_BASE_URL gateways or on Foundry, where it had no effect.
  • MCP auth on macOS: claude -p no longer reports "needs authentication" when the login keychain is locked — it says why, and the next run after unlock connects without a new sign-in.
  • MCP sleep/timeout: servers that were mid-connect while a macOS or Linux machine slept are no longer reported as timed out and stuck failed in headless runs.
  • HTTP MCP double calls: tool calls are no longer sent twice when the connection closes mid-call; only read-only or idempotent tools are retried.
  • SDK MCP tools: a turn no longer starts without an SDK MCP server's latest tools when a background task was running.
  • Autocompact: reduced "Autocompact is thrashing" errors in turns that read many PDF pages, images, or large tool results; /autocompact in cloud sessions also keeps its window across restarts.
  • /clear persistence: a conversation cleared with /clear no longer reappears after a cloud or self-hosted runner session restarts.
  • Agent SDK setModel(): model switches are no longer refused when the API takes more than 5 seconds to confirm — Claude Code now waits up to 15 seconds.
  • Permissions UI: /permissions > Recently denied now shows the denied shell command, and approving a row names the command rather than its description; auto mode's local classifier now honors that approval on a retried command.
  • GitHub MCP write tools: fixed a form that closed without creating anything in the desktop app's Code tab when the server is configured directly.
Ad

Other improvements

  • Unparseable tool calls are retried up to twice before the turn ends with an error.
  • Fork subagents launched together are each told which launch is their own, reducing cross-started work.
  • Browser sign-in shows the success page as soon as sign-in completes, without waiting on the account profile.
  • Web search 403 errors in cloud and self-hosted runner sessions now surface the server's reason instead of a generic "Authentication error".
  • Remote Control connect time improved for sessions with large pasted images or PDF reads.
  • The WebSearch budget-exhausted notice now also tells Claude not to query search engines via a browser or computer use.

Self-hosted runner users get two specific fixes: --use-anthropic-git-proxy sessions no longer commit a .claude/settings.local.json left in the clone by an earlier session, and archiving or requeueing a session during its checkout hook no longer leaves hook processes running and the runner's slot held.

📖 Read the full source: GitHub Claude-Code

Ad

👀 See Also