---
title: "Claude Code v2.1.307 | Havoptic"
description: "Claude Code 2.1.307 adds a safety event for every tool call that a permission rule, safety check, or hook stops or prompts, so you can see exactly what was blocked and why. It also fixes MCP servers t..."
image: "https://dev.havoptic.com/og-image.jpg"
---

# Claude Code v2.1.307

Claude Code v2.1.307 was released on October 21, 2026.

## Summary

Claude Code 2.1.307 adds a safety event for every tool call that a permission rule, safety check, or hook stops or prompts, so you can see exactly what was blocked and why. It also fixes MCP servers that were wrongly reported as timed out or needing sign-in, and stops HTTP too...

## Release Context

- This was the 249th Claude Code release of 2026 tracked by Havoptic.
- It shipped 1 day after [Claude Code v2.1.306](https://dev.havoptic.com/r/claude-code-2.1.306) (October 21, 2026).

### Shipped around the same time

Within 3 days of this release, other AI coding tools also shipped:

- [Antigravity CLI v1.4.7](https://dev.havoptic.com/r/antigravity-cli-1.4.7) (October 24, 2026)
- [Devin Desktop v3.11.216](https://dev.havoptic.com/r/windsurf-3.11.216) (October 24, 2026)
- [Factory Droid v0.249.0](https://dev.havoptic.com/r/factory-droid-0.249.0) (October 24, 2026)
- [Grok Build v1.0.70](https://dev.havoptic.com/r/grok-build-1.0.70) (October 23, 2026)
- [Zed v1.25.3](https://dev.havoptic.com/r/zed-1.25.3) (October 23, 2026)

### Compare Claude Code

- [Claude Code vs OpenAI Codex CLI](https://dev.havoptic.com/compare/claude-code-vs-openai-codex)
- [Claude Code vs Cursor](https://dev.havoptic.com/compare/claude-code-vs-cursor)
- [Claude Code vs Gemini CLI](https://dev.havoptic.com/compare/claude-code-vs-gemini-cli)
- [Claude Code vs Kiro CLI](https://dev.havoptic.com/compare/claude-code-vs-kiro)
- [Claude Code vs GitHub Copilot CLI](https://dev.havoptic.com/compare/claude-code-vs-github-copilot)
- [Claude Code vs Devin Desktop](https://dev.havoptic.com/compare/claude-code-vs-windsurf)
- [Claude Code vs Antigravity CLI](https://dev.havoptic.com/compare/antigravity-cli-vs-claude-code)
- [Claude Code vs Grok Build](https://dev.havoptic.com/compare/claude-code-vs-grok-build)
- [Claude Code vs Cline](https://dev.havoptic.com/compare/claude-code-vs-cline)
- [Claude Code vs OpenCode](https://dev.havoptic.com/compare/claude-code-vs-opencode)
- [Claude Code vs Zed](https://dev.havoptic.com/compare/claude-code-vs-zed)
- [Claude Code vs Factory Droid](https://dev.havoptic.com/compare/claude-code-vs-factory-droid)
- [Claude Code vs Devin](https://dev.havoptic.com/compare/claude-code-vs-devin)
- [Claude Code vs Lovable](https://dev.havoptic.com/compare/claude-code-vs-lovable)
- [Claude Code vs Amp](https://dev.havoptic.com/compare/amp-vs-claude-code)
- [Claude Code vs GitHub Copilot in VS Code](https://dev.havoptic.com/compare/claude-code-vs-copilot-vscode)
- [Claude Code vs Replit Agent](https://dev.havoptic.com/compare/claude-code-vs-replit-agent)
- [Claude Code vs Bolt](https://dev.havoptic.com/compare/bolt-vs-claude-code)
- [Claude Code vs v0](https://dev.havoptic.com/compare/claude-code-vs-v0)

## Release Notes

- Added /claude-api api-version to move Claude API code to API version 2026-10-21
- Added the claudecode.safetyevent OpenTelemetry event for each tool call a permission rule, auto mode, a safety check, a hook or the sandbox stopped, prompted or sent back
- Fixed requests failing with a model-not-found error when CLAUDECODEDISABLE1MCONTEXT is set and the model is an alias with the [1m] suffix, such as opus[1m]
- Fixed the prompt-caching-scope beta header being sent behind custom ANTHROPICBASEURL gateways and on Foundry, where it has no effect
- Fixed 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
- Fixed 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
- Fixed HTTP MCP tool calls being sent twice when the connection closed mid-call; only read-only or idempotent tools are now retried
- Fixed a turn sometimes starting without an SDK MCP server's latest tools when a background task was running
- Fixed some "Autocompact is thrashing" errors in turns that read many PDF pages, images or other large tool results
- Fixed /autocompact in cloud sessions going back to the default window after the session restarted
- Fixed a conversation cleared with /clear sometimes coming back when a cloud or self-hosted runner session restarted
- Fixed CLAUDESTREAMFIRSTBYTETIMEOUTMS being ignored in Claude apps gateway sessions
- Fixed telemetry from Claude Desktop sessions behind a Claude apps gateway being rejected when OTELEXPORTEROTLPHEADERS is set
- Fixed /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
- Fixed /help and the / command menu showing long model-facing descriptions for bundled skills such as /claude-api instead of their short descriptions
- Fixed subagent transcripts recording placeholder token usage and an empty stop reason for streamed responses
- Fixed 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
- Fixed a background command stopped through a connected app (such as the desktop app archiving an idle session) being reported to Claude as stopped by the user; the notice now names its output file
- Fixed 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
- Fixed write tools on a directly configured GitHub MCP server showing a form that closed without creating anything in the desktop app's Code tab
- Fixed Artifact tool reads failing with a connection reset when the server had closed a reused connection
- Self-hosted runner: Fixed sessions with --use-anthropic-git-proxy committing a .claude/settings.local.json left in the clone by an earlier session
- Self-hosted runner: Fixed 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
- Improved recovery from unparseable tool calls: Claude Code now retries the call up to twice before ending the turn with an error
- Improved fork subagents launched together: each is now told which launch is its own, so forks are much less likely to try to start each other's work
- Improved browser sign-in: the success page now appears as soon as sign-in completes, without waiting for your account profile to load
- Improved 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"
- Improved the time to the first reply in cloud sessions when one of the desktop app's MCP servers can't connect
- Improved Remote Control connect time for sessions whose transcript contains large pasted images or PDF reads
- Changed the notice Claude gets when the WebSearch budget is used up to also tell it not to query search engines in a browser or through computer use
- Changed the axScreenReader setting and CLAUDEAXSCREENREADER in a settings env block to apply only from user, managed or --settings settings (since 2.1.305)
- Self-hosted runner: Changed checkout hooks to be 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: Changed the certificate file built for Anthropic-managed git to filter its trusted certificates as the CLI does; a [runner:warn] line gives the number left out
- [VSCode] Added a notice on the microphone button when voice dictation stops by itself (15 seconds without recognized speech, or the 2-minute limit), saying why and that the text so far is kept
- [VSCode] Fixed 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] Fixed part of a list item or table cell with LaTeX math pasting as a new list or table in rich text editors
- [VSCode] Fixed dictation failing behind a TLS-inspecting proxy when NODEEXTRACACERTS is set only in ~/.claude/settings.json; it now also follows CLAUDECODECERTSTORE
- [VSCode] Changed the "still open somewhere else" notice to also cover a Claude process left over from an extension restart, which usually ends on its own within about 10 minutes
- [VSCode] Changed voice dictation to filter its trusted certificates as the CLI does
- [VSCode] Changed the extension's own requests to filter their trusted certificates as the CLI does, and to trust the NODEEXTRACACERTS file named in the environment or in user settings
- [Cloud sessions] Fixed the repository picker saying "No repositories match" while a search was still running; it now shows "Searching…" until the results arrive
- [Cloud sessions] Fixed 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
- [Code Review] Added @claude review stop (also off and pause) to Code Review, ending an @claude review always subscription on a pull request without starting a new review

[View original release](https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md#21307)

## Other Recent Claude Code Releases

- [v2.1.332](https://dev.havoptic.com/r/claude-code-2.1.332) (November 24, 2026)
- [v2.1.331](https://dev.havoptic.com/r/claude-code-2.1.331) (November 23, 2026)
- [v2.1.330](https://dev.havoptic.com/r/claude-code-2.1.330) (November 20, 2026)
- [v2.1.329](https://dev.havoptic.com/r/claude-code-2.1.329) (November 19, 2026)
- [v2.1.328](https://dev.havoptic.com/r/claude-code-2.1.328) (November 18, 2026)

Upgrading from v2.1.307? [See all 21 releases since](https://dev.havoptic.com/r/claude-code/diff?from=2.1.307&to=latest).

[All Claude Code releases](https://dev.havoptic.com/tools/claude-code) · [All AI coding tool releases on Havoptic](https://dev.havoptic.com/)

```json
{
  "@context": "https://schema.org",
  "@type": "WebSite",
  "name": "Havoptic",
  "alternateName": "Havoptic AI Tool Releases",
  "url": "https://www.havoptic.com/",
  "description": "Havoptic tracks every release of 20 AI coding tools, from Claude Code and Codex CLI to Cursor and Copilot CLI, and explains each one in plain English within hours of shipping.",
  "publisher": {
    "@type": "Organization",
    "name": "Havoptic",
    "url": "https://www.havoptic.com/"
  },
  "potentialAction": {
    "@type": "SearchAction",
    "target": "https://www.havoptic.com/?q={search_term_string}",
    "query-input": "required name=search_term_string"
  }
}
```

```json
{
  "@context": "https://schema.org",
  "@type": "SoftwareApplication",
  "name": "Havoptic",
  "applicationCategory": "DeveloperApplication",
  "operatingSystem": "Web",
  "offers": {
    "@type": "Offer",
    "price": "0",
    "priceCurrency": "USD"
  },
  "description": "Havoptic tracks every release of 20 AI coding tools, from Claude Code and Codex CLI to Cursor and Copilot CLI, and explains each one in plain English within hours of shipping."
}
```

```json
{
  "@context": "https://schema.org",
  "@type": "Organization",
  "@id": "https://www.havoptic.com/#organization",
  "name": "Havoptic",
  "url": "https://www.havoptic.com/",
  "logo": {
    "@type": "ImageObject",
    "url": "https://www.havoptic.com/og-image.jpg",
    "width": 1200,
    "height": 630
  },
  "description": "Release tracking, plain-English release notes and side-by-side comparisons for AI coding tools, updated hourly.",
  "foundingDate": "2025",
  "sameAs": [
    "https://github.com/scotthavird/havoptic.com",
    "https://x.com/havoptic"
  ],
  "founder": {
    "@id": "https://www.havoptic.com/authors/scott-havird#person"
  }
}
```

```json
{
  "@context": "https://schema.org",
  "@type": "DataCatalog",
  "@id": "https://www.havoptic.com/#data-catalog",
  "name": "Havoptic AI Coding Tool Release Data",
  "description": "Every release of 20 AI coding tools, dated and explained in plain English within hours of shipping, plus feature comparison matrices, free to query through an API, an MCP server, feeds and a CLI. Covers Claude Code, OpenAI Codex CLI, Cursor, Gemini CLI, Kiro, GitHub Copilot CLI, Devin Desktop, Antigravity CLI, Grok Build, Cline, OpenCode, Zed, Factory Droid, Devin (cloud agent), Lovable, Amp, GitHub Copilot in VS Code, Replit Agent, Bolt, and v0.",
  "url": "https://www.havoptic.com/api-docs",
  "publisher": {
    "@type": "Organization",
    "name": "Havoptic",
    "url": "https://www.havoptic.com/"
  },
  "dataset": [
    {
      "@type": "Dataset",
      "@id": "https://www.havoptic.com/data/releases.json",
      "name": "AI Coding Tool Releases",
      "description": "Complete release history for Claude Code, OpenAI Codex CLI, Cursor, Gemini CLI, Kiro, GitHub Copilot CLI, Devin Desktop, Antigravity CLI, Grok Build, Cline, OpenCode, Zed, Factory Droid, Devin (cloud agent), Lovable, Amp, GitHub Copilot in VS Code, Replit Agent, Bolt, and v0 — including version numbers, release dates, plain-English summaries, and full changelogs. Updated hourly.",
      "url": "https://www.havoptic.com/data/releases.json",
      "distribution": {
        "@type": "DataDownload",
        "encodingFormat": "application/json",
        "contentUrl": "https://www.havoptic.com/data/releases.json"
      },
      "temporalCoverage": "2025/..",
      "creator": {
        "@id": "https://www.havoptic.com/#organization"
      },
      "maintainer": {
        "@type": "Organization",
        "name": "Havoptic",
        "url": "https://www.havoptic.com/"
      },
      "isAccessibleForFree": true,
      "license": "https://creativecommons.org/licenses/by/4.0/",
      "keywords": [
        "Claude Code",
        "OpenAI Codex CLI",
        "Cursor",
        "Gemini CLI",
        "Kiro",
        "GitHub Copilot CLI",
        "Devin Desktop",
        "Windsurf",
        "Antigravity CLI",
        "Grok Build",
        "Cline",
        "OpenCode",
        "Zed",
        "Factory Droid",
        "Devin (cloud agent)",
        "Lovable",
        "Amp",
        "GitHub Copilot in VS Code",
        "Replit Agent",
        "Bolt",
        "v0",
        "AI coding tools",
        "release history",
        "changelogs"
      ]
    },
    {
      "@type": "Dataset",
      "@id": "https://www.havoptic.com/data/feature-matrix.json",
      "name": "AI Coding Tool Feature Matrix",
      "description": "Side-by-side feature comparison data for 20 AI coding tools across categories: Core Editing, Terminal Integration, MCP Support, IDE Integrations, and Agentic Features.",
      "url": "https://www.havoptic.com/data/feature-matrix.json",
      "distribution": {
        "@type": "DataDownload",
        "encodingFormat": "application/json",
        "contentUrl": "https://www.havoptic.com/data/feature-matrix.json"
      },
      "creator": {
        "@id": "https://www.havoptic.com/#organization"
      },
      "maintainer": {
        "@type": "Organization",
        "name": "Havoptic",
        "url": "https://www.havoptic.com/"
      },
      "isAccessibleForFree": true,
      "license": "https://creativecommons.org/licenses/by/4.0/",
      "keywords": [
        "AI coding tools",
        "feature comparison",
        "Claude Code",
        "Cursor",
        "GitHub Copilot",
        "Gemini CLI",
        "Devin Desktop",
        "Windsurf"
      ]
    }
  ]
}
```

```json
{
  "@context": "https://schema.org",
  "@type": "BreadcrumbList",
  "itemListElement": [
    {
      "@type": "ListItem",
      "position": 1,
      "name": "Home",
      "item": "https://dev.havoptic.com"
    },
    {
      "@type": "ListItem",
      "position": 2,
      "name": "Claude Code",
      "item": "https://dev.havoptic.com/tools/claude-code"
    },
    {
      "@type": "ListItem",
      "position": 3,
      "name": "v2.1.307",
      "item": "https://dev.havoptic.com/r/claude-code-2.1.307"
    }
  ]
}
```

```json
{
  "@context": "https://schema.org",
  "@type": "TechArticle",
  "headline": "Claude Code v2.1.307",
  "datePublished": "2026-10-21T20:47:18.383Z",
  "dateModified": "2026-10-21T20:47:18.383Z",
  "url": "https://dev.havoptic.com/r/claude-code-2.1.307",
  "image": "https://dev.havoptic.com/og-image.jpg",
  "description": "Claude Code 2.1.307 adds a safety event for every tool call that a permission rule, safety check, or hook stops or prompts, so you can see exactly what was blocked and why. It also fixes MCP servers t...",
  "isBasedOn": "https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md#21307",
  "about": {
    "@type": "SoftwareApplication",
    "name": "Claude Code",
    "softwareVersion": "2.1.307",
    "applicationCategory": "DeveloperApplication",
    "url": "https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md#21307",
    "releaseNotes": "- Added /claude-api api-version to move Claude API code to API version 2026-10-21 - Added the claudecode.safetyevent OpenTelemetry event for each tool call a permission rule, auto mode, a safety check, a hook or the sandbox stopped, prompted or sent back - Fixed requests failing with a model-not-found error when CLAUDECODEDISABLE1MCONTEXT is set and the model is an alias with the [1m] suffix, such as opus[1m] - Fixed the prompt-caching-scope beta header being sent behind custom ANTHROPICBASEURL gateways and on Foundry, where it has no effect - Fixed 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 - Fixed 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 - Fixed HTTP MCP tool calls being sent twice when the connection closed mid-call; only read-only or idempotent tools are now retried - Fixed a turn sometimes starting without an SDK MCP server's latest tools when a background task was running - Fixed some \"Autocompact is thrashing\" errors in turns that read many PDF pages, images or other large tool results - Fixed /autocompact in cloud sessions going back to the default window after the session restarted - Fixed a conversation cleared with /clear sometimes coming back when a cloud or self-hosted runner session restarted - Fixed CLAUDESTREAMFIRSTBYTETIMEOUTMS being ignored in Claude apps gateway sessions - Fixed telemetry from Claude Desktop sessions behind a Claude apps gateway being rejected when OTELEXPORTEROTLPHEADERS is set - Fixed /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 - Fixed /help and the / command menu showing long model-facing descriptions f"
  },
  "articleBody": "- Added /claude-api api-version to move Claude API code to API version 2026-10-21 - Added the claudecode.safetyevent OpenTelemetry event for each tool call a permission rule, auto mode, a safety check, a hook or the sandbox stopped, prompted or sent back - Fixed requests failing with a model-not-found error when CLAUDECODEDISABLE1MCONTEXT is set and the model is an alias with the [1m] suffix, such as opus[1m] - Fixed the prompt-caching-scope beta header being sent behind custom ANTHROPICBASEURL gateways and on Foundry, where it has no effect - Fixed 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 - Fixed 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 - Fixed HTTP MCP tool calls being sent twice when the connection closed mid-call; only read-only or idempotent tools are now retried - Fixed a turn sometimes starting without an SDK MCP server's latest tools when a background task was running - Fixed some \"Autocompact is thrashing\" errors in turns that read many PDF pages, images or other large tool results - Fixed /autocompact in cloud sessions going back to the default window after the session restarted - Fixed a conversation cleared with /clear sometimes coming back when a cloud or self-hosted runner session restarted - Fixed CLAUDESTREAMFIRSTBYTETIMEOUTMS being ignored in Claude apps gateway sessions - Fixed telemetry from Claude Desktop sessions behind a Claude apps gateway being rejected when OTELEXPORTEROTLPHEADERS is set - Fixed /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 - Fixed /help and the / command menu showing long model-facing descriptions for bundled skills such as /claude-api instead of their short descriptions - Fixed subagent transcripts recording placeholder token usage and an empty stop reason for streamed responses - Fixed 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 - Fixed a background command stopped through a connected app (such as the desktop app archiving an idle session) being reported to Claude as stopped by the user; the notice now names its output file - Fixed 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 - Fixed write tools on a directly configured GitHub MCP server showing a form that closed without creating anything in the desktop app's Code tab - Fixed Artifact tool reads failing with a connection reset when the server had closed a reused connection - Self-hosted runner: Fixed sessions with --use-anthropic-git-proxy committing a .claude/settings.local.json left in the clone by an earlier session - Self-hosted runner: Fixed 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 - Improved recovery from unparseable tool calls: Claude Code now retries the call up to twice before ending the turn with an error - Improved fork subagents launched together: each is now told which launch is its own, so forks are much less likely to try to start each other's work - Improved browser sign-in: the success page now appears as soon as sign-in completes, without waiting for your account profile to load - Improved 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\" - Improved the time to the first reply in cloud sessions when one of the desktop app's MCP servers can't connect - Improved Remote Control connect time for sessions whose transcript contains large pasted images or PDF reads - Changed the notice Claude gets when the WebSearch budget is used up to also tell it not to query search engines in a browser or through computer use - Changed the axScreenReader setting and CLAUDEAXSCREENREADER in a settings env block to apply only from user, managed or --settings settings (since 2.1.305) - Self-hosted runner: Changed checkout hooks to be 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: Changed the certificate file built for Anthropic-managed git to filter its trusted certificates as the CLI does; a [runner:warn] line gives the number left out - [VSCode] Added a notice on the microphone button when voice dictation stops by itself (15 seconds without recognized speech, or the 2-minute limit), saying wh",
  "author": {
    "@id": "https://dev.havoptic.com/#organization"
  },
  "publisher": {
    "@id": "https://dev.havoptic.com/#organization"
  },
  "mainEntityOfPage": {
    "@type": "WebPage",
    "@id": "https://dev.havoptic.com/r/claude-code-2.1.307"
  },
  "speakable": {
    "@type": "SpeakableSpecification",
    "cssSelector": [
      "h1",
      "#ssr-content p"
    ]
  }
}
```
