Key Updates in Claude Code v2.1.328 - Added onFailure to the mcp_tool Hook and Changes to the Reporting Scope of /code-review

Key Updates in Claude Code v2.1.328 - Added onFailure to the mcp_tool Hook and Changes to the Reporting Scope of /code-review

A look at the main updates in Claude Code v2.1.328. Setting onFailure: block on an mcp_tool hook stops the operation when an MCP server call fails. /code-review now reports only bugs and CLAUDE.md violations on most models.
2026.11.19

This page has been translated by machine translation. View original

I'm Ishikawa from the Cloud Business Division. Claude Code v2.1.328 was released on November 18, 2026. This release includes changes that affect everyday usage and hook configuration, such as a change to what /code-review reports and the addition of onFailure to mcp_tool hooks.

Here is the previous update article.

https://dev.classmethod.jp/articles/20261118-cc-updates-v2-1-327/

Update Summary

v2.1.328 includes 144 changes. Under this article's classification, they break down into 91 fixes, 24 improvements, 12 new features, 7 performance changes, 6 security changes, and 4 breaking changes / default behavior changes.

By area, there are 22 changes related to Code Mode, 26 related to the self-hosted runner, and 13 related to third-party providers such as Bedrock.

Notable Updates

onFailure for mcp_tool hooks

You can now specify "onFailure": "block" in mcp_tool hooks. As with command hooks and HTTP hooks, if the hook call fails, the action that triggered the hook is blocked. If you don't specify onFailure, the behavior is unchanged: the action runs even if the hook call fails.

I feel that organizations implementing policy checks on MCP servers can now explicitly decide how to handle a failed hook call.

What /code-review reports

For most models, /code-review now reports only bugs and CLAUDE.md violations. Run /simplify for reuse, simplification, and efficiency cleanups. In addition, each finding is now labeled Important / Pre-existing / Nit, and a suggested fix is shown at the end of each summary. The official documentation describes /simplify as a command that reviews only from a cleanup perspective and applies fixes.

If you previously received reuse, simplification, and efficiency findings from /code-review, I think it's a good idea to change your workflow to also run /simplify, while keeping in mind that it applies the fixes as well.

Fixed commands containing words that start with = hanging in zsh

Fixed an issue in zsh where a Bash command containing a word starting with =, such as echo ==== or [ a == b ], stopped with a "not found" error. With this fix, =cmd is no longer expanded to the command's path.

In zsh environments, commands that print separator lines or include comparisons like [ a == b ] can now run without being rewritten, which I feel is an unobtrusive but helpful fix.

Fixed scheduled tasks disappearing

Fixed an issue where, when using a third-party provider or when telemetry or feature flags are disabled, saving a task while the scheduled tasks file could not be loaded deleted the project's other saved tasks. Also fixed an issue where a task with a typo in the file was deleted the next time the file was saved.

If you use scheduled tasks with a third-party provider or with telemetry disabled, I think it's best to update early to avoid losing tasks.

Scope of claude.ai connector entries in deniedMcpServers

deniedMcpServers entries in the claude.ai <name> format now also apply to connectors in cloud sessions and self-hosted runner sessions.

Administrators who block claude.ai connectors with deniedMcpServers will now have the same setting applied in cloud sessions and self-hosted runners as well, so I think it's worth rechecking the scope of application.

auto mode support for Opus 4.6 / Sonnet 4.6 on Bedrock and others

Claude Opus 4.6 and Sonnet 4.6 now support auto mode on Amazon Bedrock, Google Cloud's Agent Platform, Microsoft Foundry, and the Claude apps gateway. Interactive sessions that don't specify a permission mode start in auto mode.

In addition, for Opus 4.6 / Sonnet 4.6 on third-party providers, plan mode and the Bash permission prompt now use and offer auto mode, just as with newer models. You can turn both off with disableAutoMode. Also fixed: an issue where auto mode failed on every turn outside Claude Desktop when CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS was set in an environment going through a gateway that rejects betas.

Note that at the time of writing (November 19, 2026), the official documentation "Choose a permission mode" states that the models that can use auto mode on Bedrock and others are Sonnet 5 and later and Opus 4.7 and later, and does not include Opus 4.6 / Sonnet 4.6.

Organizations that use Opus 4.6 / Sonnet 4.6 via Bedrock will see the starting mode of interactive sessions change after the update, so I think it's worth checking that it matches your permission mode operating rules.

