[KongchangAI]
ConceptPreToolUse钩子

PreToolUse

An extension point provided by Claude Code that allows custom logic to be inserted before a tool call is executed and can return a decision that affects the final behavior.

Timeline (last 90 days)

Oct 17

claude-code-setup suggested a PreToolUse hook for this project that blocks direct editing of version-management-related files (manifest.json, src/version.js, package-lock.json, coverage/), because the project synchronizes the version numbers of three files via npm run version:*.

Unverified50%
Oct 12

The Claude Agent SDK's PreToolUse and PostToolUse hooks, combined with matchers such as Write|Edit, can block, modify, or log tool calls.

Unverified50%
Oct 9

The new version fixes a bug where a PreToolUse hook rejecting a tool call with continue:false would not end the current turn.

Unverified50%
Oct 7

PreToolUse triggers before a tool is about to be called but before it has actually executed, making it suitable for safety guardrails.

Unverified50%
Sep 28

Harness Router's PreToolUse hook inspects and makes routing decisions for every tool call that is about to occur.

Unverified50%
Aug 22

PreToolUse 事件在工具准备被调用前触发,适合安全防呆,可拦截危险的 Git 指令如 git reset --hard

Unverified50%

All Facts (6)

Source Articles