4 pages for userpromptexpansion.
Titles and paths first, then pages whose text carries it. Each row opens that page as this site last read it.
Intercept and control agent behavior with hooks
Claude Code CLI · in the page
agent-sdk/hooks
…Code starts on its own | Inject additional context into prompts | | [`UserPromptExpansion`](/docs/en/hooks#userpromptexpansion) | No | Yes | A user-typed command, or an MCP prompt, expands into a prom…
Agent SDK reference - TypeScript
Claude Code CLI · in the page
agent-sdk/typescript
…e" | "PostToolBatch" | "Notification" | "UserPromptSubmit" | "UserPromptExpansion" | "SessionStart" | "SessionEnd" | "Stop" | "StopFailure" | "SubagentStart" | "SubagentStop" | "…
Hooks reference
Claude Code CLI · in the page
hooks
…into SessionStart, then a per-turn loop containing UserPromptSubmit, UserPromptExpansion for slash commands, the nested agentic loop (PreToolUse, PermissionRequest, PostToolUse, PostToolUseFailure, P…
Automate actions with hooks
Claude Code CLI · in the page
hooks-guide
…aude Code starts on its own](/docs/en/hooks.md#userpromptsubmit) | | `UserPromptExpansion` | When a user-typed command expands into a prompt, before it reaches Claude. Can block the expansion | | `Pre…