Claude Code 2.1.307 adds safety events to OpenTelemetry and an API version helper
Claude Code 2.1.307 emits an event for each tool call that was stopped or prompted, and can move API code to version 2026-10-21. It affects teams that run Claude Code at scale.
what changed
Claude Code 2.1.307 was released on 21 October 2026. The changelog lists these changes among others.
- A new
claude_code.safety_eventOpenTelemetry event. It fires for each tool call that a permission rule, auto mode, a safety check, a hook or the sandbox stopped, prompted or sent back. - A new
/claude-api api-versioncommand that moves Claude API code to API version2026-10-21. - A fix so that HTTP MCP tool calls are no longer sent twice when the connection closes mid-call. Only read-only or idempotent tools are now retried.
- Better recovery from unparseable tool calls. Claude Code now retries the call up to twice before it ends the turn with an error.
- For self-hosted runners, checkout hooks now stop after 30 minutes by default and fail the session’s setup. You can raise
--checkout-hook-timeout-minor set it to0.
why it matters
The safety event gives platform teams a signal they did not have before. You can count how often guardrails fire, which rules fire most, and which teams hit them. That is the raw material for tuning permissions without guessing.
The MCP retry fix matters for anyone whose MCP tools change state. A tool call that ran twice could create a duplicate record or send a duplicate message. Now only safe calls are retried, so tool authors should be clear about which tools are idempotent.
The self-hosted runner timeout is a quiet breaking change. A slow checkout hook that used to finish late will now fail the session.
what we would do
- Send
claude_code.safety_eventto the same place as your other telemetry. Review the top rules each week and remove rules that only add noise. - Audit your MCP servers. Mark read-only tools clearly, and make write tools idempotent or safe to repeat.
- If you run self-hosted runners, time your checkout hooks now. Raise the timeout only for hooks that need it.
- Use the API version helper on a branch, and read the migration notes first.
sources
- Claude Code changelog, version 2.1.307 (Anthropic)
Drafted with Claude from the linked sources, reviewed by us.