What
Hooks on the UserPromptExpansion event can now return a flag that keeps the user's original prompt text out of the message shown when the hook blocks the prompt. This matches what the prompt-submit hook could already do, and works on this build with no flag to enable.
Details
- The hook output schema gained the optional boolean alongside
additionalContext. - The consumer copies it onto the hook result along the same path the prompt-submit hook uses.
- Only takes effect when the hook's decision is
block.
Evidence
When decision is "block", omit the original prompt from the block message
Strings lifted out of the shipped bundle, so the claim above can be checked against them.
Names in the bundleUserPromptExpansion
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.
Confirmed since
Anthropic's documentation has since written up UserPromptExpansion, on Hooks reference.
| UserPromptSubmit, UserPromptExpansion, PostToolUse, PostToolUseFailure, PostToolBatch, Stop, SubagentStop, ConfigChange, PreCompact | Top-level `decision` | `decision: "block"`, `reason`. Stop and SubagentStop also accept `hookSpecificOu…hooks see the edit
One source agreesOne thing we can check says the same as this entry.
Anthropic's documentation agrees
Anthropic's documentation has since written up UserPromptExpansion, on Hooks reference.