{"version":"2.1.116","anchor":"userpromptexpansion-hook-event","canonical_anchor":"userpromptexpansion-hook-event","heading":"UserPromptExpansion Hook Event","tier":null,"area":null,"scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.116\/e\/userpromptexpansion-hook-event","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.116","markdown":"### UserPromptExpansion Hook Event\n\n**What**\n\nNew hook event type that fires when a user-typed slash command expands into a prompt, allowing external hook handlers to intercept and modify the expansion.\n\n**Details**\n\n- Hook handlers receive `expansion_type`, `command_name`, `command_args`, `command_source`, and `original prompt`\n- Exit code 0: stdout is shown to Claude as additional context\n- Exit code 2: blocks the expansion and shows stderr to the user\n- Enables organizations to audit, gate, or augment slash command usage via hooks\n- Registered alongside existing hook events (UserPromptSubmit, SessionStart, SessionEnd, Stop, etc.)\n\n**Evidence**\n\nHook event definition (search for `\"UserPromptExpansion\"`) \u2014 registered at line ~51449"}