Key Updates in Claude Code v2.1.329 - Hook Warnings in the Trust Dialog and Changed Behavior on Hook Failure in Code Mode

Key Updates in Claude Code v2.1.329 - Hook Warnings in the Trust Dialog and Changed Behavior on Hook Failure in Code Mode

Key updates in Claude Code v2.1.329: the trust dialog now shows which files declare hooks (checked on a real device), plus changed Code Mode hook error behavior and fixes for ~/.claude.json resets and VS Code IME input bugs.
2026.11.20

This page has been translated by machine translation. View original

I'm Ishikawa from the Cloud Business Headquarters. Claude Code v2.1.329 was released on November 19, 2026. This release includes changes related to hook configuration, such as a hook warning in the trust dialog and a change in behavior when a hook errors in Code Mode.

The previous update article is here.

https://dev.classmethod.jp/articles/20261119-cc-updates-v2-1-328/

Update Summary

v2.1.329 includes 130 changes. By the categories used in this article, there are 89 fixes, 18 improvements, 6 security changes, 6 performance changes, 6 breaking changes / default behavior changes, and 5 new features.

By area, there are 17 changes related to Code Mode, 17 related to the VS Code extension, 15 related to MCP, and 8 related to the self-hosted runner.

Notable Updates

The trust dialog now shows where hooks are declared

The trust dialog is the screen that asks whether you trust a folder when you start an interactive Claude Code session in a folder you have not trusted. Until you trust the folder, things like hooks in its settings files are not run. A warning showing where the folder's hooks are declared has been added to the folder trust dialog. In the VS Code extension as well, after you decline the trust prompt, a line is now shown above the message box, and you can re-display the prompt from "Review trust" without reloading the window.

If you often clone and open repositories from your team or from external sources, it becomes easier to build in a step of checking where hooks are declared before trusting.

Changed behavior when a PreToolUse hook errors in Code Mode

In Code Mode, when a PreToolUse hook errors (for example, the hook fails to start, is force-terminated, or times out), tool calls from scripts are no longer denied. In regular sessions that don't use Code Mode, a tool call is executed as-is even if a hook errors. With this change, Code Mode now behaves the same way. For command, HTTP, and MCP tool hooks where you want tool calls to be stopped on error, set "onFailure": "block". Note that the official documentation positions Code Mode as an experimental feature.

If you are trying out Code Mode and using a PreToolUse hook to stop dangerous commands, you need to check your onFailure setting so that calls are also stopped when the hook fails.

Expanded items shown in /tasks

/tasks now shows this session's scheduled tasks, /loop wake-ups, goals, and forks of this conversation. Pressing the x key lets you stop them after a confirmation. In addition, the background counts in the /tasks header and footer are now a single number that combines shells, monitors, MCP calls, agents, workflows, and scheduled tasks.

If you use /loop or scheduled tasks together, you can check and stop everything running in the session from /tasks in one place, making it easier to notice things you forgot to stop.

Fixed the issue where ~/.claude.json was reset to its initial values

Fixed an issue where ~/.claude.json could become unreadable due to a network outage or file lock, and its contents were erased on save and reset to the initial values.

This is a fix that gives a reason to update for anyone who has experienced the contents of ~/.claude.json suddenly reverting to the initial values.

Fixes for IME input in the VS Code extension

Fixed an issue in the VS Code extension where keys pressed during IME conversion were handled as moving focus in permission prompts, denying, running menu rows, or closing dialogs. Also fixed were the issues where the IME Enter key submitted plan comments, confirmed session renames, or selected files from @ mentions, and where pressing the up key during conversion overwrote the text being converted with a previous message.

If you use the VS Code extension with Japanese input, you can now type without worrying that keys pressed during conversion are passed to permission prompts or menus.

Fix for specifying a pull request in /code-review

Fixed an issue where /code-review <pr number> could review the checked-out branch instead of the pull request without telling you. It now loads the pull request with gh pr diff, and if it can't be read, it says so. Also, /code-review <pr number> --fix and /code-review given a pull request URL now stop without reviewing when gh pr diff is denied or fails.

