What
A hook is a script or handler that runs at a set point. UserPromptSubmit and prompt.submit hooks run when you send a prompt, before Claude works on it, and can block it. Claude Code now handles the case where you interrupt the turn while such a hook is still checking:
- A block the hook already gave still stands. Otherwise there is no verdict.
- The hook result is marked as ended under abort, and earlier messages are kept.
- When the hooks gave no go-ahead, the turn is returned as interrupted, with the message "the turn was interrupted while the prompt was checked". Messages are dropped on shutdown.
- A new check looks for any non-built-in
prompt.submitorclassic.UserPromptSubmithooks.
Why
An interrupt at the wrong moment should no longer let a prompt through that a hook had blocked, and one finding says the typed message is no longer lost when you interrupt during these hooks.
The same handler shape fits a guard on `prompt.submit` or `config.set`. When `next.called` is false, return the refusal that the [events reference](/docs/en/plugins/mods/reference#events) lists for that event: `{ drop: 'the reason' }` for …see the edit
The line starts with the mod's name and names a `$.prompt.submit`, `$.command.run`, or `$.agent.spawn` call, as in `first-mod: its session.start ran again in a fresh copy; the $.prompt.submit call it had already made was not made again`. C…see the edit
* Fixed a prompt that a mod's `prompt.submit` hook rewrote or dropped still being saved as typed to prompt history and to the transcript's queued-prompt recordssee the edit
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 `$.prompt.media` so a `prompt.submit` hook of a mod installed by managed settings can read the bytes of an image or document attached to the promptchangelog see the edit
When another mod's hook calls a method on a namespace you added in `engine.create`, your method's `$` calls run in that hook's context until every hook on that event returns. For example, a relative path resolves against that hook's workin…plugins/mods/reference see the edit
prompt.submit on React to events with a mod
Fixed Esc or an interrupt during a UserPromptSubmit hook or a mod's prompt.submit hook ending headless sessions, clearing the typed prompt…