Changes to the auto mode starting mode, Code Mode's UserPromptSubmit hook, and managed PostToolUse hooks affect existing settings and operations. We compare before and after in "Breaking Changes / Default Behavior Changes" below.

Update Details

New Features

  • Added CLAUDE_CODE_DISABLE_DEFERRED_TOOL_RESUME. The host can now control whether tool calls deferred by a hook are executed by claude -p --resume / --continue
  • /status and claude doctor now show a notice when an OpenTelemetry exporter has no endpoint and data is likely to be lost
  • A warning is now shown when a message sent from a session that skips permission prompts may be held or discarded on the cloud session side
  • Apps that embed Claude Code can now enable the policy plugin's allowManagedModsOnly option. The administrator's managed settings still take precedence
  • The Claude apps gateway now shows a startup warning when the policy's maxEffortLevel is not a valid effort level
  • [VSCode] When a message from another session is held, a notice is now shown with a link to the settings file where you can configure permissions
  • Self-hosted runner additions
    • With --capacity 1, you can now specify the folder used for the repository with --repository-folder (instead of a path under the base folder; symbolic links are not allowed)
    • A startup warning is now shown when the host's settings.json sets a default permission mode that sessions ignore
    • Added --hook-label to claude self-hosted-runner orchestrator, so a specified session label can be passed to the spawn-runner hook
    • Added --metadata key=value to claude --environment, so you can attach labels to a session for the spawn-runner hook
    • Added claude_code_self_hosted_orchestrator_session_queue_wait_by_reason_seconds to the orchestrator's /metrics, so you can distinguish wait times for resumed sessions and new sessions
    • Added the metric claude_code_self_hosted_orchestrator_sessions_given_up_total, which counts, by cause, the number of times Anthropic gave up starting a runner for a session

Security

  • You can now specify "onFailure": "block" in mcp_tool hooks. If the hook call fails, the action is blocked
  • deniedMcpServers entries in the claude.ai <name> format now also apply to connectors in cloud sessions and self-hosted runner sessions
  • When a PermissionRequest hook rewrites a shell command into a command that is excluded from the sandbox, that command now runs outside the sandbox
  • When sandbox.failIfUnavailable is not set, changed how a sandbox that cannot start is reported. The next Bash command that would run in the sandbox is denied, and it is indicated that the sandbox is off for this session
  • Self-hosted runner: Anthropic-managed git can no longer be used by a claude that a wrapper script runs before the session's main claude starts or after it exits
  • Self-hosted runner: In environments where Claude's GitHub tools are restricted by name in the settings, the built-in gh api is now off by default. You can enable it with --use-anthropic-gh true

Improvements / Performance

  • Code Mode (positioned as an experimental feature in the official documentation)
    • Removed the 0.75-second wait that followed most scripts in auto / bypass-permissions mode
    • Scripts' running commands and their output are now displayed while they run
    • Improved the prompt cache for new sessions that use MCP servers. Claude is now told when a server is connecting and when the list of servers changes
    • Shortened tool descriptions to reduce token usage
    • Scripts no longer stop on edits that change nothing, and for failed edits, the matched location or the closest location is now communicated to Claude
    • When a script fails, Claude is now told about tool calls that were still running
    • In auto / bypass mode, Claude is now instructed to start dev servers as background tasks shown in /tasks
    • Windows: Claude is now told that a script's shell commands run in Git Bash, and that in PowerShell, aliases are run instead of functions of the same name
  • For most models, /code-review now labels each finding Important / Pre-existing / Nit and shows a suggested fix at the end of each summary. Reviews that found no problems display "Code review found no issues."
  • Subagents
    • When CLAUDE_CODE_FORK_SUBAGENT=0 is set, subagents in claude -p, the Agent SDK, Desktop, and VS Code now wait for the completion of their own subagents by default
    • In claude -p with CLAUDE_CODE_FORK_SUBAGENT=0 set, a background subagent and the subagents it waits for are now counted as a single 10-minute wait. For long chains, raise CLAUDE_CODE_PRINT_BG_WAIT_CEILING_MS
    • In terminal sessions using the Anthropic API, subagent progress summaries are now generated from short notes by the default small, fast model (even when telemetry is disabled). This significantly reduces tokens used
  • managed-settings plugins
    • In claude -p and SDK sessions, managed-settings plugins that have their own git repository are now fetched in the background for the next session
    • On new machines, in claude -p, SDK, and Claude Desktop sessions, reduced the time until git marketplace managed-settings plugins are loaded. Short runs may exit up to 30 seconds late
  • Session resume and memory
    • Reduced the time to resume large sessions
    • Improved memory usage when resuming sessions that contain many images
    • Improved memory usage and response time in long-running SDK and Desktop sessions that run time-consuming commands and tools
  • Greatly reduced cases where starting multiple in-process teammates at the same time failed with "Lock file is already being held"
  • The computer use approval dialog now shows per-app access levels and clearer warnings
  • Cross-session messages
    • When a cloud session or another computer is not in the list, Claude now explains that Remote Control is off
    • When a message from another session is held or discarded, the text output of claude -p now prints that fact and how to allow it to stderr
  • /bug now asks for Yes / No confirmation before sending, so repeatedly pressing Enter no longer submits a report or opens GitHub
  • The /list-agents list is now shown only to the user. Claude itself lists sessions when needed
  • The Claude in Chrome welcome screen and /chrome now state that Claude Code checks before Claude acts on a site, except where the permission mode or /permissions rules determine the answer
  • When using a third-party provider, or when telemetry or feature flags are disabled
    • In Claude Desktop and Agent SDK sessions, when a question is left open and then closed, the turn now ends instead of continuing without an answer
    • Pasted text is now indicated to Claude as being pasted
  • When answering who can open an artifact Claude has published, Claude is now instructed to recheck the artifact instead of repeating the answer from the previous publication
  • Self-hosted runner
    • In resumed sessions, Claude now checks whether previous work remains and tells you what is missing
    • Both CLAUDE_RUNNER_SESSION_UUID and CLAUDE_CODE_REMOTE_SESSION_UUID are now set for the session and its checkout, post-session, and spawn-runner hooks
    • With --capacity 1, a session is now rejected earlier when the push destination repository path is a symbolic link

