What
The system prompt is the set of standing instructions Claude Code gives the model at the start of each conversation, built from several sections. Plugins can now hook into how those sections are put together through a new hook point, prompt.compose.
- When a plugin module implements
prompt.compose, Claude Code builds the system prompt through it. - If that call fails, Claude Code builds the prompt itself as before.
- The existing
prompt.sectionhook point now also passes along where each section came from. - Plugins also get a new compose function that builds a system prompt from supplied facts, and it raises an error when the running process builds no system prompt.
Why
Plugin authors can now reorder or replace sections of the system prompt. Nothing changes unless a plugin module actually implements the hook.
Names in the bundleprompt.compose
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
One source agreesOne thing we can check says the same as this entry.
Anthropic's documentation agrees
Anthropic's documentation has since written up prompt.compose, on Mods reference.