Follow Discord
Sweep 20 Nov 2026 · 19:55Z Build v2.1.330 547 read Stable v2.1.323 Latest v2.1.330 Next v2.1.330 Feeds RSS JSON llms.txt llms-full.txt Unofficial

Claude Code v2.1.326 ·

PreToolUse hook matchers gain a whenUnanswered setting for SDK hosts

SDK hosts can set whenUnanswered on a PreToolUse hook matcher to control what happens to a tool call nobody answers

Group of 2 Use it now Notable New Features
JSON All of v2.1.326
Use it nowTier: how much it should matter to you
5Useful: my rating, 1 to 5
4Signal: worth watching, 1 to 5
AgentsArea: what it touches
New FeaturesKind: in v2.1.326,
What probably matters to youSection of the release

Unclear What each of the four fields makes Claude Code do is not clear.

What

A hook is code that runs at a set moment. A PreToolUse hook runs before Claude uses a tool, which is an action such as editing a file or running a command, and it can block that action. A program that embeds Claude Code through the SDK (a software kit for building on Claude Code) can register these hooks with a matcher, the rule that decides which tool calls the hook handles. That matcher can now carry a whenUnanswered setting, defined by SDKHookCallbackMatcher. Before this release, a matcher's whenUnanswered was ignored.

  • whenUnanswered takes afterSeconds, within, readsAlsoWithin and noWritesWithin.
  • Invalid values are ignored, and the tool call is then refused when the hook's time limit runs out.
  • The setting only applies when onFailure is not "continue" and the process owns Claude Code's standard input, the channel it reads typed input from.

In the same change, the records Claude Code keeps about agents gained the fields takesNoHooks, inWorkflowRun, requireCanUseTool and runLimits.

Why

This changes how a tool call is settled when the host's permission hook never replies. Developers building on the SDK can now choose how long to wait and under what conditions. A badly formed setting does not fail open: the call is refused at the hook's time limit.

Read from
Names in the bundlewhenUnansweredPreToolUse
Since it was published

The entry above is what we published on the day. These lines were added later, as Anthropic's own pages caught up, and they sit beside the original rather than replacing it.

Added since A small documentation edit on Handle approvals and user input touched a line naming PreToolUse after this was published. > To check calls that run without your callback, such as file reads inside your [working directories](https://code.claude.com/docs/en/permissions.md#working-directories), use a [`PreToolUse` hook](https://code.claude.com/docs/en/agent-sdk/… agent-sdk/user-input see the edit
Confirmed since Anthropic's documentation has since written up PreToolUse, on Choose a permission mode. > * Outside Code Mode, the classifier reviews messages Claude sends to another agent with [`SendMessage`](https://code.claude.com/docs/en/tools-reference) before Claude Code delivers them. If an allow rule matches `SendMessage` or a `PreTo… permission-modes see the edit
How sure we are
Something disagreesSomething we can check disagrees with this entry, or the writer said they could not settle it.
The writer flagged doubtWhat each of the four fields makes Claude Code do is not clear.
Anthropic's documentation agreesAnthropic's documentation has since written up PreToolUse, on Choose a permission mode.

See this entry in the whole of v2.1.326 →

Feedback