What
Hooks are pieces of code that plugins run at set points in Claude Code. The part of the hooks system that works with prompts has these changes:
- A new
prompt.composemethod, which takes the facts to compose a prompt from prompt.submitnow accepts anasUseroption, and rejects it with an error unless it is true or falseprompt.composejoins the list of hook categories that already includesprompt.sectionandprompt.context
When replying in a thread, Claude Code also now passes along a flag noting whether a message was composed only from the user's own words.
Why
This gives plugins a new point where they can take part in putting a prompt together.
Names in the bundleprompt.composeasUser
Documented inclaude-code/plugins/mods/reference
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 prompt.compose, on Mods reference.
| [`prompt.section`](/docs/en/plugins/mods/events#rewrite-or-add-to-a-prompt) | Once for each named section of the system prompt. `e.name` is the section's `id` in `prompt.compose`. | `{ text }`, or `{ text: null }` to omit the section |plugins/mods/reference see the edit
Something disagreesSomething we can check disagrees with this entry, or the writer said they could not settle it.
The writer flagged doubt
It is not known what uses `prompt.compose` or whether it is switched on for anyone.
Anthropic's documentation agrees
Anthropic's documentation has since written up prompt.compose, on Mods reference.