Claude Code 2.1.329: Code Mode stops blocking on failed hooks, and runs with telemetry off
Claude Code 2.1.329 stops a failed PreToolUse hook from blocking a Code Mode tool call, and lets Code Mode start in sessions where telemetry is off.
Take Claude Code 2.1.329 for its fixes, but audit your hooks before you install it on anything unattended. One Changed bullet stops a failing PreToolUse hook from refusing a tool call inside Code Mode, which is how a crashing or missing guard hook turns from a block into a warning, and a second lets Code Mode start in sessions where telemetry or feature flags are turned off. Everything else in the release is smaller than those two, and 91 of its 130 bullets are fixes.
Anthropic published 2.1.329 to npm on 19 November 2026 at 18:40 UTC, and the dated changelog feed timestamps the entry at 22:14 UTC the same evening.
#What changed for hooks in Code Mode?
This bullet, in the Changed list:
Changed Code Mode so a PreToolUse hook that errors no longer refuses a script's tool call, as outside Code Mode; set
"onFailure": "block"on a command, HTTP or MCP tool hook that must refuse
The phrase that matters is "as outside Code Mode". Claude Code's documented default everywhere else is that a broken hook does not stop the thing it was watching. The hooks reference puts it plainly: "On most events, when a hook fails or times out, Claude Code still carries out the action. A policy hook with a wrong path or a crashing script then lets everything through." Code Mode was the exception, and this release removes the exception.
So the change is a consistency fix in the direction of less protection. If you wrote a PreToolUse hook to gate what scripts may do, and you tested it by watching it block something, it kept blocking after a crash only because Code Mode treated an erroring hook as a refusal. From 2.1.329 it does not.
| Where the hook runs | A hook that errors or times out, before 2.1.329 | From 2.1.329 | How to get the block back |
|---|---|---|---|
| Code Mode script tool call | Refused the tool call | Call goes ahead, reported as a hook error | Set "onFailure": "block" on the hook |
| Outside Code Mode, most events | Call goes ahead | Unchanged | Set "onFailure": "block" on the hook |
| Agent SDK callback hook on timeout | Blocks the tool call | Unchanged | Already blocks |
The setting is not new and is not specific to Code Mode. The hooks reference documents onFailure as "Whether the action that triggered the hook goes ahead when the hook fails: "continue" or "block"", available "on a command, http, or mcp_tool hook", and it records two version floors: onFailure "Requires Claude Code v2.1.295 or later", and "On mcp_tool hooks, onFailure requires v2.1.328 or later". So the fix for this change has been shipping for a month, and on MCP tool hooks it arrived one release before the change that makes you need it.
When a blocking hook does fail, the docs say the error names the reason:
PreToolUse:Bash hook error: [node ${CLAUDE_PROJECT_DIR}/.claude/hooks/check-command.js]: failed; blocking because onFailure is "block"That line is worth knowing, because its absence is now the signal that a guard hook failed open. If you are writing your first hook, the walkthrough at Claude Code hooks: a beginner's guide covers the event names this setting attaches to.
#Which hook failures does this release make visible?
Two Added bullets, and they read as the other half of the same thought. A fail-open default is only survivable if you can see that a hook failed, and both of these are about seeing it:
Added a trust dialog warning that says where a folder's hooks are declared
Added a warning in the conversation, in Claude Desktop and other non-interactive hosts, when hooks in managed settings fail to load
The second is the more useful of the two for an administrator. A hook in managed settings that fails to load is exactly the silent case the hooks reference warns about, and until this release a non-interactive host gave no sign of it in the conversation. The first tells you which file a folder's hooks come from before you trust the folder, which is a different question from whether they work.
Neither bullet is labelled a security change, and both are.
Want step-by-step guides for this and more?
ClawDocx Pro includes 500+ curated prompts, setup guides, SKILL.md files, and templates — everything to make your AI agent unstoppable.
See plans & pricing#Why would Code Mode start where it did not before?
Because three switches that used to keep it off no longer do:
Changed Code Mode to also start when telemetry, nonessential traffic or feature flags are turned off; an administrator can keep it off in managed settings
If your deployment turned telemetry off for policy reasons and took Code Mode's absence as a consequence of that, this release separates the two. The changelog names managed settings as the way to keep it off, which makes that the setting to check rather than a side effect to rely on. Our notes on locking a deployment down are at Security hardening.
Four other Code Mode changes in the same entry are narrower, and all four point the same way, at scripts that used too much of the machine:
- A runaway loop in Code Mode that filled the machine's memory "is now stopped at a limit".
- A script's read of a line range over 256 MiB is now refused, "which could use gigabytes of memory".
- Code Mode kept in memory "every large text file that code read", and memory grew each time a background subagent was woken. Both are fixed.
- A script that declares its own
log,previeworsleepnow runs, where it used to be refused.
#Will your saved scheduled tasks still run?
Most of them need saving again:
Changed saved scheduled tasks: in new signed-in sessions, most saved by earlier versions need scheduling again, though
--resumeof their own session still runs them
The carve-out is narrow and worth reading twice. Resuming the session a task was saved in still runs it. A new signed-in session does not, so a scheduled task you rely on outside its original session stops firing after the upgrade with no error to tell you. A related bullet changes when tasks stop: "Changed 'Exit and stop tasks' to end this session's scheduled tasks so they don't run again on resume, unless you exit while Claude is responding".
If you run anything on a schedule, upgrading is a good moment to check that each task still exists where you expect it. The release also adds a place to look: /tasks now lists "this session's scheduled tasks, /loop wakeups, the goal and this conversation's forks", and x stops one after asking.
#Which fixes make this worth taking?
Four of the 91 Fixed bullets close ways the tool could lose or damage a file, which is the same category that made 2.1.327 worth taking:
~/.claude.jsonwas "sometimes being reset to defaults when a network stall or file lock made it unreadable and cleared during a save". That is your settings file, replaced with defaults, after a transient failure./terminal-setupwas "corrupting VS Code settings or keybindings files around block comments, and reporting success while losing the Shift+Enter binding where keybindings.json has an unclosed string". Both halves matter: it damaged the file, and it said it had worked.- Files accepted through the IDE diff were "being saved without their last newline", and lost "their byte order mark (BOM) when an edit was accepted by saving the diff in VS Code".
- On self-hosted runners,
--push-outcome-on-releasewas "sometimes deleting a session's branch on the git host".
Two sign-in fixes are worth a mention for anyone who has been signed out repeatedly: macOS sessions where Claude Code "could read the Keychain but not save to it" now stop at expiry and say why, instead of signing out every session, and the VS Code extension no longer signs you out "in every window and terminal when the sign-in server took 10 to 30 seconds to answer the extension's token refresh".
#What is in the release, by the numbers?
The entry carries 130 bullets. Counting them by their opening word gives the shape of the release:
| Opening word | Bullets |
|---|---|
| Fixed | 91 |
| Changed | 20 |
| Improved | 10 |
| Added | 7 |
| Updated | 1 |
| Removed | 1 |
Seventeen of the 130 are prefixed [VSCode] and five are self-hosted runner changes, so a terminal-only setup is reading a smaller release than the count suggests. For context on the run of releases this sits in, 2.1.328 carried 144 bullets, 2.1.327 carried 173 and 2.1.326 carried 367.
No bullet in the entry names a security issue, a CVE or an advisory, and the words "security", "CVE", "advisory" and "vulnerability" do not appear in it at all.
#What else can break a working setup?
Five changes outside the hook and Code Mode sections can change behaviour you depend on:
| Change | What the changelog says | Who should check |
|---|---|---|
| Teammate panes and shell start-up files | "Changed some teammate panes to start through /bin/sh, so they may not read shell start-up files" | Anyone whose teammate panes need PATH or tooling set in a shell profile |
The max_tokens retry is gone | "Removed 2.1.326's automatic retry at the limit named in a max_tokens error; behind a gateway whose model takes fewer output tokens, set CLAUDE_CODE_MAX_OUTPUT_TOKENS to that limit" | Anyone behind a gateway who got that retry for free in 2.1.326 |
| Computer use on macOS | "Updated computer use on macOS to newer safety rules, so some actions are refused and some apps have less access" | Anyone automating macOS apps through computer use |
Auto mode and git status | "Changed auto mode to run git status less often so most requests wait less in large repositories; a git command that discards changes may be blocked until the working tree is checked" | Anyone running destructive git commands in auto mode |
Gateway allow_cidrs | "Changed the start-up warning shown while access_control.allow_cidrs is empty to a notice at every start, boxed in text logs: never expose the gateway to the public internet" | Gateway operators who treated the one-off warning as noise |
The auto mode row is the one most likely to look like a bug rather than a change. A git command that discards changes may now wait on a working-tree check that did not run, which reads as a stall rather than as a policy.
Two /code-review changes land here too: with no target, on most models, it now reviews "the whole branch against the default branch", and given a pull request number or URL it "stops without reviewing when gh pr diff is refused or fails" instead of quietly reviewing the checked-out branch.
#How do you get it?
Check the dist-tag before the version number. As of 20 November 2026 both latest and next point at 2.1.329, so a plain npm install gets this release. The stable tag still points at 2.1.311, published on 26 October 2026, with sixteen versions published since, so an install pinned to stable picks up none of the hook or Code Mode changes above.
That gap is now almost four weeks wide. If your deployment pins to stable deliberately, the hook change in this release is a reason to confirm that is still the decision you meant to make, because the guard you tested may not be the guard you have on either side of it. The previous release is covered at Claude Code 2.1.328, which narrowed what hooks fire on in three other ways, and the platform notes at Claude Code track the current release line.
Frequently asked questions
- Should I upgrade to Claude Code 2.1.329?
- Yes, but audit your hooks first if you run Code Mode. Of the 130 bullets in the entry, 91 begin with Fixed, including one that reset ~/.claude.json to defaults and one that corrupted VS Code settings files. The reason to look before upgrading is a single Changed bullet: a PreToolUse hook that errors no longer refuses a script's tool call in Code Mode, so a crashing or missing guard hook now lets the call through unless you have set onFailure to block.
- Will my PreToolUse hook still block a Code Mode tool call if it crashes?
- Not after this release, unless you set it to. The changelog reads: Changed Code Mode so a PreToolUse hook that errors no longer refuses a script's tool call, as outside Code Mode; set "onFailure": "block" on a command, HTTP or MCP tool hook that must refuse. The hooks documentation describes the same setting and says it requires Claude Code v2.1.295 or later, and v2.1.328 or later for mcp_tool hooks.
- Why did Code Mode start in a session where it used to stay off?
- Because turning telemetry off no longer keeps it off. The entry reads: Changed Code Mode to also start when telemetry, nonessential traffic or feature flags are turned off; an administrator can keep it off in managed settings. If your deployment relied on disabling telemetry to keep Code Mode out of sessions, managed settings is now the documented way to do it.
- Do my saved scheduled tasks still run after upgrading?
- Most will need scheduling again. The changelog records: Changed saved scheduled tasks: in new signed-in sessions, most saved by earlier versions need scheduling again, though --resume of their own session still runs them. So a task you resume inside its original session keeps working, while the same task in a new signed-in session does not until you save it again.
- Does Claude Code 2.1.329 contain a security fix?
- No bullet in the entry names a security issue, a CVE or an advisory, and the entry contains no occurrence of the words security, CVE, advisory or vulnerability. That is narrower than it sounds. The Code Mode hook change removes a guard that used to hold, computer use on macOS moved to newer safety rules that refuse some actions, and the gateway now repeats its warning about an empty allow_cidrs list at every start.
- Why does npm install a different version than 2.1.329?
- Check which dist-tag you are installing. As of 20 November 2026 the latest and next tags both point at 2.1.329, while the stable tag still points at 2.1.311, published on 26 October 2026, with sixteen versions published since. An install pinned to stable picks up none of the hook or Code Mode changes described here.