If you review by specifying pull request numbers, you are less likely to receive review results for an unintended branch.

Changes such as saved scheduled tasks, automatic retry on max_tokens errors, and background_tasks in Stop hooks affect existing settings and operations. We compare before and after in "Breaking Changes / Default Behavior Changes" below.

Update Details

New Features

  • /tasks now shows this session's scheduled tasks, /loop wake-ups, goals, and forks of this conversation. You can stop them with the x key after a confirmation
  • A "Server message" row has been added to the server page in /mcp. It shows the JSON-RPC error message from a remote HTTP MCP server that refused the connection
  • A "Marketplace auto-update" row has been added to /status. It shows managed marketplaces that are not auto-updated and the reason
  • You can now turn on Code Mode while OpenTelemetry events and metrics are enabled. Each tool call made by the code sends an event. When tracing is enabled, Code Mode continues to be turned off
  • [VS Code] After you decline the trust prompt, a line is now shown above the message box. With "Review trust", you can re-display the prompt without reloading the window

Security

  • A warning showing where the folder's hooks are declared has been added to the folder trust dialog
  • When loading hooks from managed settings fails, a warning is now shown in the conversation in non-interactive hosts such as Claude Desktop
  • Fixed an issue where clearing an MCP server's authentication during a token refresh caused you to be signed in again
  • Fixed an issue in /sandbox on Linux where allowUnixSockets entries were displayed as allowed. On Linux, these entries do not allow access to the target sockets, so /sandbox now shows that
  • Computer use on macOS has been updated with new safety rules. Some operations are denied and access to some apps is restricted
  • In the Claude apps gateway (claude gateway), the warning that was shown at startup while access_control.allow_cidrs was empty has become a notice shown on every startup. In text logs it is displayed in a box and tells you not to expose the gateway to the public internet

Improvements / Performance

Code Mode (positioned as an experimental feature in the official documentation)

  • It now starts even when telemetry, non-essential traffic, and feature flags are off. Administrators can keep Code Mode off with managed settings
  • Scripts that declare their own log, preview, or sleep are now run instead of being rejected
  • Reading line ranges larger than 256 MiB is now rejected (it could use several GB of memory). Also fixed an issue where reading very long lines timed out
  • Greatly reduced the time the terminal freezes after a script calls tools thousands of times
  • After starting a subagent, Claude now receives the same waiting guidance as in regular sessions that don't use Code Mode

/code-review and auto mode

  • With many models, /code-review without a target now reviews the entire branch compared with the default branch. Also fixed an issue where the diff was lost on branches with multiple commits
  • /code-review <pr number> --fix and /code-review given a pull request URL now stop without reviewing when gh pr diff is denied or fails
  • Auto mode now runs git status less often, shortening the wait time for many requests in large repositories. Git commands that discard changes may be blocked until the working tree has been checked
  • Improved how auto mode handles short replies such as "yes" to Claude's questions when telemetry is off, when going through a gateway to the Anthropic API, and when using Microsoft Foundry

Tasks and sessions

  • "Exit and stop tasks" now also ends this session's scheduled tasks so they are not re-run on resume (except when you exit while Claude is responding)
  • The background counts in the /tasks header and footer are now a single number that combines shells, monitors, MCP calls, agents, workflows, and scheduled tasks
  • On in-place restarts such as /tui, it now waits briefly for the login refresh, making sign-outs less likely
  • Improved automatic cleanup of old sessions on computers with managed settings
  • In cloud sessions, plugins that failed to download at startup are now retried

Memory and responsiveness

  • Improved memory usage in long sessions that edit many files, and in long Claude Desktop sessions on macOS / Linux with many large MCP tool results
  • Improved memory usage in idle Claude Desktop / SDK sessions after a long turn, and after --resume / --continue of sessions containing screenshots or large tool results
  • On Windows, improved startup and the first search on PCs where Claude Code's search program starts slowly
  • In Claude Desktop Code sessions with Remote Control on, shortened the time until the next message can be accepted after an answer

