[KongchangAI]
Conceptprompt hook / agent hook / 事件钩子

Hook

An event-driven interception mechanism in Claude Code that allows developers to insert custom inspection logic at specific execution points, such as before tool calls or when a task stops. Rules can be described in natural language, which the model interprets and enforces at runtime.

Timeline (last 90 days)

Oct 8

v2.1.295 fixes the issue where a mod's Hook received truncated deeply nested tool input without any error, as well as the vulnerability where a guard Hook with .catch was bypassed during plugin worker restarts.

Unverified50%
Oct 8

Previously, a Hook failure was a soft failure (the operation continued to proceed); onFailure: "block" allows a Hook to declare a hard failure, defaulting to a fail-closed rather than fail-open strategy when infrastructure failures occur.

Unverified50%
Oct 8

Claude Code v2.1.295 introduces the onFailure: "block" option for command-type and HTTP-type Hooks, which allows a failed Hook to directly block the corresponding operation.

Unverified50%
Sep 24

For hook injection, the recommended first choice is automatic Hook injection; if the IDE does not support hooks, writing to a rules file (such as agents.md) serves as the fallback solution.

Unverified50%
Sep 24

Without hook injection, even if the Skill files are in place, the Agent will not actively call them.

Unverified50%
Sep 22

Root or hook solutions are the fastest and most stable, but require flashing the device, carry the risk of account bans, and hook implementations often break after WeChat upgrades.

Unverified50%
Sep 11

For high-risk operations such as deleting data, charging fees, and mass messaging, lifecycle hooks should be designed to automatically pause and return control to a human when triggered.

Unverified50%
Sep 11

The cross-framework portability of the Ledger depends on the Agent framework providing Hook capabilities, with the remaining functionality implemented through contracts and tools, decoupled from the specific orchestration engine.

Unverified50%
Sep 11

The two pathways for data to enter the Ledger are: automatic capture of tool errors via a Hook mechanism, and manual retrospectives initiated by user commands.

Unverified50%
Aug 26

Hook技术在JavaScript逆向中的常用方式包括重写document.cookie的setter/getter、重写XMLHttpRequest或fetch方法、使用Object.defineProperty劫持特定对象的属性访问

Unverified50%

3 more timeline events

All Facts (14)

Unverified

Claude Code内置了Hook机制,允许开发者在请求发送到模型之前拦截并处理输入内容

60%
Unverified

v2.1.295 fixes the issue where a mod's Hook received truncated deeply nested tool input without any error, as well as the vulnerability where a guard Hook with .catch was bypassed during plugin worker restarts.

50%
Unverified

Claude Code v2.1.295 introduces the onFailure: "block" option for command-type and HTTP-type Hooks, which allows a failed Hook to directly block the corresponding operation.

50%
Unverified

Previously, a Hook failure was a soft failure (the operation continued to proceed); onFailure: "block" allows a Hook to declare a hard failure, defaulting to a fail-closed rather than fail-open strategy when infrastructure failures occur.

50%
Unverified

For hook injection, the recommended first choice is automatic Hook injection; if the IDE does not support hooks, writing to a rules file (such as agents.md) serves as the fallback solution.

50%
Unverified

Without hook injection, even if the Skill files are in place, the Agent will not actively call them.

50%
Unverified

Root or hook solutions are the fastest and most stable, but require flashing the device, carry the risk of account bans, and hook implementations often break after WeChat upgrades.

50%
Unverified

For high-risk operations such as deleting data, charging fees, and mass messaging, lifecycle hooks should be designed to automatically pause and return control to a human when triggered.

50%
Unverified

The two pathways for data to enter the Ledger are: automatic capture of tool errors via a Hook mechanism, and manual retrospectives initiated by user commands.

50%
Unverified

The cross-framework portability of the Ledger depends on the Agent framework providing Hook capabilities, with the remaining functionality implemented through contracts and tools, decoupled from the specific orchestration engine.

50%
Unverified

Hook技术在JavaScript逆向中的常用方式包括重写document.cookie的setter/getter、重写XMLHttpRequest或fetch方法、使用Object.defineProperty劫持特定对象的属性访问

50%
Unverified

Hook 是确定性的机制,由 Claude Code 软件强制执行,不依赖模型判断,能保证100%执行

50%
Unverified

Hook 设定档使用 JSON 格式,通常放在专案资料夹的 .claude/settings.json 中

50%
Unverified

Hook 的三层架构为 Event(决定何时触发)、Matcher(决定拦截哪个操作)、Handler(决定执行什么动作)

50%

Source Articles