II.
HookSurface overview
Reference · livehook-surface:claude.user-prompt-expansion
UserPromptExpansion (Claude Code) overview
Fires when a slash command (or MCP prompt) expands into a prompt — before the expanded prompt enters the model context. Subscribers can inspect the expansion, mutate it, or block it via decision: "block" / exit 2. Matchable by command name. Canonicalizes loosely to UserPromptSubmit.
Attributes
eventName
UserPromptExpansion (Claude Code)
displayName
UserPromptExpansion (Claude Code)
kind
native
originVendor
Anthropic
direction
pre
blocking
true
family
shell-hook
payloadSchema
type
object
required
- hook_event_name
- expansion_type
- command_name
- command_source
- prompt
properties
hook_event_name
type
string
const
UserPromptExpansion
expansion_type
type
string
enum
- slash_command
- mcp_prompt
command_name
type
string
command_args
type
string
command_source
type
string
enum
- plugin
- skill
- builtin
- mcp
prompt
type
string
description
Fires when a slash command (or MCP prompt) expands into a prompt — before
the expanded prompt enters the model context. Subscribers can inspect the
expansion, mutate it, or block it via decision: "block" / exit 2.
Matchable by command name. Canonicalizes loosely to UserPromptSubmit.
Outgoing edges
canonicalized_to1
- hook-surface:user-prompt-submit·HookSurfaceUserPromptSubmit (canonical)
Incoming edges
exposes1
- agent-runtime-impl:claude-code.runtime@1.x·AgentRuntimeImplClaude Code Runtime (1.x)
maps_hook1
- hook-mapping:claude-user-prompt-expansion·HookMapping