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.246 Home All releases olderv2.1.245 v2.1.247newer
Claude Code v2.1.246

A plugin's JavaScript hooks module can now span several files

Use it now
Useful4 Signal3
Plugins Notable

JavaScript plugin hooks can now import other files instead of being squeezed into one.

What

Hooks written in JavaScript were limited to one file; the entry file may now import other files, which are followed, compiled and parsed as part of the module. Two new ceilings apply, MAX_HOOKS_MODULE_FILES and MAX_HOOKS_MODULE_TOTAL_BYTES, on top of the existing per-file byte cap. Anything outside the import graph is refused. No new flag: this works wherever hooks modules already load.

Details
  • Only the entry file may use top-level await. An imported file that uses it is refused, because the runtime links the entry alone as an async module.
  • Hook registrations made through on are followed into imported helper functions.
  • Refused outright: shadowing or reassigning the registration API, re-exporting it from another file, and export *.
Evidence

a top-level await in a file the entry imports; the environment links the entry alone as an async module

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