-
$.pluginnoun This plugin, as loaded: its manifest name and its directory. -
$.plugin.nameverb From plugin.json; debug-log and `$.ui.log` lines carry it. -
$.plugin.rootverb The plugin's directory (the one holding plugin.json), absolute. -
$.uinoun Display: a line under an open dialog, a redraw or a repaint, a -
$.ui.noticeverb Shows `text` as one line under the dialog open for `tool_use_id`, or -
$.ui.invalidateverb Re-runs an event whose results the engine caches: `ui.render` draws the -
$.ui.blitverb Repaints a mounted `Raster` this plugin's own render hook drew with new -
$.ui.resolveverb The elements of the surface `e` is drawn on (Elements[e.surface]): a -
$.ui.logverb Appends one line to the transcript, drawn like a system notice (dim; -
$.ui.askverb Asks the user `question` in the engine's own AskUserQuestion dialog and -
$.ui.toastverb Shows `text` on the notification bar under the prompt for a few -
$.ui.statusverb Pins `text` as this plugin's status line under the prompt, beside the -
$.ui.openverb Opens a pane: a framed region the surface places, whose body this -
$.ui.closeverb Closes one of the open panes; an id that is not open is left alone. -
$.ui.panesverb Lists this plugin's own open panes (UiPane): each one's id and title, -
$.ui.scrollverb Scrolls something into view as the DOM's `scrollIntoView` would: a -
$.ui.focusverb Moves the focus ring of one of this plugin's sites onto an element it -
$.modelnoun Completions through the session's own client and credentials. -
$.model.completeverb Runs one text completion through the session's own API client and -
$.model.forkverb Runs one tool-less completion over the session's OWN transcript, sharing -
$.model.classifyverb Picks one of `labels` for `text` with one completion over -
$.audionoun Sound: clip playback and platform speech. -
$.audio.playverb Plays one audio clip, starting now; clips are not queued, so two calls -
$.audio.speakverb Speaks `text` with the platform's own synthesizer (`say` on macOS). -
$.mcpnoun The engine's connected MCP servers. -
$.mcp.callverb Calls `tool` on one of the engine's connected MCP servers with the -
$.sessionnoun The running session, read as plain data, and compacting it. -
$.session.messagesverb Returns the transcript so far, one entry per user or assistant -
$.session.cwdverb Returns the directory the session runs in, absolute. -
$.session.rootverb Returns the session's project root, absolute: where it started, or -
$.session.modelverb Returns the main loop's model, as `/model` shows it. -
$.session.turnsverb Returns how many prompts the user has sent this session (user turns in -
$.session.idverb Returns the session's id (the transcript file's name). -
$.session.repoverb Returns the git repository the session runs in, read from the working -
$.session.surfacesverb Returns every surface the session draws on, each once: `terminal` under -
$.session.surfaceverb Returns the first of `$.session.surfaces()`, or null where nothing -
$.session.usageverb Returns the context window's fill, the rate-limit windows and the -
$.session.compactverb Compacts the conversation: the event `session.compact` with `trigger` -
$.session.authorizeverb Holds the session's Anthropic credential on the host and answers an -
$.turnnoun The running model turn: ending it. -
$.turn.abortverb Cancels the running model turn: the one whose id `turn.start` handed -
$.promptnoun Submitting a prompt the model reads as a user turn, and the person's -
$.prompt.submitverb Submits a prompt: the event `prompt.submit`, the same call the engine -
$.prompt.readverb Returns the prompt box as it stands, the draft typed so far and the -
$.prompt.fillverb Puts `input.text` in the prompt box as the draft, by `mode`: `replace` -
$.prompt.suggestverb Proposes `input.text` as the prompt box's dim suggestion, Tab to take: -
$.toolnoun The tools the model has in this session, and running one. -
$.tool.listverb Returns the tools the model can call now, built-in and MCP alike, in -
$.tool.callverb Calls a tool: the event `tool.call`, the same call the engine makes for -
$.tool.checkverb Asks the engine's permission decision for a tool call now: the event -
$.tool.registerverb Declares a tool the model can call from the next prompt on: the name, -
$.commandnoun The slash commands the person can run in this session, and running one. -
$.command.listverb Returns the slash commands the person can run now, built-in, plugin -
$.command.runverb Runs a slash command as if the person typed `/command args`: the -
$.command.registerverb Declares the slash command `/<name>` for this session, listed in the -
$.confignoun Every row of the settings menu (`/config`), the panel's own and each -
$.config.listverb Returns the rows the `/config` menu would draw now, in its order, -
$.config.setverb Changes one row as if the person did in the menu: the event -
$.agentnoun Subagents. -
$.agent.spawnverb Spawns a subagent: the event `agent.spawn`, the same call the engine -
$.agent.listverb Returns the session's subagents so far, the ones the model spawned and -
$.agent.registerverb Defines an agent type the Agent tool dispatches from the next turn on, -
$.fsnoun The file system as the engine's own process reaches it; a relative path -
$.fs.readverb Reads a file and returns its text, or with `{ as: "bytes" }` its bytes -
$.fs.writeverb Writes `text` to a file, creating it and its directories as needed. -
$.fs.listverb Lists a directory: `{ name, kind, size, isLink }` per entry, by name, -
$.fs.existsverb Returns whether the path exists; rejects only a network location as -
$.fs.statverb Returns `{ kind, size, mtimeMs, isLink }` of the path: what it leads to, -
$.fs.ancestorsverb Reads the named instruction files in every directory above the -
$.storenoun This plugin's own key-value store, kept between sessions and hot -
$.store.getverb Returns the value under `key`, or `undefined` when unset. -
$.store.setverb Sets `key` to `value`, which must be JSON data. -
$.store.deleteverb Removes `key` from the store. -
$.store.keysverb Returns every key set, in insertion order. -
$.clocknoun The time and timers, each an event through the host: `clock.now` reads -
$.clock.nowverb Resolves milliseconds since the epoch, now. -
$.clock.sleepverb Resolves after `ms` milliseconds; rejects at once when `signal` aborts. -
$.clock.afterverb Calls `fn` once after `ms` milliseconds; `cancel()` before then stops it. -
$.clock.everyverb Calls `fn` every `ms` milliseconds (at least 1) until `cancel()`. -
$.httpnoun The network, through the host. -
$.http.fetchverb Fetches `url` through the host (never the plugin's own network) and -
$.processnoun Commands on the host, run as the user the session runs as. CLI only. -
$.process.runverb Runs a command on the host by its argument vector (no shell) and -
$.settingsnoun What the settings files, `--settings` and managed policy hold, as the -
$.settings.readverb Resolves with the settings merged over every source, as the engine -
$.envnoun The environment of this process, the one every Bash child, MCP server -
$.env.getverb Resolves with the variable's value, or `undefined` when it is unset. -
$.env.setverb Sets the variable for this process and everything it starts after, or -
tool.callevent Fires when the engine is about to run a tool. `next(e)` runs the hooks -
tool.checkevent Fires when the engine decides whether a tool call may run, after the -
ui.renderevent Fires when the engine is about to draw a component: once per input value -
ui.resolveevent Fires when the plugins load (not per draw), once per surface, component -
ui.pressevent Fires when a `Button` a render hook drew is pressed on a surface; `e` is -
ui.inputevent Fires when an `Input` a render hook drew changes or is submitted; `e` is -
ui.selectevent Fires when a `Select` a render hook drew is picked from; `e` is -
ui.messageevent Fires when a `Client` THIS plugin drew posts from its surface module -
ui.scrollevent Fires before a site's window moves: the person's wheel or scroll keys on -
ui.focusevent Fires before a site's focus ring moves: the person's Tab, arrows or click -
agent.offerevent Fires when the engine offers an agent type to the model, in the agent -
agent.spawnevent Fires when the Agent tool is about to start a subagent, everything -
prompt.submitevent Fires when a prompt is submitted, before the turn starts. `next(e)` runs -
prompt.fillevent Fires when a text is about to be put in the prompt box as the person's -
prompt.suggestevent Fires when a text is proposed as the prompt box's dim suggestion, Tab to -
prompt.editevent Fires when the person edits the main prompt box: a key the editor took as -
prompt.sectionevent Fires once per named section of the system prompt, when the engine -
prompt.contextevent Fires once per conversation, when the engine computes the context blocks -
prompt.attachmentevent Fires once per message the engine injects for the model on its own (a -
tool.describeevent Fires once per tool, when the engine first renders the tool's schema in -
command.runevent Fires when a slash command is about to run (`/name args` typed, or a -
command.describeevent Fires once per command, when the engine lists it for the typeahead and -
config.setevent Fires when a `/config` row is about to change, from the menu or a -
config.describeevent Fires once per `/config` row, when the menu lists it and for -
skill.promptevent Fires when the engine expands a skill's prompt for the model (`/name`, -
attribution.textevent Fires when the engine composes a git text the model is to write (`kind`: -
session.startevent Fires once per process for each loaded plugin, before the first prompt, -
session.receiveevent Fires when a delivery reaches the session (a relay's event, a peer's -
session.compactevent Fires when the conversation is about to be compacted (`/compact`, the -
session.attachevent Fires when a remote client joins the session's roster of attached -
session.detachevent Fires when a client leaves the roster: it detached, or the session ended -
session.measureevent Fires when the engine measures the session and a unit moved: after each -
session.endevent Fires once when the session ends (exit, /clear, resume, logout, signal, a -
plugin.registerevent Fires once per hooks module about to join the chain, at load (the set -
turn.startevent Fires when a model turn begins, before its first model call; `next(e)` -
turn.stepevent Fires when the engine is about to send a model request of a turn, main's -
turn.completeevent Fires when a model turn has ended, at the point its duration is reported; -
engine.createevent Runs while `$` is being built, once per load or reload of this plugin -
model.completeevent The argument of `$.model.complete(request)`. -
model.forkevent The argument of `$.model.fork(request)`. -
audio.speakevent The argument of `$.audio.speak(text, { voice })`. -
session.cwdevent The argument of `$.session.cwd()`. -
session.rootevent The argument of `$.session.root()`. -
session.modelevent The argument of `$.session.model()`. -
session.turnsevent The argument of `$.session.turns()`. -
session.idevent The argument of `$.session.id()`. -
session.messagesevent The argument of `$.session.messages()`. -
session.repoevent The argument of `$.session.repo()`. -
session.surfaceevent The argument of `$.session.surface()`. -
session.surfacesevent The argument of `$.session.surfaces()`. -
session.authorizeevent The argument of `$.session.authorize()`. -
session.usageevent The argument of `$.session.usage({ breakdown, columns })`. -
prompt.readevent The argument of `$.prompt.read()`. -
tool.listevent The argument of `$.tool.list()`. -
tool.registerevent The argument of `$.tool.register(spec)`. -
command.listevent The argument of `$.command.list()`. -
command.registerevent The argument of `$.command.register(spec)`. -
config.listevent The argument of `$.config.list()`. -
agent.listevent The argument of `$.agent.list()`. -
agent.registerevent The argument of `$.agent.register(spec)`: the agent type as the plugin -
ui.openevent The argument of `$.ui.open({ id, title, focus })`; a hook above the -
ui.closeevent The argument of `$.ui.close({ id })` with `origin` `plugin`; the engine -
ui.panesevent The argument of `$.ui.panes()`. -
ui.blitevent The argument of `$.ui.blit(...)`: a Raster's `cells` or a keyed Image's -
fs.ancestorsevent The argument of `$.fs.ancestors({ names, of, below })`. -
store.keysevent The argument of `$.store.keys()`. -
clock.nowevent The argument of `$.clock.now()`. -
clock.sleepevent The argument of `$.clock.sleep(ms, { signal })`; the signal does not -
clock.afterevent The argument of `$.clock.after(ms, fn)`: the wait before `fn`, which -
clock.everyevent The argument of `$.clock.every(ms, fn)`, dispatched once per period: -
settings.readevent The argument of `$.settings.read({ source })`. -
AgentCallRecordtype What an Agent call a plugin raised (`$.tool.call({ tool: "Agent", ... })`) -
AgentInfotype One agent loop of this session as `$.agent.list()` returns it: a subagent -
AgentLooptype Which model loop an event happened in: the loop's agent id inside a -
AgentOfferInputtype The input of `agent.offer`: one agent type, at the moment the engine -
AgentOfferResulttype What an `agent.offer` hook returns: whether the model is offered the agent -
AgentSpawnArgstype `agent.spawn`'s input as the call takes it: what the Agent tool's caller -
AgentSpawnInputtype The input of `agent.spawn`: what the Agent tool decided about the -
AgentSpawnResulttype What an `agent.spawn` hook returns and what `next(e)` resolves to: the -
AgentSpectype What `$.agent.register` takes: an agent type this plugin defines, spelled -
AnyEventHooktype The hook `on("*", hook)` takes: it runs on every event, plugin nouns no -
AnyKeyOftype Every key of every variant, index signatures included. -
Argstype The argument of event `N`: `e` in its hooks, and what its call takes. For a -
AskOptionstype Options of `$.ui.ask`. -
AttributionTextInputtype The input of `attribution.text`: one text the engine asks the model to -
AttributionTextKindtype Which git text `attribution.text` carries: the commit trailer, the PR -
AttributionTextResulttype What an `attribution.text` hook returns: the text the model reads in -
AudioCliptype What `$.audio.play` plays: a URL the engine fetches, or the bytes. -
BackgroundTaskSummarytype -
BaseHookInputtype -
BoxHoverPropstype The `Box` props a `hover` may override, none of which moves the Box's -
BoxPropstype The props of `Box`: the layout, position, margin, padding and border props -
BuiltinToolCallInputtype One variant per built-in tool; with none in the table (a plugin author's -
BuiltinToolCallInputFallbacktype The built-in branch's answer when no built-in tool is declared: every -
BuiltinToolInputsinterface The arguments of each built-in tool by name, for declaration merging; -
BuiltinToolNametype The names of the built-in tools. -
BuiltinToolResultsinterface The structured result of each built-in tool by name, for declaration -
ButtonPropstype The props of `Button`, every surface's pressable leaf: an address, a -
CatchHandlertype The handler `on(...).catch(handler)` takes for a hook of type `F`: the -
Caughttype What `next` carries into a `.catch` handler and nowhere else: why the -
Chunktype What a hook on streaming event `N` yields, and what its `next(e)` yields -
ChunkOftype The chunk type of each streaming event, by name: what its stream yields. -
ChunkReftype What every `turn.step` chunk may carry: the engine's handle on the item -
ClassicEventNametype The name of a classic hook event as a function-hooks event: the settings -
ClassicEventOftype The classic (settings) hook events, one per classic event name: `e` is -
ClassicHookEventtype The name of a classic hook event: `PreToolUse`, `Stop`, and the rest. -
ClassicHookInputstype What a classic hook receives on stdin for each event, by event name: the -
ClassicResulttype Everything a classic hook event's answer can carry, named as the classic -
ClassicResultFieldstype The event-specific fields of ClassicResult each classic event reads (its -
ClassicResultOftype What each classic hook event's hook returns and its `next(e)` resolves to: -
ClassifyOptionstype Options of `$.model.classify`. -
ClientElementstype The element table a surface module draws with, `surface.elements`: the -
ClientKeyEventtype One key the person pressed while a `Client` had the focus, as -
ClientModuletype The component a surface module exports (default, or its one PascalCase -
ClientPointerEventtype One pointer event over a `Client`'s region, as `surface.onPointer` hands -
ClientPointerTypetype What the pointer did over a `Client`'s region: a button went down, the -
ClientPropstype The props of `Client`: which of the plugin's surface modules draws here, -
ClientSurfacetype What a surface module's function receives as its second argument: its -
ClockWaittype The argument of the `$.clock` waits (`sleep`, `after`, `every`): how long, -
CodePropstype The props of `Code`, source text every surface draws with the engine's own -
CommandDescribeInputtype The input of `command.describe`: how one slash command presents in the -
CommandDescribeResulttype What a `command.describe` hook returns: the description, hint and hidden -
CommandInfotype One slash command as `$.command.list()` returns it. -
CommandPresentationtype Where a command's answer will show: which of the terminal's two layouts -
CommandRunArgstype `command.run`'s input as a plugin's `$.command.run` takes it: `args` may -
CommandRunInputtype The input of `command.run`: one slash command about to run, the way the -
CommandRunResulttype What a `command.run` hook returns and what `next(e)` and `$.command.run` -
CommandSourcetype Where a slash command comes from, as `$.command.list()` tells them apart. -
CommandSpectype What `$.command.register` takes: the slash command this plugin serves. -
ConfigChangeHookInputtype -
ConfigDescribeInputtype The input of `config.describe`: how one `/config` row presents, at the -
ConfigDescribeResulttype What a `config.describe` hook returns: the label, help text and hidden -
ConfigKindtype How a `/config` row takes its value: `boolean` toggles, `choice` picks one -
ConfigOrigintype Where a `config.set` came from, in `prompt.submit`'s words: the person -
ConfigRowtype One `/config` row as `$.config.list()` returns it: what the menu would -
ConfigSetArgstype `config.set`'s input as a plugin's `$.config.set(args)` takes it: the -
ConfigSetInputtype The input of `config.set`: one `/config` row about to change, from the -
ConfigSetResulttype What a `config.set` hook returns and what `next(e)` resolves to: -
ConfigValuetype A `/config` row's value as a hook and `$.config` see it: a toggle's -
ContextAgenttype One custom agent whose description the Agent tool's prompt carries; -
ContextApiUsagetype The token counts the last API response of the live window reported, as -
ContextBreakdownDetailtype How a context breakdown is counted: `full` with the token-count API per -
ContextCategorytype One row of the breakdown, as /context lists it beside the grid (`System -
ContextCategoryKindtype What a breakdown row is; branch on this, never on the row's `name`. -
ContextGridSquaretype One square of the grid /context draws: which row it belongs to and how -
ContextMcpTooltype One MCP tool's schema as the context carries it. -
ContextMemoryFiletype One memory file the context carries (a CLAUDE.md, a rules file, an -
ContextSkilltype One skill whose listing the context carries. -
ContextSkillstype The skills the context lists for the model: how many there are, how many -
ContextSlashCommandstype The slash commands the Skill tool's prompt lists, counted. -
ContextWindowSourcetype How the window the breakdown measures against was settled; /context -
CoreEngineInterfaceinterface The plugin's identity (`plugin`) and the nouns core contributes to `$` as -
CoreEventNametype The name of an event the engine defines itself (a key of CoreEventOf); -
CoreEventOftype The argument of each event the engine defines itself: its call sites' -
CwdChangedHookInputtype -
DirectoryAddedHookInputtype -
ElementChildrentype The `children` field every element constructor's props carry, appended -
ElementConstructortype An element as `$.ui.resolve(e)` hands it out: a constructor from props to -
ElementNametype Every element name of every surface: what a table handed out is completed to -
Elementstype The element constructors each surface draws, by `e.surface`: what -
ElementTabletype The table `ui.resolve` answers for an argument of surface `P`. -
ElicitationHookInputtype Hook input for the Elicitation event. Fired when an MCP server requests user input. Hooks can auto-respond (accept/decline) instead of showing the dialog. -
ElicitationResultHookInputtype Hook input for the ElicitationResult event. Fired after the user responds to an MCP elicitation. Hooks can observe or override the response before it is sent to the server. -
EngineCreateInputtype The input of `engine.create`: the fold that builds `$`, once per load, -
EngineCreateResulttype What an `engine.create` hook returns: `$` as built so far with this -
EngineEventOftype The events the engine raises at its call sites, and `engine.create`; the -
EngineInterfaceinterface `$`, the first parameter of every hook. Frozen; core's interface plus -
EngineInterfaceBuilttype What `next(e)` resolves to at `engine.create`: `$` as the steps beneath -
EngineResultOftype The engine's events' results. -
EventCallstype The engine's own events as calls on `$`, one signature each: -
EventNametype The name of an event: a key of EventOf, the engine's own (CoreEventName) -
EventOftype The argument of each event, by event name: what a hook receives as `e` -
EventResulttype The result of event `N`: what its hooks return and what their `next(e)` -
Eventstype The hook signature of each event, `($, e, next)`, as one mapped type over -
ExitReasontype -
FileChangedHookInputtype -
Frozentype `T` with every property read-only to every depth, arrays and tuples kept -
FsAncestortype One file `$.fs.ancestors` found: the directory it stands in, the name it -
FsAncestorParttype One file of an ancestor entry: the file itself or one it imported. -
FsAncestorsRequesttype The argument of `$.fs.ancestors`: the file names to look for in each -
FsBytestype What `$.fs.read(path, { as: "bytes" })` resolves with: the file's bytes, -
FsEntrytype One entry of `$.fs.list`: the entry itself, a link not followed. -
FsReadAstype How `$.fs.read` answers: `text` (UTF-8, the default) or `bytes` (base64). -
FsReadBytesOptionstype The options of `$.fs.read` that ask for the bytes: the call answers -
FsReadCalltype `$.fs.read`: the file's text, or with `{ as: "bytes" }` its bytes as -
FsReadOptionstype The options of `$.fs.read`. -
FsStattype What `$.fs.stat` resolves with: what the path leads to, whether the path -
FsStatOptionstype The options of `$.fs.stat`. -
Globtype Every event (`*`), or every event under a namespace (`classic.*`: each -
GlobHooktype The hook `on(pattern, hook)` takes for a glob or a negation: one function -
GlobNexttype `next` in a hook on a glob or a negation: an overload per selected event, -
GlobNextResulttype What `next(e)` resolves to in a glob hook before `e` is narrowed: the -
Hooktype One hook, `($, e, next)`, on event `E`. -
HookBudgettype The time bounds every hook runs under, in milliseconds: the engine's own -
HookFailuretype Why a hook failed, as its `.catch` handler reads it on `next.error`: plain -
HookFortype The hook type per pattern: an event's own (Events), `*`'s (AnyEventHook), -
HookInputtype -
HookOftype The hook event `E` takes: an async generator over its chunks for a -
HooksModuletype What a hooks module exports: `register`, and nothing the loader reads -
HookStreamtype What `next(e)` returns on a streaming event: the stream of everything -
HttpInittype Options of `$.http.fetch`. -
HttpResponsetype What `$.http.fetch` resolves with. -
ImageBlitArgstype A `$.ui.blit` argument swapping one of the caller's mounted keyed Images -
ImagePropstype The props of `Image`, the terminal surface's picture leaf: pixels over a -
ImageSourcetype The picture an `Image` shows: base64 bytes the plugin holds (at most 2 MiB -
ImpossibleKeystype The keys of object pattern `P` that object member `E` cannot satisfy, `D` -
InputPropstype The props of `Input`, every surface's one-line text field: an address, -
INSTRUCTION_FILE_KINDSconst Every tier an instruction file can belong to, for checking a hook's -
InstructionFiletype One instruction file behind the `claudeMd` block: where it was read, its -
InstructionFileKindtype What tier an instruction file belongs to: the organization's managed -
InstructionsLoadedHookInputtype -
InvalidatableEventNametype What `$.ui.invalidate` takes: a render event, or one of the six events -
IsDiscriminanttype Whether tag key `K` selects members of `I`: it does when each member gives -
IsLiteralValuedtype Whether `V` is made of literals only: `"a" | "b"` is, `string` is not. -
IsSingleLiteraltype Whether `V` is exactly one string, number or boolean literal. -
IsUniontype Whether `T` is a union of two or more members. -
JsonValuetype Plain data: what JSON holds, and what crosses between a plugin's hooks -
KeptEventtype What `next` takes in a matched hook: the variants of `e` the matcher can -
KeptMemberstype The members of the argument union `E` matcher `P` can match, as declared; -
KnownKeystype The declared keys of `T`, the string and number index signatures left out. -
LateOverloadtype The events whose overload must come after the rest, lest it shadow them. -
LinkPropstype The props of `Link`, a hyperlink every surface draws: an OSC 8 span on the -
Literaltype What a matcher value selects by: itself, or `unknown` for a RegExp, which -
MarkdownLeafPropstype What a `Markdown` carries across the boundary: its address, text, dimness -
MarkdownPropstype The props of `Markdown`, a block of markdown every surface draws as it -
MatchedEventtype The argument a matched hook receives: `e` narrowed by `M` (Narrowed), per -
MatchedHooktype The hook `on(pattern, matcher, hook)` takes: `($, e, next)` with `e` -
MatchedNamestype The events a matched registration on `P` covers: the event named, or for a -
MatchedResulttype What a matched hook returns: the event's result, narrowed by `M` where the -
MatchedStreamHooktype The hook `on(event, matcher, hook)` takes on a streaming event: the -
MatchedStreamNarrowingstype What a matched streaming hook's `next.is(pattern, e)` narrows `e` to: -
MatchedStreamNexttype A matched streaming hook's `next`: the variants the matcher keeps, the -
Matchertype What `on(event, matcher, hook)` takes for an argument of type `I`: the -
MatcherDatatype Any matcher at all, for a field typed `unknown` (a tool's input, a -
MatcherKeystype The declared keys of every variant of `I` (index signatures aside). -
MatcherOnetype What matches one value of type `V`, by the runtime's kinds: -
MatcherValuetype What a matcher gives a key whose value is `V` on this variant and `Across` -
MatcherValueOftype The type of key `K` across the variants of `I` that declare it. -
McpContentBlocktype One block of an MCP result: `type` and the fields that kind of block carries. -
McpServerProvenancetype The MCP server serving this tool, for `mcp__*` tools: `name` is the server's config key (for `source: "sdk"`, exactly the name the SDK host registered in `sdkMcpServers` / `mcp_set_servers`; for any other source, the key as authored in that configuration - untrusted text, the same value `mcp_status` and system/init report, to be escaped before display), `source` is where its definition came from - `sdk` (an in-process server the SDK host runs; only the host can register one, so a configured server of the same name never reads `sdk`), `plugin` (a server a plugin ships or registers at runtime), or a config scope (`user`, `project`, `local`, `dynamic` for --mcp-config / `mcp_set_servers` process servers, `managed`, `enterprise`, `claudeai`, `agent`). Key trust on `source`, not on the name or the tool-name prefix. Absent for non-MCP tools. -
McpToolCallInputtype The MCP branch of a `tool.call` hook's `e` (and of `$.tool.call`'s input): -
McpToolCallInputFallbacktype The `e` a `tool.call` (or `classic.PreToolUse`) hook receives for an MCP -
McpToolInputsinterface The inputs of the MCP tools this project knows, keyed by full tool name, -
McpToolNametype The name of an MCP tool as the engine spells it: `mcp__<server>__<tool>`. -
McpToolResulttype An MCP tools/call result as the SDK returns it, plain data. -
MessageDisplayHookInputtype Hook input for the MessageDisplay event. Fired with each batch of newly completed lines while an assistant message streams. Display-only: the stored message and what the model sees are untouched. -
ModelCompleteRequesttype What `$.model.complete` takes. -
ModelForkRequesttype What `$.model.fork` takes. -
ModelForkResulttype What `$.model.fork` resolves to when the fork answered: the reply's text -
ModelForkUsagetype What one fork cost, as the API counted it: the four token counts of the -
Namespacetype The prefixes a glob may name: one or more whole leading segments of an -
NarrowDepthtype How many object or array levels a matcher narrows `e` through, counted as -
Narrowedtype `e` in a matched hook: the members of the argument union `E` matcher `P` -
NarrowedByAnytype A value of declared type `V` under a one-of, folded over the tuple into -
NarrowedByOnetype A value of declared type `V` under one matcher node `Q` that is not a -
NarrowedMembertype One object member `E` under object pattern `P`, `D` levels down: `never` -
NarrowedValuetype A value of declared type `V` where the matcher gives `Q`, `D` levels -
Negationtype `!` before a name or a glob: every event except the ones it selects. `!*` -
Nexttype The rest of the chain, as one hook receives it: made once per dispatch per -
NextBudgettype The budget the code reading `next.budget` runs under: the whole allowance -
NextResulttype What `next(e)` resolves to for event `N`: the event's result, except at -
NextResultFortype What `next(e)` resolves to once `e.tool` is the literal `T`: on `tool.call` -
NoArgstype The argument of a call on `$` that takes nothing (`$.session.cwd()`): an -
NoArgsEventtype The events whose argument is exactly NoArgs (`session.cwd`, a declared -
NoEngineInterfacetype What an `engine.create` hook receives as `$`: nothing. Every property -
NonEmptytype Array type `V`, of element `Item`, once some element of it is known to -
NotificationHookInputtype -
NounEventtype The declared plugin nouns' methods as event rows (NounEventRow), one per -
NounEventNametype The name of a declared plugin noun's event (`voice.speak`). -
NounEventOftype The events of the plugin nouns declared on EngineInterface, by name: the -
NounEventResulttype The result of a declared plugin noun's event as its hooks see it: -
NounEventRowtype One method of a declared plugin noun as an event row: its event's name, -
NounValueOftype What each declared plugin noun's method answers (the `value` of its -
Ontype Registers `hook` on the events `pattern` selects: one by name, every one -
OnScreentype The part of a transcript message the surface that drew it has on screen: -
OpenMatchertype The keys a variant with a string index signature (an MCP tool's input) -
OpEventNametype The name of a call on `$` the host serves, as an event. -
OpEventOftype The calls on `$` the host serves, as events: `e` is the call's argument as -
OpEventResulttype The result of a call on `$` as its event's hooks see it: `{ value }` (the -
OpValueOftype What each call on `$` answers (the `value` of its event's result), by event -
OrderedOverloadstype One call signature per event in `Names`, intersected, the ambiguous ones -
Origintype Who raised a dispatch, as `next.origin` holds it: the calling plugin's -
Overloadstype One call signature per event in `Names`, intersected into an overload set. -
PaneCloseArgstype The argument of `$.ui.close`: the pane to close (`{ id }`). `origin` is -
PaneCloseInputtype The input of `ui.close`: the pane closing and why (PaneCloseOrigin). -
PaneCloseOrigintype Why a pane closes, as the engine stamped it at `ui.close`. -
PaneOpenArgstype The argument of `$.ui.open`: which pane, its title, whether it asks the -
Patterntype What `on(pattern, hook)` and `next.is(pattern, e)` take: an event's name, -
PatternOvertype The patterns `next.is` takes in a hook covering the events `N`: their -
PermissionBehaviortype -
PermissionDeniedHookInputtype -
PermissionModetype Permission mode for controlling how tool executions are handled. 'default' - Standard behavior, prompts for dangerous operations. 'acceptEdits' - Auto-accept file edit operations. 'bypassPermissions' - Bypass all permission checks (requires allowDangerouslySkipPermissions). 'plan' - Planning mode, no actual tool execution. 'dontAsk' - Don't prompt for permissions, deny if not pre-approved. 'auto' - Use a model classifier to approve/deny permission prompts. -
PermissionRequestDecisiontype A `classic.PermissionRequest` answer's `decision`, as the classic hook's -
PermissionRequestHookInputtype -
PermissionRuleValuetype -
PermissionUpdatetype -
PermissionUpdateDestinationtype -
PermissionUpdatestype The permission rules a PermissionRequest allow may add: the shape of the -
PlayOptionstype How `$.audio.play` plays a clip: looped until `signal` aborts, or once. -
PluginNountype The nouns a plugin declared on `$` by merging into EngineInterface; never -
PluginOptionstype A plugin's options as `register(on, options)` receives them: the values of -
PluginRegisterInputtype The input of `plugin.register`: one hooks module the engine is about to -
PluginRegisterResulttype What a `plugin.register` hook returns and what `next(e)` resolves to: -
PluginRegisterUsestype What a hooks module uses, as the host scanned its source before loading it: -
PluginStamptype Whose element: the plugin whose hook drew it, stamped by the runtime as the -
PostCompactHookInputtype -
PostModelSwitchHookInputtype -
PostToolBatchHookInputtype Hook input for the PostToolBatch event. Fired once after every tool call in a batch has resolved, before the next model request. PostToolUse fires per-tool and may run concurrently for parallel tool calls; PostToolBatch fires exactly once with the full batch. -
PostToolBatchToolCalltype -
PostToolUseFailureHookInputtype -
PostToolUseHookInputtype -
PreCompactHookInputtype -
PreModelSwitchHookInputtype -
PressedLinktype The link a press landed on: one a `Markdown` drew, pressed where the -
PreToolUseDecisiontype The decision of a `classic.PreToolUse` result: `allow`, `ask`, `deny`, or -
PreToolUseHookInputtype -
PreToolUseResulttype What a `classic.PreToolUse` hook returns: one of `allow`, `ask`, `deny`, -
ProcessRunInittype Options of `$.process.run`. -
ProcessRunResulttype What `$.process.run` resolves with once the child has exited. -
PromptAttachmentInputtype The input of `prompt.attachment`: one message the engine injects into the -
PromptAttachmentOrigintype Who authored the text an injected attachment carries, as the engine knows -
PromptAttachmentResulttype What a `prompt.attachment` hook returns: the text the model reads for that -
PromptBoxtype The person's prompt box as it stands: the draft and where the cursor is in -
PromptContextBlocktype One block of the context the first user message carries: a name the -
PromptContextBlockstype The context blocks of a conversation's first user message, in the order -
PromptContextInputtype The input of `prompt.context`: the context blocks the engine prepends to a -
PromptContextResulttype What a `prompt.context` hook returns: the blocks the conversation -
PromptEditInputtype The input of `prompt.edit` (prompt-edit/): one edit the person makes in the -
PromptEditOrigintype Who edits the prompt box at `prompt.edit`, as the engine stamps it where -
PromptEditResulttype What a `prompt.edit` hook returns and what `next(e)` resolves to: the box -
PromptFillArgstype `prompt.fill`'s input as a plugin's `$.prompt.fill(args)` takes it: no -
PromptFilledtype What `$.prompt.fill` resolves to: whether the box took the text, and the -
PromptFillInputtype The input of `prompt.fill` (prompt-fill/): a text about to be put in the -
PromptFillModetype Where a `prompt.fill` puts its text: over the whole draft, after it, or -
PromptFillOrigintype Who writes the prompt box at `prompt.fill`, as the engine stamps it where -
PromptFillResulttype What a `prompt.fill` hook returns and what `next(e)` resolves to: whether -
PromptOrigintype Where a `prompt.submit` submission came from, as the engine knows it at -
PromptSectionInputtype The input of `prompt.section`: one named section of the system prompt, at -
PromptSectionResulttype What a `prompt.section` hook returns: the text the prompt carries for that -
PromptSubmitArgstype `prompt.submit`'s input as a plugin's call takes it: `origin`, `turnId` -
PromptSubmitAttachmenttype A pasted or attached non-text item of a submitted prompt; its kind, never -
PromptSubmitInputtype The input of `prompt.submit`: the prompt as typed, after the input became -
PromptSubmitResulttype What a `prompt.submit` hook returns and what `next(e)` resolves to: the -
PromptSuggestArgstype `prompt.suggest`'s input as a plugin's `$.prompt.suggest(args)` takes it: -
PromptSuggestInputtype The input of `prompt.suggest` (prompt-suggest/): a text about to be shown -
PromptSuggestOrigintype Who proposes the text at `prompt.suggest`, as the engine stamps it where -
PromptSuggestResulttype What a `prompt.suggest` hook returns and what `next(e)` resolves to: -
RasterBlitArgstype A `$.ui.blit` argument repainting one of the caller's mounted Rasters. -
RasterPropstype The props of `Raster`, the terminal surface's cell-grid leaf: a fixed box -
Registertype The hooks module's entry: `export function register(on, options)`. `on` -
Registrationtype What `on(...)` returns for a hook of type `F`: the registration, which -
RenderChildrentype What an element takes as `children`, as JSX passes them: a node, a number -
RenderComponenttype Everything `ui.render` can draw: one name per component that has a render -
RenderElementtype What a render hook returns, and what `next(e)` resolves to: a plain-data -
RenderEventNametype The render event: `ui.render`, one event for every component that has a -
RenderInputtype The input of `ui.render`: a union discriminated by `component`, one member -
RenderInputOftype One `ui.render` input, for a component narrowed to one surface. -
RenderNodetype A node of a render tree: an element, or a string (text). -
RenderPropsOftype The plain-data props of each renderable component, as `ui.render` sees -
RenderResultOftype What a `ui.render` hook returns and what `next(e)` resolves to: a -
RenderSurfacetype Where a render event's component is drawn: `terminal` is Ink, which draws -
RenderViewporttype The size of what a surface draws into, in character cells of the -
ResolveInputtype The input of `ui.resolve`: which surface's elements, for which component; -
ResolveInputOftype One `ui.resolve` input, for a component on one surface. -
ResultOftype What each event's hook returns, and what its `next(e)` resolves to, by event -
SDKAssistantMessageErrortype -
Selecttype The members of `T` assignable to `S`; all of `T` when none is. -
Selectedtype The events a pattern selects, as a union of names: the one named, every -
Selectiontype The literal each tag key of `I` is held to by matcher `M`: one-of arrays -
SelectOptiontype One option of a `Select`: the value `onSelect` and `ui.select` carry, and -
SelectPropstype The props of `Select`, every surface's one-of-several picker: an address, -
SessionAttachInputtype The input of `session.attach`: a surface joined the session's roster of -
SessionAttachResulttype What a `session.attach` hook returns and what `next(e)` resolves to: -
SessionAuthorizationtype What `$.session.authorize()` answers: an opaque handle for the session's -
SessionCompactArgstype `session.compact`'s input as a plugin's `$.session.compact(args)` takes -
SessionCompactedtype A compaction that stands: the conversation as it reads afterwards, and -
SessionCompactInputtype The input of `session.compact`: one compaction of the conversation, about -
SessionCompactResulttype What a `session.compact` hook returns and what `next(e)` resolves to: the -
SessionCompactSkippedtype A compaction vetoed: on `precompute` nothing is computed or kept; on any -
SessionCompactTriggertype Who compacts: the person's `/compact` (`manual`), the engine at its -
SessionContextBreakdowntype The context window broken down as /context breaks it down: the rows, the -
SessionContextUsagetype The live context window as the status line reads it, and by category as -
SessionCosttype What the session has cost, as `/cost` and the status line total it. -
SessionCronSummarytype -
SessionDetachInputtype The input of `session.detach`: a client left the session's roster. Every -
SessionDetachReasontype Why a client left the roster: `detach`, it said so (ui_detach); `end`, the -
SessionDetachResulttype What a `session.detach` hook returns and what `next(e)` resolves to: -
SessionEndHookInputtype -
SessionEndInputtype The input of `session.end`: the session is ending, why, and how to come back -
SessionEndReasontype Why the session ended: the classic SessionEnd hook's own `reason`, word for -
SessionEndResulttype What a `session.end` hook returns and what `next(e)` resolves to: -
SessionMeasureInputtype The input of `session.measure`: what `$.session.usage()` answers at this -
SessionMeasureResulttype What a `session.measure` hook returns and what `next(e)` resolves to: -
SessionMessagetype One message of the transcript as `$.session.messages()` returns it. -
SessionRateLimittype One rate-limit window as the rate-limit notices read it. -
SessionReceiveEventtype An external-event wake the delivery's text parsed as (a GitHub relay -
SessionReceiveInputtype The input of `session.receive`: one inbound delivery (a relay's event, a -
SessionReceiveOrigintype Where an inbound delivery came from, as the bridge classified it from the -
SessionReceiveResulttype What a `session.receive` hook returns and what `next(e)` resolves to: the -
SessionRepotype What `$.session.repo()` answers: the repository's root and its origin remote, -
SessionResumetype How to come back to the session that ended: what `claude --resume` takes. -
SessionStartHookInputtype -
SessionStartInputtype The input of `session.start`: the session the process starts with, read the -
SessionStartResulttype What a `session.start` hook returns and what `next(e)` resolves to: -
SessionUsagetype What `$.session.usage()` answers: the context window's fill, the account's -
SessionUsageArgstype What `$.session.usage(args)` takes: nothing for the status line's figures -
Settingstype What `$.settings.read` answers: an object keyed as a settings.json is -
SettingsReadArgstype What `$.settings.read(args)` takes. -
SettingsSourcetype One source of settings by the name a plugin gives it, lowest precedence -
SetupHookInputtype -
SiteScrolltype Where a site's window sits over the tree a hook drew in it (a pane's body, -
SiteViewtype Which transcript the person has on screen where a site draws: the main -
SkillPromptInputtype The input of `skill.prompt`: one skill's prompt, at the moment the engine -
SkillPromptResulttype What a `skill.prompt` hook returns: the text the model reads for that -
SleepOptionstype Options of `$.clock.sleep`. -
SpeakOptionstype Options of `$.audio.speak`. -
SpeakRequesttype The argument of `$.audio.speak(text, options)` as the event carries it. -
SpeakResulttype What `$.audio.speak` resolves with once the utterance has ended. -
StarNexttype `next` in a `*` hook: the set of events is open at runtime, so `e` is -
StopFailureHookInputtype -
StopHookInputtype -
StreamHooktype The hook a streaming event takes: `async function* ($, e, next) {}`, -
StreamHookBodytype What a hook on a streaming event evaluates to: the async generator an -
StreamingEventNametype The events that stream: their hooks are async generators, `next(e)` is -
StreamNexttype The rest of the chain as a hook on a streaming event receives it: Next, -
StyledElementtype The shape a `Box` and a `Text` share in a render tree: allowlisted props, -
SubagentStartHookInputtype -
SubagentStopHookInputtype -
SvgPropstype The props of `Svg`, the remote surfaces' vector leaf: the markup is the -
TagKeystype The keys of `I` a matcher may select variants by: literal-valued in every -
TargetTiertype A tier `next.to(e, tier)` may name: one a floor can reach past a tier of -
TaskCompletedHookInputtype -
TaskCreatedHookInputtype -
TeammateIdleHookInputtype -
TextHoverPropstype The `Text` props a `hover` may override (its colors and styles, not its -
TextPropstype The props of `Text`: the color and style props of Ink's Text a tree may -
Tiertype One of the chain's five tiers (TIERS), outermost first; on every -
TIERSconst The chain's five tiers, outermost first: earlier is outer is more -
Timertype A pending timer from `$.clock.after` / `$.clock.every`. -
TimerCalltype A timer on `$.clock` (`after`, `every`): `fn` runs after `ms` milliseconds, -
ToastOptionstype Options of `$.ui.toast`. -
ToolCallArgstype `tool.call`'s input as the call takes it: `tool_use_id` and `agentId` may -
ToolCallEnvelopetype The envelope the two tool events share: the tool, the id of this call, and -
ToolCallInputtype The input of `tool.call`: the tool, the id of this call, the tool's -
ToolCallOverloadstype `$.tool.call(input)`: resolves with `result` typed for the tool `input` -
ToolCallReservedtype The keys `tool.call`'s input carries beside the tool's own arguments, none -
ToolCallResulttype What a `tool.call` hook returns and what `next(e)` and `$.tool.call(input)` -
ToolCheckArgstype `tool.check`'s input as `$.tool.check` takes it: the tool and its -
ToolCheckDecisiontype The verdict of `tool.check`: run the tool, put it to the mode's decider -
ToolCheckInputtype The input of `tool.check`: the tool, its arguments, and the call's id when -
ToolCheckResulttype What a `tool.check` hook returns and what `next(e)` resolves to: the -
ToolDeferraltype Where a `tool.describe` answer places the tool: `true` behind ToolSearch -
ToolDescribeInputtype The input of `tool.describe`: one tool's description, at the moment the -
ToolDescribeResulttype What a `tool.describe` hook returns: the description the model sees for that -
ToolEnvelopetype `{ tool, tool_use_id, ...args }` as one flat object type, generic over -
ToolGroupCalltype One tool call of a ToolGroup, as `ui.render` sees it under `calls`. -
ToolInfotype One tool as `$.tool.list()` returns it. -
ToolInputOftype `{ tool, tool_use_id, ...args }` as one flat object type. -
ToolNamedtype An input that names its tool as the literal `T`: what `next` and -
ToolResultOftype The structured result of the tool named `Name`: its BuiltinToolResults -
ToolResultSummarytype One tool_result block of a user message. -
ToolSpectype What `$.tool.register` takes. -
ToolUseSummarytype One tool_use block of an assistant message, with its outcome once the -
TraceEntrytype One settled run of a link beneath the caller, as `next.trace` lists it: -
TraceOutcometype What the chain decided for one link, as `next.trace` names it. -
TurnCompleteFieldstype What every `turn.complete` carries whatever its reason: the answer, the -
TurnCompleteInputtype The input of `turn.complete`: the assistant's final message of a turn, at -
TurnCompleteReasontype Why a turn ended: the model answered, the user interrupted it, the model -
TurnCompleteRefusedtype The end of a turn the model refused with no fallback model to retry on: -
TurnCompleteResulttype What a `turn.complete` hook returns and what `next(e)` resolves to: -
TurnCompleteUnrefusedtype The end of a turn that was not a refusal: answered, interrupted, or dead -
TurnRefusaltype What the API said about a refusal that ended a turn: the classifier's -
TurnStartInputtype The input of `turn.start`: the prompt a model turn begins with, after -
TurnStartResulttype What a `turn.start` hook returns and what `next(e)` resolves to: -
TurnStepChunktype One piece of a `turn.step` response as it streams through the chain: -
TurnStepEngineChunktype An item of the engine's stream the other chunk kinds do not model (the -
TurnStepInputtype The input of `turn.step`: one model request inside a turn, at the moment -
TurnStepInputChunktype A piece of a tool call's arguments as they arrive: JSON text, partial, -
TurnStepResulttype What a `turn.step` hook returns and what `next(e)` resolves to: the -
TurnStepStopChunktype The response is whole: why the model stopped and what the request cost, -
TurnStepTextChunktype A piece of the response's visible text as it arrives, in block `index`. -
TurnStepThinkingChunktype A piece of the model's thinking as it arrives, in block `index`: what -
TurnStepToolChunktype The model begins a tool call in block `index`: the tool's name and the -
TurnStepToolUsetype One tool call the model asked for in a step: the tool's name and its -
TurnStopReasontype Why the model stopped, as a `turn.step` result and its stop chunk carry -
TurnUsagetype What a model turn, or one response inside it, cost as the API reported it: -
UiBlitArgstype What a plugin's `$.ui.blit(args)` takes: a Raster's next `cells` -
UiBlitResulttype What `$.ui.blit` resolves to and what a `ui.blit` hook's `{ value }` -
UiFocusArgstype What a plugin's `$.ui.focus(args)` takes: one of its own elements, by the -
UiFocusComponenttype The render components whose site keeps a focus ring: a pane's body and -
UiFocusInputtype The input of `ui.focus`: a site's focus ring about to move onto one of the -
UiFocusOrigintype Who moves the ring at `ui.focus`, as the engine stamps it where the move -
UiFocusResulttype What a `ui.focus` hook returns, what `next(e)` resolves to, and what -
UiInputArgumenttype The argument of `ui.input`: a change of, or a submit from, an `Input` a -
UiInputResulttype What a `ui.input` hook returns and what `next(e)` resolves to. -
UiLogOptionstype Options of `$.ui.log`. -
UiLogSinktype Where a `$.ui.log` line goes: `transcript`, a dim row of its own (and the -
UiMessageArgumenttype The argument of `ui.message`: what a `Client` instance's surface module -
UiMessageResulttype What a `ui.message` hook returns and what `next(e)` resolves to. -
UiPanetype One of this plugin's open panes as `$.ui.panes()` lists it: the pane's -
UiPressArgumenttype The argument of `ui.press`: a press on a `Button` a render hook drew, or -
UiPressResulttype What a `ui.press` hook returns and what `next(e)` resolves to. -
UiScrollArgstype What a plugin's `$.ui.scroll(args)` takes: what to bring into view, in -
UiScrollBlocktype Where in its scrollable a revealed row lands, as the DOM's -
UiScrollComponenttype The render components whose site the engine scrolls: a pane's body and -
UiScrollInputtype The input of `ui.scroll`: a site's window asked to move over the tree a -
UiScrollOrigintype Who moves the window at `ui.scroll`, as the engine stamps it where the -
UiScrollPointertype The cell the pointer was over when the person's wheel raised `ui.scroll`, -
UiScrollResulttype What a `ui.scroll` hook returns, what `next(e)` resolves to, and what -
UiScrollTargettype What `$.ui.scroll` brings into view: never a row number, always a thing -
UiSelectArgumenttype The argument of `ui.select`: a pick from a `Select` a render hook drew. -
UiSelectResulttype What a `ui.select` hook returns and what `next(e)` resolves to. -
UnionToIntersectiontype The intersection of a union's members (`A | B` to `A & B`), by inferring -
UsageUnittype One unit of what `$.session.usage()` answers, by its key there: the -
UserMessageFromtype Who sent the message a `UserMessage` row carries, when someone other than -
UserMessageTasktype The background task a `UserMessage` notification row reports on: a -
UserPromptExpansionHookInputtype -
UserPromptSubmitHookInputtype -
ValueOrDenytype The result of a call on `$` as the hooks on its event see it: `{ value }`, -
WorktreeCreateHookInputtype -
WorktreeRemoveHookInputtype -
hconst The JSX factory (classic runtime, `@jsx h`; the engine prepends the -
Fragmentconst `<>...</>`: a column Box around the children. -
JSXnamespace JSX over the element table: every tag is a constructor from -
AbortSignalinterface -
AbortControllerinterface -
TextEncoderinterface -
TextDecoderinterface -
URLSearchParamsinterface -
URLinterface -
atobfunction -
structuredClonefunction -
AsymmetricMatchertype A value that matches by a rule inside `toEqual` and its kin -
AsyncMatcherstype The same checks on what a promise received settles with, each resolving -
ClientScopetype Which `Client` of a mounted drawing an act or a read means, by the `key` -
Constructortype A class, as `toThrow`, `toBeInstanceOf` and `expect.any` take it. -
describeconst A group of tests: its name leads the title of each test declared inside, -
ElementOfActtype The element each surface-dependent act of a mounted drawing reaches: a -
ElementQuerytype What a mounted drawing's `find` and `findAll` match an element on, every -
Enginetype What a test holds as `$`, the engine's own: every call on it is made as -
EngineCalltype One call on the engine's `$`: the event's input whole, as an engine call -
EngineMounttype A surface drawing a component instance through the plugins, then driven -
EngineNountype One noun of the engine's `$`: each of its events as the engine calls it, -
EngineNounEventtype The events of one noun a test's `$` carries: every one but `ui.resolve`, -
EnginePresstype A surface pressing a Button a test rendered, or a Markdown's link: the -
Expecttype The checks on a value (`expect(received)`), and with them the matchers -
expectconst Checks a value: `expect(received).toEqual(expected)` throws an -
Expectationtype What `expect(received)` answers: the checks, their negation, and the -
Expectingtype `expect(received, message?)`: the checks on a value, a message of the -
FoundElementtype One element of a mounted drawing as `find` returns it: the description -
Matcherstype The checks `expect(received)` offers; each throws an AssertionError when -
Matchingtype The matchers that stand inside an expected value, each matching received -
Mocktype The world beneath the plugins, mocked noun by noun: each member registers -
mockconst The world beneath the plugins, mocked noun by noun: `mock.clock`, -
MockClocktype The clock `mock.clock` hands back: the time its hooks answer, and the only -
MockClockOptionstype Where a mocked clock starts: `now`, in milliseconds (0 when not given). -
Mountedtype A drawing of component `C` the test mounted on surface `P`: reads over its -
MountedMemberstype Every member a mounted drawing of component `C` can have; `Mounted<P, C>` -
MountInputTargettype What a mounted drawing's `input` takes: the Input's key, the text, which -
MountKeyEventtype What a mounted drawing's `key` takes: the key as a `Client`'s `onKey` -
MountPointerEventtype What a mounted drawing's `pointer` takes: the event as a `Client`'s -
MountPressTargettype What a mounted drawing's `press` takes: the Button's key, another -
MountResizeTargettype What a mounted drawing's `resize` takes: a `Client` region's size in -
MountSelectTargettype What a mounted drawing's `select` takes: the Select's key, the picked -
MountTargettype What `$.ui.mount` takes: whose elements the test will act on, the surface -
Negatabletype A set of checks and, under `not`, the same set passing where they fail. -
Plugintype Written inline in a test and loaded as a plugin folder is: its name, the -
PluginTiertype A tier a plugin loads in: every tier but the engine's own. -
PressTargettype What `$.ui.press` takes: the plugin whose `ui.render` hook drew the element, -
testconst One test: it passes when its body returns or resolves, and fails when it -
TestBodytype A test: the engine's `$`, and `on`, a plugin's registrar, whose hooks sit -
TestOptionstype What `test` takes beside its name: the inline plugins it loads beside the -
TestResttype What follows a test's name: its body, or its options then its body. -
ThrowExpectationtype What `toThrow` compares the thrown error with: a substring or pattern of -
tierconst Says which tier the plugin under test loads in, once, at the top of the -
WithMessagetype An error-like value `toThrow` compares by its whole message. - No symbol matches that. The filter reads the name, the kind and the first line of the description, so a shorter fragment finds more.
The three pages
- 01 The engine · 69 verbs Every noun and verb on $, with its signature, its parameters and the example the declarations carry.
- 02 Events · 71 events Every event a hook can be registered for, with the payload it arrives with and the result it may return.
- 03 Types · 505 declarations Every declaration in the file, verbatim, with the doc comment above it.
What the file says about itself
Claude Code writes the declarations with an introduction at the top, and this is it, reproduced as it ships. It is the only guidance shipped with the surface.
EARLY ACCESS: this surface may change between releases without notice. Written by `/plugin-types`; regenerate with that command after an update rather than editing. The first line names the Claude Code version that wrote it. TypeScript 5.4 or newer reads it. `claude plugin validate <dir>` is the other half: it reads a plugin's manifest and its hooks module's source the way the engine will and reports what the module hooks and calls and everything the engine would refuse, before any session loads it.
What is here: the module a hooks module may import types from,
import type { Register, On, EngineInterface } from 'claude-code'
(at run time the import is empty), and the globals a hooks module has: `h` and `Fragment` (what JSX compiles against), the JSX namespace, and the environment's web APIs (URL, TextEncoder, AbortController, crypto.subtle, ...). A hooks module runs in an environment of its own: no DOM, no Node. The module, and every file it imports from the plugin, is named .ts, .tsx, .jsx, .js, .mjs, .cjs, .mts or .cts (a file named otherwise is not loaded) and is an ES module whatever its suffix: there is no `require`. The elements a render hook draws with (`Box`, `Text`, `Button`, ...) are not globals: they come from the surface's table,
const { Box, Text } = $.ui.resolve(e)
Also here: 'claude-code/testing', the kit a plugin's *.test.ts and *.test.tsx files import under `claude plugin test <dir>`, which runs each in an environment like the one a plugin's hooks run in (no fs, network or process), the plugin loaded from the folder by the engine's own host: `test(name, async ($, on) => { ... })`, where `$` is the engine's own and the hooks `on` registers sit beneath every plugin; with describe, expect, tier, and `mock`, whose clock, store and env answer those nouns beneath the plugins from memory. `$.ui.mount` draws a component through the plugin on the surface the test names (terminal, desktop, vscode or mobile: never assumed) and hands back the drawing to read and act on by key: find an element, press a Button, type into an Input, drive a `Client`'s module (keys, pointer, posts, its frame clock), each act typed by that surface's element table, so one test body run over several surfaces covers the mod's hooks and description on each. It exercises the mod (its hooks, the tree they return under each surface's rules, its `Client` modules), never a surface's paint (Ink's, the desktop page's):
test('notes add up on every surface that takes input', async $ => {
for (const surface of ['terminal', 'desktop'] as const) {
const ui = await $.ui.mount({ plugin: 'notes', surface, ...BAND })
await ui.input({ key: 'new', text: 'milk' })
expect((await ui.find({ key: 'count' }))?.text).toBe('1 note')
await ui.key({ key: 'down', in: 'list' })
await ui.unmount()
}
for (const surface of ['terminal', 'desktop', 'vscode', 'mobile'] as const) {
const ui = await $.ui.mount({ plugin: 'notes', surface, ...HINT })
expect(await ui.find({ type: 'Text', text: /notes/ })).toBeDefined()
await ui.press({ key: 'dismiss' })
}
})
Typing a plugin against it:
export const register: Register = (on, options) => { ... }
or, in a .js module,
/** @type {import('claude-code').Register} */
export const register = (on, options) => { ... }
A tsconfig.json (or jsconfig.json) that fits a hooks module:
{
"compilerOptions": {
"target": "es2023", "lib": ["es2023"], "types": [],
"module": "esnext", "moduleResolution": "bundler",
"strict": true, "noUncheckedIndexedAccess": true,
"noEmit": true, "skipLibCheck": true,
"jsx": "react", "jsxFactory": "h", "jsxFragmentFactory": "Fragment"
},
"include": [".claude/types", "hooks", "tests"]
}
".claude/types" is where /plugin-types writes this file and, beside it, claude-code-mcp.d.ts and claude-code-plugins.d.ts, the index of the enabled plugins' type contracts, each copied to claude-code-plugins/ <plugin>.d.ts: what a plugin adds to `$` in engine.create, so a plugin you depend on is typed with nothing copied (the include above takes the whole folder). "hooks" is the plugin's hooks/ folder and "tests" its test files. `lib` names no DOM: the environment has none, and its `Text` would shadow the element.
A plugin that adds a noun to `$` ships its own contract: a .d.ts its plugin.json names as "types", exporting the noun's types at its top level and declaring the noun on the engine's interface,
export type Topo = { ... }
declare module 'claude-code' {
interface EngineInterface { topo: Topo }
}
with no import or reference, its exported names led by the noun's PascalCase name; the plugin's own hooks module imports them from it.
Where this comes from
Claude Code carries its own type declarations for the hooks runtime, and /plugin-types writes them into a project. They are not in the npm package as a file and not in the JavaScript bundle either: the command decompresses an asset embedded in the binary. So documenting the surface used to mean installing a build and running a slash command by hand, which is why nobody did it twice.
The release pipeline reads that asset straight out of the binary it already downloads, parses it, and writes a JSON document beside the rest of the release data. This section renders that document. Which means it is never a release behind, and nobody has to remember anything.
The prose about how to use any of this, what the calls cost, and which ones do not behave the way their shape suggests is the Mods Guide. This section is the inventory.
Mined from build 2.1.278 on 19 Sep 2026 . The declarations are Claude Code's own writing about itself, reproduced here; everything around them is this site's.