2 ファイル変更+5-3
この更新の概要
フック設定におけるアクションブロック時の動作が、イベントの種類に応じて明確に定義されました。StopおよびSubagentStopイベントでは、理由がClaudeにフィードバックされ処理が継続されますが、その他のイベントではチャットに警告が表示されターンが終了します。この変更により、ユーザーに対する警告表示とモデルへの指示フィードバックの使い分けが具体化されています。
@@ -688,7 +688,7 @@ For decisions that require judgment rather than deterministic rules, use `type:
The model's only job is to return a yes/no decision as JSON:
- `"ok": true`: the action proceeds
- `"ok": false`: the action is blocked. The model's `"reason"` is fed back to Claude so it can adjust.
- `"ok": false`: the action is blocked. For `Stop` and `SubagentStop` hooks, the `reason` is fed back to Claude so it keeps working. For other events, the turn ends and the `reason` appears in the chat as a warning line. Claude does not see it.
This example uses a `Stop` hook to ask the model whether all requested tasks are complete. If the model returns `"ok": false`, Claude keeps working and uses the `reason` as its next instruction:
@@ -2355,8 +2355,10 @@ The LLM must respond with JSON containing:
| Field | Description |
| :- | :- |
| `ok` | `true` allows the action, `false` prevents it |
| `reason` | Required when `ok` is `false`. Explanation shown to Claude |
| `ok` | `true` allows the action, `false` blocks it |
| `reason` | Required when `ok` is `false`. Explanation for the block |
For `Stop` and `SubagentStop`, an `ok: false` reason is fed back to Claude as its next instruction and the turn continues. For all other supported events, the turn ends and the reason appears in the chat as a warning line; Claude does not see it. This is equivalent to returning `"continue": false` from a command hook. If you need different blocking semantics on those events, use a [command hook](#command-hook-fields) with the per-event fields described in [Decision control](#decision-control).
### Example: Multi-criteria Stop hook