AI

Claude Code v2.1.328 Adds Auto Mode and MCP Hook Improvements

Anthropic released Claude Code v2.1.328 with auto mode support for newer models on multiple platforms and enhanced MCP tool hook configuration.

3 min readSource: Claude Code Releases

Curated by Kandala Guruprasad. Drafted with AI and checked against the source.

Claude Code v2.1.328 Adds Auto Mode and MCP Hook Improvements

TL;DR

  • Auto mode now available for Claude Opus 4.6 and Sonnet 4.6 on Amazon Bedrock, Google Cloud Agent Platform, Microsoft Foundry, and Claude apps gateway
  • MCP tool hooks now support 'onFailure': 'block' to block actions when hook calls fail, matching command and HTTP hook behavior
  • New CLAUDE_CODE_DISABLE_DEFERRED_TOOL_RESUME flag lets hosts prevent deferred tool calls from resuming via -p --resume and --continue
  • Extensive bug fixes addressing session handling, markdown rendering, permission prompts, Remote Control disconnections, and keyboard input across multiple platforms
Version
v2.1.328
Release Date
November 19
Key Addition
Auto mode for Opus/Sonnet 4.6

What changed

Claude Code v2.1.328 brings auto mode support to Claude Opus 4.6 and Sonnet 4.6 across multiple deployment platforms, including Amazon Bedrock, Google Cloud's Agent Platform, Microsoft Foundry, and the Claude apps gateway. Interactive sessions without a permission mode now start in auto mode by default on these platforms.

MCP (Model Context Protocol) tool hooks gain new failure handling capabilities. The release adds support for 'onFailure': 'block' on mcp_tool hooks, allowing a failed hook call to block the action, bringing parity with command and HTTP hook behavior.

A new environment variable, CLAUDE_CODE_DISABLE_DEFERRED_TOOL_RESUME, gives hosts the ability to prevent deferred tool calls from resuming when using claude -p --resume and --continue. This provides finer control over tool execution in deferred scenarios.

Self-hosted runner and configuration updates

Self-hosted runner deployments receive several new options and monitoring capabilities. The --repository-folder flag allows naming the folder that sessions use for a repository at --capacity 1, replacing its path under the base folder. A new start-up warning alerts when settings.json defines a default permission mode that sessions ignore.

The orchestrator gains --hook-label support to pass chosen session labels to the spawn-runner hook, and --metadata key=value lets you label sessions for the spawn-runner hook. Monitoring improves with two new metrics: claude_code_self_hosted_orchestrator_session_queue_wait_by_reason_seconds distinguishes between re-opened and new session waits, and claude_code_self_hosted_orchestrator_sessions_given_up_total counts how often Anthropic gave up starting a runner by cause.

Apps that embed Claude Code can now switch on the policy plugin's allowManagedModsOnly option, though admin managed settings still take precedence. A startup warning appears on the Claude apps gateway when a policy's maxEffortLevel is not a valid effort level.

Session, messaging, and UI fixes

The release resolves numerous issues affecting session stability and user experience. Cloud session resumption now correctly preserves compaction summaries and recent messages, fixes for Remote Control address lost tool calls and results when runners or workers are lost, and cloud sessions now properly learn when replies can come after resuming. Improvements to cross-session messaging ensure sessions with Remote Control enabled are reachable, and the model is correctly informed about session capability.

Keyboard and input handling receive widespread corrections. Fixed issues include Bash commands in zsh failing on words starting with =, Esc being lost at permission prompts when typed immediately after, and pasted text or terminal replies being incorrectly typed into prompts on slow connections. Terminal-specific fixes cover Cmd+letter input in certain terminals, Shift+Enter in Konsole outside tmux, Alt shortcuts on non-Latin keyboard layouts, and Linux clipboard handling with xclip or wl-copy.

Code Mode improvements address script execution and variable handling. Scripts in auto and bypass permissions modes now run in the background correctly, the model is told when Code Mode scripts are cut off after session resumption, and previously undefined top-level variables no longer silently become undefined. Code Mode now accepts scripts starting with a block and scripts using both top-level await and return, while refusing requests correctly when a command's output is too long.

Telemetry, error handling, and plugin stability

Telemetry and error reporting receive updates to prevent data loss. A notice in /status and claude doctor alerts when an OpenTelemetry exporter lacks an endpoint, preventing silent data loss. The error shown when usage credits run out mid-response no longer incorrectly references a rate limit.

Plugin and configuration tools see fixes for save and reload timing. Scheduled task saving no longer erases other saved tasks when the file cannot be read, and a scheduled task with typos in the project file is no longer deleted on next save. Plugins no longer reload mid-turn when saved right as a turn begins, and the /plugin interface correctly handles search results, keyboard input, and plugin state changes.

Additional fixes improve markdown rendering performance on malformed or very long input, eliminate rare screen freezes, correct token counting for retried replies and subagents, and ensure /diff and Remote Control changes show committed work after repository navigation. Auto mode failures outside Claude Desktop with CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS set behind a gateway rejecting betas are resolved.

Source

Claude Code Releaseshttps://github.com/anthropics/claude-code/releases/tag/v2.1.328

AI-assisted, verified against the source. This post was drafted with AI from the primary source linked above and checked automatically against it. For anything you depend on, read the original.

  • #claudecode
  • #ai
  • #api
  • #automode
  • #agents

More in AI