Skip to content
Beta
All articles

Claude Code's November hook changes: what audit and redaction hooks now miss

Claude Code 2.1.326 to 2.1.329 changed which hooks see refused calls and Code Mode output, and what keeps Code Mode off. What to re-check in managed settings.

By The SpanDock team

5 min read

A diagram of three hook paths in Claude Code 2.1.328 and later: a tool call refused before it runs no longer reaches managed PostToolUse hooks and appears in PostToolBatch without a refused mark; Code Mode script output no longer reaches UserPromptSubmit hooks and must be redacted in PostToolUse with updatedToolOutput; a PreToolUse refusal now leaves a tool_decision event

Many organisations use Claude Code's hooks as their policy layer: a script in managed settings logs every tool call, blocks some, and redacts what comes back. Four releases between 16 and 19 November 2026, versions 2.1.326 to 2.1.329, changed which hooks see what. None of the changes is a vulnerability, and most make behaviour more sensible. But a hook written against the old behaviour can now miss events without any error. If you maintain managed hooks, this is the list to check.

Context: hooks as a policy layer

The hooks reference describes hooks as commands, HTTP calls or MCP tools that Claude Code runs at fixed points: UserPromptSubmit before a prompt is processed, PreToolUse before a tool call, PostToolUse after one, and PostToolBatch once a batch of parallel calls has resolved. Hooks set in managed settings apply to everyone on the computer, and administrators can restrict hooks to managed ones only. That makes them a natural place for audit logging and data controls, and a fragile one when the events they rely on move.

What changed

Refused calls no longer reach managed PostToolUse hooks

The 2.1.328 release notes say managed PostToolUse hooks "no longer fire for calls refused before they ran: no log entry, rewrite, block or stop there". PostToolBatch now "gets most" of them, "not marked as refused".

The hooks reference still says that managed PostToolUse hooks also run after some failed calls, so they should handle both outcomes. That remains true for calls that ran and failed. The change is about calls that never ran because a rule, a prompt or another hook refused them.

The effect on an audit hook is easy to miss. If your PostToolUse script was the place that recorded every attempted call, refused attempts stopped appearing in its log on 2.1.328. Those are often the most interesting entries. PostToolBatch sees most of them, but the release notes say they aren't marked as refused there, so a script has to work that out itself.

Code Mode output no longer reaches UserPromptSubmit hooks

Code Mode, the experimental option where Claude writes JavaScript that calls tools, used to pass the output of that code through UserPromptSubmit hooks in some cases. From 2.1.328 it doesn't, "managed ones included". The release notes and the Code Mode documentation give the replacement: redact that output in a PostToolUse hook, returning a changed copy of the result as updatedToolOutput.

If you redact secrets or personal data from tool output in a UserPromptSubmit hook, that check no longer runs on Code Mode output. The documentation says to move it.

Managed PreToolUse refusals now leave telemetry

The 2.1.326 release notes fix a gap in the other direction: managed PreToolUse hooks that refused a direct tool call left no OpenTelemetry tool_decision event and no permission_denials entry. Before 2.1.326, a dashboard counting refusals from your telemetry undercounted the ones your own hooks made. The same release changed how allowedHttpHookUrls and httpHookAllowedEnvVars apply to hooks from managed settings, without describing the new behaviour; if you use HTTP hooks with those allowlists, test them on the new version.

Telemetry no longer keeps Code Mode off

The 2.1.329 release notes let Code Mode run with OpenTelemetry events and metrics on, with each tool call the code makes sending its own events; tracing still keeps it off. Code Mode also now starts when telemetry, nonessential traffic or feature flags are turned off.

Until then, an organisation that exported OpenTelemetry from every computer effectively had Code Mode switched off, whether or not anyone decided that. That side effect is gone. If you want it off, the Code Mode documentation gives the explicit control: set CLAUDE_CODE_EXPERIMENTAL_CODE_MODE to "0" in the env block of managed settings. Code Mode still won't run through a gateway or on the cloud providers the documentation lists.

The same release adds a warning in the conversation, in Claude Desktop and other non-interactive hosts, when hooks in managed settings fail to load. Before it, those hosts showed no such warning, so a managed hook that failed to load there was easy to miss.

Analysis: why this matters more than it looks

Each change is defensible. A hook that rewrites or blocks the output of a call that never ran has nothing to act on. Code output isn't a prompt, so UserPromptSubmit was the wrong place to check it. Telemetry was never meant to be a feature switch.

The risk is in the pattern. Hooks are code that depends on the precise moment and payload of an event, and those definitions are moving on a weekly release cadence. A policy hook rarely fails loudly when its event moves; it simply sees less. The refused-call change is the clearest example: the log keeps filling, so nobody notices that a category of entries has gone.

There is also a version spread problem. Computers update at different times, so for a while your fleet runs a mix: some where refused calls reach PostToolUse and some where they don't, some where Code Mode output passes UserPromptSubmit and some where it doesn't. A hook has to handle both until every computer is past 2.1.329.

What it means for engineering and security leaders

Treat managed hooks like any integration against a fast-moving API: pin the behaviour you depend on in tests, and read release notes for the event names you use. Keep logging of attempts, refusals and outcomes in more than one place, so that one event moving doesn't empty a report. And make deliberate settings for things that used to be side effects, such as Code Mode being unavailable.

Practical takeaways

  • Find every managed hook on PostToolUse and UserPromptSubmit, and note what each one logs, blocks or redacts.
  • Record refused calls elsewhere. Use PreToolUse, PermissionDenied for auto-mode denials, or PostToolBatch with your own refused check.
  • Move Code Mode output redaction to PostToolUse with updatedToolOutput, as the documentation describes.
  • Decide on Code Mode explicitly. If it should stay off, set CLAUDE_CODE_EXPERIMENTAL_CODE_MODE to "0" in managed settings.
  • Re-check refusal counts in your telemetry from 2.1.326 on; earlier figures missed managed PreToolUse refusals.
  • Test HTTP hooks that rely on allowedHttpHookUrls or httpHookAllowedEnvVars after upgrading.

For teams that want prompt and tool call checks without maintaining their own hook scripts, SpanDock's guardrails install a hook in Claude Code, Codex and Gemini CLI that checks the prompt and every tool call before it runs, and can block, warn, ask for confirmation or redact. If a person removes the hook from their own settings, it is put back within a minute. Guardrails on computers are on the Enterprise plan.

Sources

  1. Claude Code v2.1.326 release notes (16 November 2026)
  2. Claude Code v2.1.328 release notes (19 November 2026)
  3. Claude Code v2.1.329 release notes (19 November 2026)
  4. Claude Code documentation: Hooks reference
  5. Claude Code documentation: Code Mode
Cookie categories

Details: Cookie Policy.