macOS, VS Code, and self-hosted runner

  • Computer use on macOS now cancels app launches that don't complete within 30 seconds
  • The macOS login refresh now tests the Keychain using the Claude Code-write-check item
  • [VS Code] When you press the down key in a permission prompt, it now stops at the last item and no longer wraps back to "Yes"
  • [VS Code] In command output, hidden characters and control sequences other than normal colors are now shown as symbols. As a result, text in Persian, Khmer, Lao, Sinhala, and Malayalam may appear broken or out of order
  • In the self-hosted runner, clones of a second hostname with the same owner/name are now placed under _repos/clones/<host>/ in the base folder. Existing clones are not moved
  • The self-hosted runner's --repository-folder now accepts most folders within the base folder when --capacity 1. When it is greater than 1, specifying a folder within the base folder stops startup. Sessions for other overlapping repositories are rejected

Fixes

  • Fixed the issue where ~/.claude.json was reset to its initial values: ~/.claude.json could become unreadable due to a network outage or file lock, and its contents were erased on save and reset to the initial values
  • Fixed the issue of repeated sign-outs on macOS: This occurred when the Keychain could be read but not written. The affected session stops at expiry and shows the reason, while other sessions stay signed in
  • Fixed the issue where /code-review <pr number> reviewed a different branch: It could review the checked-out branch instead of the pull request without telling you. It now loads the pull request with gh pr diff, and if it can't be read, it says so
  • [VS Code] Fixed issues with key operations during IME conversion: Keys pressed during conversion were handled as moving focus in permission prompts, denying, running menu rows, or closing dialogs (anthropics/claude-code#106358). Also fixed were the issue where the up key during conversion overwrote the text being converted with a previous message (anthropics/claude-code#101294), and the issue where the IME Enter key submitted plan comments, confirmed session renames, or selected files from @ mentions
  • Fixed the issue where /terminal-setup corrupted VS Code settings files: It corrupted VS Code settings and keybindings files around block comments. Also fixed an issue where, when keybindings.json contained an unclosed string, it reported success while losing the Shift+Enter binding
  • Fixed the issue where the trailing newline and BOM of files approved in the IDE diff were lost: Files approved in the IDE diff were saved without a trailing newline. Also fixed an issue where the byte order mark (BOM) was lost when saving the diff and approving the edit in VS Code
  • Fixed the issue where the prompt froze with status line scripts: With status line scripts that kept producing output without stopping, the prompt froze and consumed several GB of memory
  • Fixed the issue where background MCP tasks stayed stopped: This occurred after a slow reconnection. Claude Code now automatically reconnects to many HTTP MCP servers that remained on an old protocol version
  • Fixed the issue where PDFs and images were saved as .bin: PDFs, images, .docx, .xlsx, and .pptx files sent as application/octet-stream by MCP servers or websites were saved as .bin, and Claude could not read the PDFs or images
  • Fixed the issue where Stop did not end the request in Claude Desktop sessions on Bedrock: In Claude Desktop sessions on Amazon Bedrock, Stop could not end the request while waiting for an unresponsive AWS credential_process or sign-in call
  • Fixed the issue where the session's branch was deleted in the self-hosted runner: --push-outcome-on-release could delete the session's branch on the git host
  • [VS Code] Fixed the issue where you were signed out in all windows: When the sign-in server took 10 to 30 seconds to refresh the extension's token, you were signed out of Claude Code in all windows and terminals
  • A small but welcome fix: Fixed the issue where the output of claude --help piped to another program was cut off partway. It is now easier to search for options with grep.
  • In addition, many other minor bugs have been fixed in areas such as Code Mode, the self-hosted runner, Remote Control and cloud sessions, MCP, and terminal display and key operations.

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.

Handling of PreToolUse hook errors in Code Mode

In Code Mode, when a PreToolUse hook errors (for example, the hook fails to start, is force-terminated, or times out), tool calls from scripts are no longer denied. This is the same handling as in regular sessions that don't use Code Mode. For command, HTTP, and MCP tool hooks where you want tool calls to be stopped on error, set "onFailure": "block".

Before (up to v2.1.328):

Tool call from a Code Mode script × PreToolUse hook errors
→ The tool call is denied (even if onFailure is not set)
→ In regular sessions that don't use Code Mode, the tool call is executed under the same conditions

After (v2.1.329 onward):

Tool call from a Code Mode script × PreToolUse hook errors
→ The tool call is not denied on a hook error (same handling as in regular sessions that don't use Code Mode)
→ For hooks that should deny on error, set "onFailure": "block"

Below is a settings.json configuration example. The format is based on the hooks reference in the official documentation. ./check-command.sh is an example.

{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Bash",
        "hooks": [
          {
            "type": "command",
            "command": "./check-command.sh",
            "onFailure": "block"
          }
        ]
      }
    ]
  }
}

