Source Intelligence

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.242 Home All releases olderv2.1.241 v2.1.243newer
Claude Code v2.1.242

Plugin hook code is parsed and rejected unless it follows a strict shape

Not switched on
Useful2 Signal4
Plugins

Plugin hook code is parsed and rejected before running if it strays outside a narrow shape.

Static validation of plugin hook source ships with the disabled hook-module feature.

What

Before a plugin's hook file runs, its source is parsed and walked, and anything that does not match a narrow permitted shape is refused with the file name, the line and an excerpt. This makes what a hook can do checkable before execution rather than after.

Details
  • The file must export a register function taking the event registrar and options, and event names must be plain string literals naming real events.
  • Every use of the plugin API object must be written out fully at the call site. Storing it in a variable, spreading it, shadowing it, reading arguments, or using computed property access all cause a refusal.
  • At runtime the host also checks that a plugin only calls the operations its scan found.
  • The whole hooks host is behind the tengu_plugin_hooks_modules rollout flag.
Evidence

$ is always spelled $.noun.event(...) at the call site, and on is always on("<event>", hook)

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.242 →