Fixes

  • Fixed Bash commands containing words that start with = hanging in zsh: Commands such as echo ==== and [ a == b ] stopped with a "not found" error. =cmd is no longer expanded to the command's path
  • Fixed other tasks disappearing when saving scheduled tasks: When using a third-party provider, or when telemetry or feature flags are disabled, if the scheduled tasks file could not be loaded, the project's other saved tasks were deleted
  • Fixed tasks with typos being deleted from scheduled tasks: A task with a typo in the project's scheduled tasks file was deleted the next time the file was saved
  • Fixed auto-compaction reusing the system prompt: Auto-compaction was reusing the session's earlier system prompt. It now rebuilds the system prompt just like /compact
  • Fixed Markdown rendering freezes: Markdown rendering froze on very long or malformed input
  • Fixed Esc being lost right after a permission prompt: Esc was often lost when typed right after a permission prompt or question. In terminals that send Alt as "Esc + key", pressing an Alt / Option key with no assigned binding there is treated as a denial
  • Fixed auto mode failing on every turn: On Bedrock, Agent Platform, Foundry, and the Claude apps gateway, this occurred outside Claude Desktop when CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS was set in an environment going through a gateway that rejects betas
  • Fixed CLAUDE_STREAM_IDLE_TIMEOUT_MS not extending the connection limit: When using a gateway, a custom base URL, or a cloud provider, the 5-minute connection limit could not be extended
  • Fixed Claude Desktop exiting with "Prompt is too long": Some Claude Desktop sessions on third-party providers (excluding scheduled tasks) exited after a large tool result and could not continue. The largest results are now excluded
  • Fixed MCP tools whose input schema begins with anyOf, oneOf, or allOf not being found: This occurred when using a third-party provider, or when telemetry or feature flags are disabled
  • Fixed requests failing due to MCP tools with invalid input schemas: This occurred when using a third-party provider, or when telemetry or feature flags are disabled. The affected tools are now excluded, and the reason is communicated to Claude
  • Fixed subagent effort being turned off: When Bedrock, Google Cloud's Agent Platform, or Foundry rejected the effort setting for subagent progress summaries, effort was turned off for that subagent's model for the whole session (a regression in 2.1.327)
  • Fixed an invalid OTEL_RESOURCE_ATTRIBUTES entry causing other labels to disappear: A single invalid entry caused other labels to disappear from metric data points, events, and spans. Now only the invalid entry is excluded
  • In addition, many minor bugs were fixed in Code Mode, the self-hosted runner, Remote Control and cloud sessions, terminal key input and display, slash commands such as /plugin, and more.

Breaking Changes / Default Behavior Changes