Removal of automatic retry on max_tokens errors

The automatic retry at the limit indicated in max_tokens errors, which was introduced in 2.1.326, has been removed. When going through a gateway whose model has a small output token limit, set that limit in CLAUDE_CODE_MAX_OUTPUT_TOKENS.

Before (v2.1.326 to v2.1.328):

max_tokens error
→ Automatic retry at the limit indicated in the error

After (v2.1.329 onward):

max_tokens error
→ No automatic retry at the limit indicated in the error
→ Set the limit of the model behind the gateway in CLAUDE_CODE_MAX_OUTPUT_TOKENS

Below is a configuration example. 8192 is an example; set it to match the output limit of the model behind the gateway.

% export CLAUDE_CODE_MAX_OUTPUT_TOKENS=8192
% claude

Rescheduling of saved scheduled tasks

In new signed-in sessions, many scheduled tasks saved in earlier versions need to be scheduled again. If you --resume the session in which the task was saved, it continues to run. The CHANGELOG does not describe the pre-change behavior in detail, so the conditions that apply are shown below.

Before (up to v2.1.328):

Scheduled tasks are saved

After (v2.1.329 onward):

Scheduled tasks saved up to v2.1.328
→ New signed-in session: many need to be scheduled again
→ --resume of the saved session: continue to run

background_tasks in Stop / SubagentStop hooks

In background_tasks for Stop / SubagentStop hooks, Monitor scripts are now listed as monitor instead of shell. For hooks that target only tasks whose type is shell, Monitor scripts are no longer targeted.

Below are examples of part of the Stop hook input. The field names are based on the hooks reference in the official documentation.

Before (up to v2.1.328): Monitor script

"background_tasks": [
  { "id": "task-001", "type": "shell", "status": "running" }
]

After (v2.1.329 onward): Monitor script

"background_tasks": [
  { "id": "task-001", "type": "monitor", "status": "running" }
]

How some teammate panes are launched

Some teammate panes are now launched via /bin/sh. As a result, shell startup files may not be loaded.

Before (up to v2.1.328):

Some teammate panes
→ Launched not via /bin/sh

After (v2.1.329 onward):

Some teammate panes
→ Launched via /bin/sh
→ Shell startup files may not be loaded

Clone destination folder for the self-hosted runner

In the self-hosted runner, repositories whose address path contains special characters are now cloned again into a new folder.

Before (up to v2.1.328):

アドレスのパスに特殊な文字を含むリポジトリ
→ 既存のフォルダにクローン

After (v2.1.329 onward):

アドレスのパスに特殊な文字を含むリポジトリ
→ 新しいフォルダに改めてクローン
→ 古いフォルダを指定したルールやボリュームは適用されない
→ 古いクローンはそのまま残る

Trying out the hook warning in the trust dialog

The trust dialog is the screen that asks "Do you trust this folder?" when you start Claude Code in a folder for the first time. Hooks in a trusted folder run commands without confirmation. When you open a cloned repository, you can find out at the dialog stage whether the repository has such hooks.

I started claude in a folder that declares hooks and in a folder that does not, and compared the trust dialog displays. The test environment was Claude Code v2.1.329 on macOS.

Preparing folders for verification

I prepared a folder hooks-trust-demo that declares a PreToolUse hook in .claude/settings.json and a SessionStart hook in .claude/settings.local.json. The hooks themselves are just echo commands that output a string. For comparison, I also prepared no-hooks-demo, which has no .claude folder.

Below are the results of running in hooks-trust-demo.

