# Claude Code 2.1.328 changes hook behaviour in Code Mode and managed PostToolUse hooks

> The 2.1.328 changelog stops Code Mode running UserPromptSubmit hooks on script output and stops managed PostToolUse hooks firing for refused calls.

- Status: official (From the company, authors or authority themselves, with a link to their own page.)
- Topic: Products
- Published: 2026-11-19T00:00:00+00:00
- Updated: 2026-11-19T02:09:09.216248+00:00
- Web page: https://ai-news.ikangai.com/story/claude-code-2-1-328-changes-hook-behaviour-in-code-mode-and-managed-posttooluse/
- Seen in: Claude Code changelog
- Change: breaking_change (Breaking change)
- Applies to: Claude Code 2.1.328, Code Mode, UserPromptSubmit hooks, managed PostToolUse hooks, PostToolBatch hook, mcp_tool hooks

## What changed

Code Mode no longer runs UserPromptSubmit hooks on script output, and managed PostToolUse hooks no longer fire for calls refused before they run.

Anthropic's Claude Code 2.1.328 changelog changes two hook behaviours that matter to anyone who uses hooks to log, redact or gate tool calls. Code Mode no longer runs UserPromptSubmit hooks on the output of scripts. Managed PostToolUse hooks no longer fire for calls that are refused before they run. The release notes also add a new failure option for MCP tool hooks, but the two removals are the changes that can quietly break existing setups.

The Code Mode change is the more direct one. Code Mode lets Claude run scripts that call tools. Until this release, UserPromptSubmit hooks, including managed ones, ran on what those scripts printed. The changelog now says they don't. Anyone who relied on that path to screen or redact script output has to move the job. The changelog recommends a PostToolUse hook that uses updatedToolOutput to rewrite the tool's output.

The second change concerns refusals. Managed PostToolUse hooks are where a log entry, rewrite, block or stop can happen. The changelog says that for calls refused before they ran, managed PostToolUse hooks no longer fire at all, so none of those actions happen there. The PostToolBatch hook receives most of these events, but the entry says it does not mark them as refused. A team that logs refused calls through PostToolUse will need to account for that gap.

The new onFailure option works in the opposite direction. The release adds "onFailure": "block" for mcp_tool hooks, so that a hook whose call fails blocks the action, the same behaviour command and HTTP hooks already have. For a team that wants a failed external check to stop an action rather than let it through, this is the relevant addition.

The release is long. Many of its 91 bug fixes and 19 improvements concern Code Mode, remote sessions, the terminal and self-hosted runners. Among the Code Mode fixes is one that addresses Claude not being told that a Code Mode script was cut off when a session was resumed from the picker or in a mode that asks for permission. Those fixes don't bear on the hook changes. Anyone running managed hooks alongside Code Mode should read the two hook entries together, because the redaction path moves and the refusal path narrows in the same release.

## Why it matters

Companies that use hooks for logging, redaction or policy enforcement may find that some events no longer reach them. Gaps in audit or redaction could go unnoticed unless the hook setup is checked.

## What you can do

Teams with managed or custom hooks should test their logging and redaction against version 2.1.328 before rolling it out.

## Original source

- [Claude Code changelog - Claude Code Docs](https://code.claude.com/docs/en/changelog)
- [claude-code/CHANGELOG.md at main · anthropics/claude-code · GitHub](https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md)

---

AI wrote this summary from the sources listed, and nobody reviewed it individually before publication. Check the original source before you rely on it.

Cite as: IKANGAI AI News, "Claude Code 2.1.328 changes hook behaviour in Code Mode and managed PostToolUse hooks", 2026-11-19, https://ai-news.ikangai.com/story/claude-code-2-1-328-changes-hook-behaviour-in-code-mode-and-managed-posttooluse/
