# Claude Code v2.1.307 adds safety event telemetry and fixes MCP retry behavior

published: 2026-10-22T12:05:39.824Z
topic: frameworks
source: https://github.com/anthropics/claude-code/releases/tag/v2.1.307
url: https://aiagentnews.io/stories/claude-code-v2-1-307-adds-safety-event-telemetry-and-fixes-mcp-retry-behavior

Anthropic released Claude Code v2.1.307, which adds a claude_code.safety_event OpenTelemetry event and moves Claude API code to API version 2026-10-21. The release also fixes several MCP server problems, including HTTP MCP tool calls being sent twice when a connection closed mid-call.

The release adds a claude_code.safety_event OpenTelemetry event that fires for each tool call stopped, prompted or sent back by a permission rule, auto mode, a safety check, a hook or the sandbox. The /claude-api command also moves its Claude API code to API version 2026-10-21.

On the MCP side, HTTP tool calls are now retried only when the tool is read-only or idempotent, which stops duplicate calls after a dropped connection. MCP servers that were reported as timed out after a laptop or computer slept now connect, and servers show a reason when the macOS login keychain is locked.

For self-hosted runners, checkout hooks now stop after 30 minutes by default, and operators who need longer can raise --checkout-hook-timeout-min or set it to 0. Model switches through the Agent SDK's setModel() now wait up to 15 seconds for the API to confirm, up from 5 seconds.

## Why it matters if you build agents

Teams that collect OpenTelemetry data can now record when a permission rule, hook or sandbox interrupted a tool call and why. Agents that call non-idempotent HTTP MCP tools will no longer have those calls silently replayed after a connection drops, so they should handle failures explicitly. Self-hosted runner operators with slow checkout hooks need to raise the timeout or set it to 0 before sessions start failing.
