Claude Code fixes a bug that could send the same tool action twice

Claude Code fixes a bug that could send the same tool action twice

Anthropic has fixed a Claude Code bug that could send an HTTP-based MCP tool call twice when the connection closed partway through it. The change restricts automatic retries to tools marked as read-only or safe to repeat.

Claude Code running in a terminal

Claude Code’s terminal interface. Image: Anthropic

The correction appears in Claude Code 2.1.307, alongside fixes for authentication, cloud-session persistence and permission displays. It addresses a specific retry failure, rather than changing what an agent is authorised to do.

Retrying an interrupted action is only safe for some tools

MCP lets Claude Code connect to external tools and services. When a connection fails midway through an action, the client may not know whether the other end already completed the request.

Claude Code running in a browser

Claude Code running in a browser. Image: Anthropic

Repeating a lookup is usually different from repeating an operation that changes something. Anthropic now limits these HTTP retries to read-only or idempotent tools, meaning tools designed so that repeating the operation does not add another effect.

The release notes do not identify particular services that suffered duplicate changes or quantify how often the problem occurred. The confirmed fix concerns the conditions under which Claude Code resends a tool call.

It follows earlier work on Claude Code's MCP connections, although this update targets HTTP tools rather than the separate stdio transport.

A Claude Code session reading a file and writing a test

A Claude Code session reading code and writing a test; the update addresses repeated tool actions. Image: Anthropic

Other fixes make failed connections and permissions easier to understand

On macOS, a locked login keychain could make MCP servers appear to need authentication. Claude Code now explains that cause, and the next run after unlocking can connect without requiring another sign-in.

The update also fixes connections incorrectly remaining failed after a macOS or Linux computer went to sleep while an MCP server was connecting.

In cloud or self-hosted sessions, a conversation cleared with /clear could sometimes return after a restart; that has been corrected. The recently denied permissions view also now shows the actual denied shell command, making it clearer what a user is approving when retrying an operation.

Leave a Comment

Your email address will not be published. Required fields are marked *