These are changes that affect existing settings and operations. The before-and-after examples below were created based on the CHANGELOG and the official documentation.

Starting mode for Opus 4.6 / Sonnet 4.6 on Bedrock and others

Opus 4.6 / Sonnet 4.6 now support auto mode on Amazon Bedrock, Google Cloud's Agent Platform, Microsoft Foundry, and the Claude apps gateway, and interactive sessions that don't specify a permission mode start in auto mode. For these models on third-party providers, plan mode and the Bash permission prompt also use and offer auto mode.

Before (through v2.1.327):

Bedrock / Agent Platform / Foundry / Claude apps gateway × Opus 4.6 / Sonnet 4.6
→ Not eligible for auto mode

After (v2.1.328 onward):

Bedrock / Agent Platform / Foundry / Claude apps gateway × Opus 4.6 / Sonnet 4.6
→ Interactive sessions that don't specify a permission mode start in auto mode
→ Plan mode and the Bash permission prompt use and offer auto mode

To turn off auto mode, set disableAutoMode. Below is an example settings.json configuration. The format is based on the settings reference in the official documentation.

{
  "disableAutoMode": "disable"
}

Code Mode script output and the UserPromptSubmit hook

In Code Mode, UserPromptSubmit hooks (including managed ones) are no longer run on script output. To mask output, configure a PostToolUse hook that uses updatedToolOutput. Below is a configuration example.

Before (through v2.1.327): UserPromptSubmit hooks were also run on Code Mode script output.

{
  "hooks": {
    "UserPromptSubmit": [
      { "hooks": [ { "type": "command", "command": "./redact.sh" } ] }
    ]
  }
}

After (v2.1.328 onward): A PostToolUse hook returns the masked output as updatedToolOutput.

{
  "hooks": {
    "PostToolUse": [
      { "hooks": [ { "type": "command", "command": "./redact.sh" } ] }
    ]
  }
}

Here is an example of the JSON that redact.sh returns on standard output. The hooks reference in the official documentation states that the value of updatedToolOutput must have the same shape as the original tool output.

{
  "hookSpecificOutput": {
    "hookEventName": "PostToolUse",
    "updatedToolOutput": { /* masked value, in the same shape as the original tool output */ }
  }
}

Calls denied before execution and managed PostToolUse hooks

Managed PostToolUse hooks no longer fire for calls that were denied before execution. No logging, rewriting, blocking, or stopping is performed for those calls. PostToolBatch receives most of those calls, but they are not shown as denied.

Before (through v2.1.327):

A tool call was denied before execution
→ Managed PostToolUse hooks fire (logging, rewriting, blocking, stopping)

After (v2.1.328 onward):

A tool call was denied before execution
→ Managed PostToolUse hooks do not fire
→ PostToolBatch receives most of them, but they are not shown as denied

Below is an example configuration that adds recording in PostToolBatch for cases where you take audit logs with PostToolUse. Denied calls passed to PostToolBatch are limited to most of them and are not shown as denied, so the records will not have the same content as those from PostToolUse.

{
  "hooks": {
    "PostToolUse": [
      { "hooks": [ { "type": "command", "command": "/opt/audit/log-tool-use.sh" } ] }
    ],
    "PostToolBatch": [
      { "hooks": [ { "type": "command", "command": "/opt/audit/log-tool-batch.sh" } ] }
    ]
  }
}

Conclusion

mcp_tool hooks can now also stop an operation on failure, and the roles of /code-review and /simplify have been separated. I feel this release makes it easier to choose settings and procedures to suit your purpose, both for hook-based control and for code review.

If you use hooks or /code-review, why not check the contents of "Breaking Changes / Default Behavior Changes," then update and give it a try?

References

https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md

https://code.claude.com/docs/en/changelog

https://code.claude.com/docs/en/permission-modes

https://code.claude.com/docs/en/hooks

https://code.claude.com/docs/en/code-mode

https://code.claude.com/docs/en/settings-reference

https://code.claude.com/docs/en/code-review-local

https://dev.classmethod.jp/articles/20261118-cc-updates-v2-1-327/


Claudeならクラスメソッドにお任せください

クラスメソッドは、Anthropic社とリセラー契約を締結しています。各種製品ガイドから、業種別の活用法、フェーズごとのお悩み解決などサービス支援ページにまとめております。まずはご覧いただき、お気軽にご相談ください。

サービス詳細を見る

Share this article

AI白書