Follow Discord
Sweep 20 Nov 2026 · 19:55Z Build v2.1.330 547 read Stable v2.1.323 Latest v2.1.330 Next v2.1.330 Feeds RSS JSON llms.txt llms-full.txt Unofficial
One change · claude-code

Mods reference changedplugins/mods/reference

Nearest release: v2.1.330, published 4 hours before upstream edited the page. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.

Upstream edited this page at 20 Nov 2026 23:34 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 20 Nov 2026 23:37 UTC.

Upstream edited
Recorded here
Lines+13added
Lines−6removed
From line 52 where the diff opens
First seen 1 Oct 2026 this site's first read of the page
Recorded edits50to this page, all time

The whole hunk

from line 52, old and new numbered
/
lines
from line 52
5252| :- | :- | :- |
5353| [`tool.call`](https://code.claude.com/docs/en/plugins/mods/events#guard-or-change-a-tool-call) | A tool is about to run | `next(e)`, `{ deny: reason }`, or `{ result }` |
5454| [`tool.check`](https://code.claude.com/docs/en/plugins/mods/events#where-settings-hooks-run-in-the-order) | Claude Code decides whether a tool call may run, after the `tool.call` and `PreToolUse` hooks. `next(e)` resolves to the decision the rules, the permission mode, and those hooks reached. | `next(e)` or `{ decision }`, with `decision` set to `allow`, `ask`, or `deny` and an optional `reason` |
55| `tool.judge` | [Auto mode](https://code.claude.com/docs/en/permission-modes.md#eliminate-prompts-with-auto-mode) is about to ask its classifier about a call. Requires Claude Code v2.1.326 or later. | `next(e)` or `{ decision }` |
56| `tool.run` | An allowed call is about to run. Requires Claude Code v2.1.326 or later. | `next(e)`, `{ deny: reason }`, or `{ result }` |
5557| `tool.describe` | Once for each tool, when its description is first sent to Claude. A second time for an MCP tool when Claude loads it through [tool search](https://code.claude.com/docs/en/mcp.md#scale-with-mcp-tool-search), with `e.description` set to the text Claude reads for the loaded tool. | `{ description }`, optionally with `isDeferred` set to `true` to put the tool behind tool search or `false` to load it upfront. Add [`breakPromptCache: true`](#break-prompt-cache) to send a changed description on the next turn. |
5658 
5759#### Agent and organization fields on `tool.check`
from line 149
147149| `session.append` | Once for each row the conversation keeps, such as a prompt, a response block, a tool result, or a notice, before it's stored | `next({ ...e, message })` with a changed `message.content`, to rewrite the row's text blocks or the `content` of a `tool_result` block in it |
148150| `session.attach`, `session.detach` | Another app connects to or disconnects from the session | `next(e)` |
149151| `session.measure` | After each turn, and when a plan limit's percent used changes | `next(e)` |
152| `session.stop` | The user stops Claude, such as with Esc during a turn. Requires Claude Code v2.1.326 or later. | `next(e)` |
150153 
151154### Subagents
152155 
from line 188
185188 
186189| Event | Fires when | A hook can return |
187190| :- | :- | :- |
188| [`plugin.register`](https://code.claude.com/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 }` |
189| `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. |
191| [`plugin.register`](https://code.claude.com/docs/en/plugins/mods/admin#enforce-a-policy-with-a-mod-of-your-own) | A hooks module is about to load, or, on v2.1.326 or later, a plugin without one. `e.uses` lists the module's 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 }`. On v2.1.326 or later, a refusal keeps out the whole plugin, and `next({ ...e, provides: { ...e.provides, modules: [] } })` keeps out only its hooks module. Earlier versions ignore `provides` and load the module. |
192| `engine.create` | The mods API is being built for this mod | A changed mods API, to add a namespace. A mod in the `prepend` or `append` [tier](#the-hook-function) can also withhold one. |
190193 
191194When 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.
192195 
from line 239
236239| [`$.model`](https://code.claude.com/docs/en/plugins/mods/api#call-a-model) | `complete`, `fork`, `classify` |
237240| [`$.prompt`](https://code.claude.com/docs/en/plugins/mods/api#start-a-turn-from-a-background-job) | `submit`, `read`, `fill`, `suggest`, `compose`. Claude reads text from `submit({ text })` after a sentence that names your mod as the sender. `submit({ text, asUser: true })` sends the text as the user's own words, without that sentence. |
238241| `$.turn` | `abort` |
239| [`$.session`](https://code.claude.com/docs/en/plugins/mods/api#send-and-receive-messages-between-sessions) | `messages`, `cwd`, `root`, `model`, `turns`, `id`, `repo`, `surfaces`, `usage`, `version`, `compact`, `send`, `append`, `authorize`. `usage()` returns `{ startedAt, context, rateLimits, cost }`: `context` has `tokens`, `window`, and `percent`, and `rateLimits` is a list of `{ kind, percentUsed, resetsAt }`. |
242| [`$.session`](https://code.claude.com/docs/en/plugins/mods/api#send-and-receive-messages-between-sessions) | `messages`, `cwd`, `root`, `model`, `turns`, `id`, `repo`, `surfaces`, `usage`, `version`, `info`, `compact`, `send`, `append`, `authorize`. `info` requires Claude Code v2.1.326 or later. `usage()` returns `{ startedAt, context, rateLimits, cost }`: `context` has `tokens`, `window`, and `percent`, and `rateLimits` is a list of `{ kind, percentUsed, resetsAt }`. |
240243| `$.config` | `list`, `set` |
241244| [`$.settings`](https://code.claude.com/docs/en/plugins/mods/api#reach-files-processes-and-the-network) | `read` |
242245| [`$.env`](https://code.claude.com/docs/en/plugins/mods/api#reach-files-processes-and-the-network) | `get`, `set` |
from line 248
245248| [`$.state`](https://code.claude.com/docs/en/plugins/mods/interface#keep-a-value-in-\$-state) | Reactive state: `get`, `set`, with the helpers `atom`, `read`, `update`, `derive`, and `memberOf` imported from `claude-code` |
246249| [`$.clock`](https://code.claude.com/docs/en/plugins/mods/api#run-work-in-the-background) | `now`, `sleep`, `after`, `every` |
247250| [`$.http`](https://code.claude.com/docs/en/plugins/mods/api#reach-files-processes-and-the-network) | `fetch` |
248| [`$.process`](https://code.claude.com/docs/en/plugins/mods/api#reach-files-processes-and-the-network) | `run`, `spawn` |
251| [`$.process`](https://code.claude.com/docs/en/plugins/mods/api#reach-files-processes-and-the-network) | `run`, `spawn`, `hookEnv`. `hookEnv` requires Claude Code v2.1.326 or later. |
249252| [`$.mcp`](https://code.claude.com/docs/en/plugins/mods/api#reach-files-processes-and-the-network) | `call`, `connect`. `connect(server)` connects an MCP server that your own plugin's manifest lists. |
253| [`$.wasm`](https://code.claude.com/docs/en/plugins/mods/api#reach-files-processes-and-the-network) | `compile`. Requires Claude Code v2.1.326 or later. |
250254| `$.audio` | `play`, `speak` |
251255| `$.telemetry` | `log`, `mark`. A record is sent only when Claude Code or a built-in mod makes the call. |
252256 
from line 278
274278| `InfoNotice` | `text`, `command` | The notice's `text` prefixed with `notice:` | Terminal |
275279| `SessionMode` | `modes` | One instance | Terminal, Desktop |
276280| `PromptHint` | `isDraft`, `isWorking`, `hint` | One instance | Terminal, Desktop |
281| `AgentRow` | The agent's [`$.agent.list()` fields](https://code.claude.com/docs/en/plugins/mods/create#get-the-types-for-your-build), plus `rowIds`, `columns`, `body`, and `isHidden` | The agent id | Terminal and VS Code's [Focus view](https://code.claude.com/docs/en/vs-code.md#extension-settings). Requires v2.1.326 or later of Claude Code or the extension. |
277282 
278283`e.viewport` holds `columns`, `rows`, and `isFullscreen`. In the terminal and the Desktop app, it's absent until the app has measured its window. There, its `rows` is the height of the whole window, not of your pane. In the VS Code extension, it's always present.
279284 
from line 402
397402| :- | :- |
398403| A hook's own execution time for one event, not counting time inside `next` or a mods API call other than `$.clock.sleep` | 10 seconds, or 50 milliseconds for a `prompt.edit` hook |
399404| A `.catch` handler's execution time | 1 second |
405| Time a `ui.render` or `plugin.register` hook waits on mods API calls for one event | 30 seconds for `ui.render`. 10 seconds for `plugin.register`, not counting `$.ui.ask`. The `ui.render` limit and the `$.ui.ask` exemption require Claude Code v2.1.326 or later. |
400406| All `session.end` hooks together | As long as the [SessionEnd hook budget](https://code.claude.com/docs/en/hooks.md#sessionend-input), 1.5 seconds unless you change it, counted from when your settings `SessionEnd` hooks finish |
401407| `$.process.run` timeout | 30 seconds by default, 10 minutes at most |
402408| `$.process.run` `stdout` and `stderr` | 4 MiB each. `isStdoutTruncated` or `isStderrTruncated` is `true` when one was cut. |
403409| `$.model.complete` `maxTokens` | 1024 by default, up to 64,000 or the model's output limit |
404| `$.fs.read` and `$.fs.write` | 4 MiB for one file |
410| `$.fs.read` and `$.fs.write` | 4 MiB for one file. On v2.1.326 or later, read a larger file in parts with `$.fs.read(path, { offset, length })`, both in bytes. |
405411| A `$.http.fetch` request body | 4 MiB, counted in characters. A call with a larger body rejects. |
406412| A `$.http.fetch` response body | 4 MiB. `text` holds the first 4 MiB and the rest isn't read. When the `Content-Length` header declares more, the call rejects instead, with a reason that ends `is over the 4194304-byte limit`, except when the last request after any redirects uses the `HEAD` method. The `HEAD` exemption requires Claude Code v2.1.296 or later. |
407413| One `$.http.fetch` call, redirects and body included | 30 seconds |
from line 417
411417| A `Code`'s `language` or `path`, a `Select` option's `value`, or a `Client`'s `module` | 10,000 characters. If one is longer, the `ui.render` hook that returned it [fails](https://code.claude.com/docs/en/plugins/mods/events.md#handle-a-hook-that-fails). |
412418| A `Link`'s `href` | 2,048 characters. If it's longer, the `ui.render` hook that returned it [fails](https://code.claude.com/docs/en/plugins/mods/events.md#handle-a-hook-that-fails). |
413419| Nesting depth of one tree | 32 levels below the root element |
420| Depth and size of a tree counted with its prop values | Claude Code refuses anything `nested more than 100 lists and objects deep` or with `more than 1000000 values once written out`. Requires Claude Code v2.1.326 or later. |
414421| Elements and text children in one tree | 20,000 |
415422| `Raster` cells in one tree, each `Raster`'s `columns` times its `rows` | 262,144 |
416423| The rows above the prompt, stacked | Elements, `Raster` cells, and `Image` bytes add up across the rows, against the limits for one tree |
from line 429
422429| A pane opened without the user asking | Placed from 144 terminal columns, 110 after they've opened it once |
423430| Rows from `$.ui.place` that one mod has in a conversation at one time | 500. At the limit, a call with a new `id` resolves to `{ isPlaced: false, reason: 'a plugin holds at most 500 placed rows' }`. |
424431| Nesting depth of a mods API call's arguments | 28,000 levels. Past that, the call rejects with a message ending `nesting deeper than 28000 levels is not supported`. Requires Claude Code v2.1.299 or later. |
425| Nesting depth of a changed event passed to `next`, outside [async generator hooks](#events) such as one on `turn.step` | 28,000 levels. Past that, `next` rejects with a message ending `nesting deeper than 28000 levels is not supported`. Requires Claude Code v2.1.299 or later. |
432| Nesting depth of a changed event passed to `next`, outside `ui.render` and [async generator hooks](#events) such as one on `turn.step` | 28,000 levels. Past that, `next` rejects with a message ending `nesting deeper than 28000 levels is not supported`. Requires Claude Code v2.1.299 or later. |
426433| Nesting depth of a hook's return value, outside `ui.render`, `ui.resolve`, and async generator hooks | 28,000 levels. Past that, the hook's result is refused, and [the notice that reports it](https://code.claude.com/docs/en/plugins/mods/troubleshoot.md#find-out-why-a-mod-does-nothing) includes `nesting deeper than 28000 levels is not supported`. Requires Claude Code v2.1.299 or later. |
427434| Scopes, such as functions, blocks, and loops, nested inside one another in one file of a hooks module | 2,000 |
428435| Command, tool, subagent type, and pane names, the `id` of a placed row, and the `scene` of a backdrop | Letters, digits, `_`, and `-`, up to 64 characters |
Feedback