% claude --version
2.1.329 (Claude Code)
% find .claude -type f
.claude/settings.json
.claude/settings.local.json
% cat .claude/settings.json
{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Bash",
        "hooks": [
          { "type": "command", "command": "echo pre-tool-use" }
        ]
      }
    ]
  }
}
% cat .claude/settings.local.json
{
  "hooks": {
    "SessionStart": [
      {
        "hooks": [
          { "type": "command", "command": "echo session-start" }
        ]
      }
    ]
  }
}

Starting without being affected by existing trust settings

In my environment, the root (/) is already trusted in ~/.claude.json, so starting claude as-is began the session without showing the trust dialog. So I specified an empty config directory with CLAUDE_CONFIG_DIR and started with no trusted folders. An empty configuration requires login, so I specified Amazon Bedrock with CLAUDE_CODE_USE_BEDROCK=1 to avoid going through login.

% cd hooks-trust-demo
% CLAUDE_CONFIG_DIR=$WORK/cc-config-fresh CLAUDE_CODE_USE_BEDROCK=1 AWS_REGION=ap-northeast-1 claude

$WORK is the working directory for verification. Because I started it via tmux from within a Claude Code session, I actually ran it with the CLAUDECODE environment variable, which Claude Code sets for child processes, removed, and captured the screen with tmux capture-pane. When you proceed through the theme selection and security notes on first launch with Enter, the trust dialog is displayed.

Results

In the folder that declares hooks (hooks-trust-demo), the following trust dialog was displayed.

────────────────────────────────────────────────────────────────────────────────────────────────────
 Accessing workspace:

 /private/tmp/claude-501/-Users-ishikawa-satoru-workspaces-cc-blog-20261120-v2-1-329/a9fd2f03-bc27-
 42ca-b78d-5769355f4af4/scratchpad/hooks-trust-demo

 Quick safety check: Is this a project you created or one you trust? (Like your own code, a
 well-known open source project, or work from your team). If not, take a moment to review what's in
 this folder first.

 Claude Code'll be able to read, edit, and execute files here.

 ⚠ This folder configures hooks that can run commands without asking, declared in
 .claude/settings.json and .claude/settings.local.json

 Trusting this folder loads .claude/settings.json (runs commands) and .claude/settings.local.json
 (runs commands).
 Security guide

 ❯ No, exit
   Yes, I trust this folder

 Enter to confirm · Esc to cancel

In the folder without hooks (no-hooks-demo), it was as follows.

────────────────────────────────────────────────────────────────────────────────────────────────────
 Accessing workspace:

 /private/tmp/claude-501/-Users-ishikawa-satoru-workspaces-cc-blog-20261120-v2-1-329/a9fd2f03-bc27-
 42ca-b78d-5769355f4af4/scratchpad/no-hooks-demo

 Quick safety check: Is this a project you created or one you trust? (Like your own code, a
 well-known open source project, or work from your team). If not, take a moment to review what's in
 this folder first.

 Claude Code'll be able to read, edit, and execute files here.

 Security guide

 ❯ No, exit
   Yes, I trust this folder

 Enter to confirm · Esc to cancel

In the folder that declares hooks, the line beginning with ⚠ showed .claude/settings.json and .claude/settings.local.json as the files declaring the hooks. This line, and the following "Trusting this folder loads …" line, were not displayed in the folder without hooks. The initial selection was "No, exit", and pressing Enter as-is exited Claude Code.

Compared with the folder without hooks, the difference was immediately clear from the presence or absence of the warning. It gives you a clue for checking where hooks are declared in a repository you are opening for the first time.

Conclusion

What stood out in this release was the large number of fixes for bugs that affect everyday use, such as retaining settings, sign-in, and IME operation in the VS Code extension.

If you use hooks, Code Mode, or the VS Code extension, why not check the contents of "Breaking Changes / Default Behavior Changes" and then update and try it out?

References

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

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

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

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

https://code.claude.com/docs/en/claude-apps-gateway

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

https://dev.classmethod.jp/articles/20261119-cc-updates-v2-1-328/


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

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

サービス詳細を見る

Share this article

AI白書