Mods reference changedplugins/mods/reference
Nearest release: v2.1.289, published 8 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 4 Oct 2026 04:46 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 4 Oct 2026 05:07 UTC.
Upstream edited
Recorded here
Lines+7added
Lines−6removed
From line
2
where the diff opens
First seen
1 Oct 2026
this site's first read of the page
Recorded edits7to this page, all time
The whole hunk
from line 2, old and new numbered
/
from line 2
22
33> Complete reference for Claude Code mods: hooks module layout, events, mods API methods, render sites, elements by surface, limits, and settings.
44
5Look up any event a [mod](/docs/en/plugins/mods/overview) can handle, mods API method it can call, or render site it can draw in, for the Claude Code CLI and the Desktop app as of v2.1.287. Each entry gives the name and a one-line description, and links to the guide section that explains it where there is one.
5Look up any event a [mod](/docs/en/plugins/mods/overview) can handle, mods API method it can call, or render site it can draw in, for the Claude Code CLI and the Desktop app as of v2.1.289. Each entry gives the name and a one-line description, and links to the guide section that explains it where there is one.
66
77<Note>
88 The complete reference is Claude Code's [TypeScript declarations for mods](https://github.com/anthropics/claude-code/blob/main/mods/types/claude-code.d.ts), which describe every event, method, and element, with examples. The copy on GitHub can be older than the Claude Code version you have installed. When the two disagree, trust [the copy Claude Code writes for your version](/docs/en/plugins/mods/create#get-the-types-for-your-build).
from line 108
108108
109109### Subagents
110110
111Subagent events fire when a subagent type is offered to Claude and when one is about to start:
111Subagent events fire when a subagent type is offered to Claude and when a subagent or an agent-team teammate is about to start:
112112
113113| Event | Fires when | A hook can return |
114114| :- | :- | :- |
115115| `agent.offer` | A subagent type is offered to Claude | `{ isOffered: false }` to withhold it |
116| `agent.spawn` | A subagent is about to start | `{ model }` or `{ deny: reason }` |
116| `agent.spawn` | A subagent or an [agent team](/docs/en/agent-teams) teammate is about to start. For a teammate, `e.isTeammate` is `true`. | `next({ ...e, model })` to choose its model, or `{ deny: reason }` |
117117
118118### Interface
119119
from line 127
127127| `ui.focus`, `ui.scroll` | The focused control or the scroll position of a pane or the band is about to change |
128128| `ui.close` | A pane is about to close. `e.id` is the pane and `e.origin.kind` is `plugin`, `person`, or `unload`. |
129129| [`ui.message`](/docs/en/plugins/mods/interface#build-a-tree-from-elements) | A `Client` element posts data to its mod |
130| [`ui.fault`](/docs/en/plugins/mods/interface#redraw-when-something-changes) | A `Client` element your mod drew failed to load, draw, or run. `e.phase` is `load`, `render`, or `run`, and `e.reason` is the error message. Requires Claude Code v2.1.289 or later. |
130131
131132### Other mods
132133
from line 161
160161| Namespace | Methods |
161162| :- | :- |
162163| `$.plugin` | `name`, `root`: this plugin's name and directory |
163| [`$.ui`](/docs/en/plugins/mods/interface#pick-where-to-draw) | `resolve`, `invalidate`, `open`, `close`, `panes`, `focus`, `scroll`, `toast`, `status`, `log`, `notice`, `ask`, `copy`, `blit` |
164| [`$.ui`](/docs/en/plugins/mods/interface#pick-where-to-draw) | `resolve`, `invalidate`, `open`, `close`, `panes`, `focus`, `scroll`, `toast`, `status`, `log`, `notice`, `ask`, `copy`, `selection`, `blit` |
164165| [`$.command`](/docs/en/plugins/mods/api#add-a-command) | `register`, `run`, `list` |
165166| [`$.tool`](/docs/en/plugins/mods/api#add-a-tool) | `register`, `call`, `check`, `list` |
166167| `$.agent` | `register`, `spawn`, `list` |
from line 239
238239
239240| Limit | Value |
240241| :- | :- |
241| 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 |
242| 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 |
242243| A `.catch` handler's execution time | 1 second |
243| All `session.end` hooks together | 1.5 seconds |
244| All `session.end` hooks together | As long as the [SessionEnd hook budget](/docs/en/hooks#sessionend-input), 1.5 seconds unless you change it, counted from when your settings `SessionEnd` hooks finish |
244245| `$.process.run` timeout | 30 seconds by default, 10 minutes at most |
245246| `$.model.complete` `maxTokens` | 1024 by default, up to 64,000 or the model's output limit |
246247| `$.fs.read` and `$.fs.write` | 4 MiB for one file |
No line in this hunk matches that.