Follow Discord
Sweep 22 Oct 2026 · 04:32Z Build v2.1.308 527 read Stable v2.1.308 Latest v2.1.308 Next v2.1.308 Feeds RSS JSON llms.txt llms-full.txt Unofficial

Claude Code v2.1.116 ·

UserPromptExpansion Hook Event

Entry
JSON All of v2.1.116
EntryKind: in v2.1.116,
ChangesSection of the release
What

New 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.

Details
  • Hook handlers receive expansion_type, command_name, command_args, command_source, and original prompt
  • Exit code 0: stdout is shown to Claude as additional context
  • Exit code 2: blocks the expansion and shows stderr to the user
  • Enables organizations to audit, gate, or augment slash command usage via hooks
  • Registered alongside existing hook events (UserPromptSubmit, SessionStart, SessionEnd, Stop, etc.)
Evidence

Hook event definition (search for "UserPromptExpansion") — registered at line ~51449

Strings lifted out of the shipped bundle, so the claim above can be checked against them.

See this entry in the whole of v2.1.116 →

Feedback