Mods reference changedplugins/mods/reference
Upstream edited this page at 10 Oct 2026 18:15 UTC, give or take a minute or two: the time comes from Anthropic’s own sitemap rather than from a commit. This site recorded the change at 10 Oct 2026 18:37 UTC.
Upstream edited
Recorded here
Lines+1added
Lines−1removed
From line
151
where the diff opens
First seen
1 Oct 2026
this site's first read of the page
Recorded edits32to this page, all time
The whole hunk
from line 151, old and new numbered
/
from line 151
151151| [`plugin.register`](/docs/en/plugins/mods/admin#enforce-a-policy-with-a-mod-of-your-own) | A hooks module is about to load. `e.uses` lists its events, mods API calls, environment variables, and state, as `claude plugin validate` prints them. Each call is written without the `$.` prefix, such as `fs.read`. | `{ refuse: reason }` |
152152| `engine.create` | The mods API is being built for this mod | A changed mods API, to add a namespace. A mod outside the `user` [tier](#the-hook-function) can also withhold one. |
153153
154A namespace you add in an `engine.create` hook can make `$` calls of its own when another mod calls its methods. While the hook that called your method is still running, those calls act for that hook. A relative path resolves against that hook's working directory, and a call that would wait for the turn, such as `$.prompt.submit` or `$.command.run`, rejects while the turn is waiting on that hook. Once that hook and every other hook on the same event have returned, a call your method makes acts as your mod's own: a relative path resolves against the session's working directory, and a prompt is queued.
154When another mod's hook calls a method on a namespace you added in `engine.create`, your method's `$` calls run in that hook's context until every hook on that event returns. For example, a relative path resolves against that hook's working directory, and `$.prompt.submit` rejects while the turn is waiting on that hook. Calls your method makes after that run in your mod's own context.
155155
156156### Telemetry
157157
No line in this hunk matches that.