Source Intelligence
Reading a new release v2.1.251 Analysing changes · 2/5 Writing the entries · 2/4 steps 470 findings $18.91 so far

DisclaimerUnofficial, and not affiliated with Anthropic. Nearly all of this is read straight out of what ships: npm bundles, captured prompts, published docs. Anthropic's own notes go in verbatim, marked as theirs. The rest is my reading, and every entry carries the strings behind it. If one looks wrong, vote it down and say why.

All of v2.1.116 Home All releases olderv2.1.114 v2.1.117newer
Claude Code v2.1.116

UserPromptExpansion Hook Event

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 →