What changed, release by release.
Every release's mods API against the one before it: which nouns, verbs, events and types it added, which it removed, and which changed shape, with the lines that moved. A removal is marked breaking; a change that took something out may break a mod; one that only added to a shape is marked extended.
v2.1.330
+35 added · 0 removed · 3 changed · 9 docs only since 2.1.329The engine
-
Version control, whichever system keeps the folder. Each call rejects in a session with no disk.
-
Returns the working copy a folder is in, the event
vcs.detect; null when it is in none. -
Returns what changed in a working copy, the event
vcs.diff;unknownwhere no hook can say. -
Asks the hooks to isolate a folder: the event
vcs.isolate. Nothing moves into the copy. -
Lists the working copies of the repository holding
path: the eventvcs.list. The engine answers Git's worktrees for the repository the session is in, once the person trusted it, and none for any other. -
Asks the hooks to take a working copy away: the event
vcs.release. -
Asks what a working copy holds: the event
vcs.status. The engine answers for the trusted workspace's Git repository, its worktrees and this mod's own copies; for any other folder,{ unknown }.
Events
-
Fires when the engine asks which version control system a folder uses;
next(e)resolves to the working copy (VcsWorkingCopy) or null. -
The working copy the folder is in, or null.
-
Fires when a mod asks what changed in a working copy, as
/diffdoes wherevcs.detectnames a system other than Git; match it onvcs. -
{ base, files }, or{ unknown }with the reason, null from core. -
Fires when a working copy is needed, before anything is made: for a subagent run with
isolation: "worktree"(the Agent tool, a workflow'sagent()), or for a session: by EnterWorktree, the--worktreeflag, a Remote Control spawn in a worktree, or an app that is about to open one. A review reference (--worktree "#123", a URL) stays Git's, as does a sub-folder picked over Remote Control: no hook hears it. Novcs.*hook hears anamewith a part that starts with a dash. -
{ path, vcs, branch?, revision? }, or{ deny }. -
Fires when the working copies of the repository holding
pathare asked for: EnterWorktree is to enter one by its path, a mod calls$.vcs.list, or a session recorded in a mod's copy is resumed after a restart. -
A list of
{ path, vcs, branch? }, possibly empty. -
Fires when the engine would take a working copy away: it read clean with nothing unpublished, or what it holds is to be discarded (
isDiscard). Raised at the end of a subagent or a Remote Control session, by ExitWorktree and by the exit dialog. The session may still stand in its copy then: give a process anothercwd. -
{ isReleased: true, note? }, or{ kept }. -
Fires when the engine asks what changed in a working copy and what removing it would lose: the subagent or the Remote Control session that worked there ended, ExitWorktree is to remove the session's, or the session is exiting inside it.
-
{ changes, unpublished, revision? }, or{ unknown }.
Types
-
The props of
Button, every surface's pressable: an address, a label or children, the closure a press runs, and the styles a hover overrides.role?: 'dismiss'; autoFocus?: true; hover?: TextHoverProps; onPress: (e: UiPressArgument) => void; onPress: ((e: UiPressArgument) => void) | ((e: UiPressArgument) => Promise<unknown>);}; -
The engine's own events as calls on
$, one signature each:$.<noun>.<event>(input)resolves to its result, or to its stream.}; attribution: { text: (input: AttributionTextInput) => Promise<AttributionTextResult>; }; vcs: { detect: (input: VcsDetectInput) => Promise<VcsDetectResult>; diff: (input: VcsDiffInput) => Promise<VcsDiffResult>; isolate: (input: VcsIsolateInput) => Promise<VcsIsolateResult>; list: (input: VcsListInput) => Promise<VcsListResult>; status: (input: VcsStatusInput) => Promise<VcsStatusResult>; release: (input: VcsReleaseInput) => Promise<VcsReleaseResult>; }; agent: { offer: (input: AgentOfferInput) => Promise<AgentOfferResult>; -
The props of
Markdown, a block of markdown every surface draws as it draws an assistant reply's text: its own renderer, links, tables, fences.key?: string; text: string; dimColor?: boolean; onLinkPress?: (link: PressedLink, e: UiPressArgument) => void; onLinkPress?: ((link: PressedLink, e: UiPressArgument) => void) | ((link: PressedLink, e: UiPressArgument) => Promise<unknown>); pressableLinks?: readonly string[];}; -
One uncommitted change in a working copy.
-
The input of
vcs.detect: the folder asked about. -
What a
vcs.detecthook returns: the working copy the folder is in, or null when it is in none. -
One changed file of a
vcs.diffanswer. Its names are data to show, each of at most 4096 characters. -
The input of
vcs.diff; every key is pinned, so no hook passes another down. -
What a
vcs.diffhook returns: the changed files andbase, a label to show for what they were compared with, or why they areunknown. A nullunknownis core's: no hook answered. -
The input of
vcs.isolate: who needs a working copy of its own, and what to make it from. Every field is pinned. -
What a
vcs.isolatehook returns and whatnext(e)resolves to: the copy, or{ deny: reason }, the spawn's or the tool's error. -
The input of
vcs.list: a folder of the repository asked about. -
What a
vcs.listhook returns and whatnext(e)resolves to: the working copies of the repository holdingpath, possibly none. -
One working copy on this machine, as
vcs.listanswers it. -
The input of
vcs.release: the working copy to take away, and why. Every field is pinned. -
What a
vcs.releasehook returns and whatnext(e)resolves to:{ isReleased: true, note? }, or{ kept: reason }, the copy left as it is. -
The input of
vcs.status: the working copy asked about. Every field is pinned. -
What a
vcs.statushook returns and whatnext(e)resolves to: what the copy holds, or{ unknown: reason }, which keeps it. -
One working copy, as
vcs.detectanswers it: which system keeps it, where it lies, and where it stands now.
9 docs only: reworded, same shape
$.session.machineverbReturns the machine the engine runs on: the system, kernel release and hardware as
uname -s,-rand-mprint them, and which of npm, yarn, pnpm, bun, deno and node are on the PATH.$.session.repoverbReturns the repository the session runs in; null when the directory is not inside one.
ClassicResulttypeEverything a classic hook event's answer can carry, named as the classic hook's JSON output names it; each event reads its subset (ClassicResultOf).
HookBudgettypeThe time bounds every hook runs under, in milliseconds: the engine's own constants are typed by these members, and
next.budgetreads the live one.PointertypeA press comes as a new pointer, after the others.
down1 withage0 is its first frame, on the bare backdrop or over the app. A pointer that lifted stays up to a second withgoneabove 0. Check every pointer: an index doesn't keep naming the same one.RenderPropsOftypeThe plain-data props of each renderable component, as
ui.rendersees them undere.props; a hook rewrites them withnext({ ...e, props }).SessionMachinetypeWhat
$.session.machine()answers: the machine the engine runs on, asuname -s,-rand-mprint it (on Windows, what the runtime reports in their place), and which of six developer tools its PATH holds.SessionRepotypeWhat
$.session.repo()answers: the repository's root and its origin remote, when the session is in one. Avcs.detecthook changes those two.ToolCheckInputtypeThe input of
tool.check: the tool, its arguments, the organization's ceiling if it set one, and on a real call its id and the loop'sagentId.
v2.1.329
+29 added · 0 removed · 5 changed · 4 docs only since 2.1.328Events
-
Fires before an agent's report reaches its parent, for each run that ends or is stopped.
next(e)answers auto mode's review and delivers nothing. -
{ text, review, warning? }(the report to deliver) or{ consumed }.
Types
-
The engine's own events as calls on
$, one signature each:$.<noun>.<event>(input)resolves to its result, or to its stream.agent: { offer: (input: AgentOfferInput) => Promise<AgentOfferResult>; spawn: (input: AgentSpawnArgs) => Promise<AgentSpawnResult>; report: (input: AgentReportInput) => Promise<AgentReportResult>; }; session: { start: (input: SessionStartInput) => Promise<SessionStartResult>; -
What a
prompt.fillhook returns and whatnext(e)resolves to: whether the text went into the prompt box.export type PromptFillResult = { isFilled: boolean; refusal?: 'no_composer' | 'dialog'; refusal?: 'no_composer' | 'dialog' | 'unanswered';}; -
What
$.prompt.fillresolves to: whether the box took the text, and the box afterwards (PromptBox) as the caller's own$.prompt.read()reads it.export type PromptFilled = { isFilled: boolean; refusal?: 'no_composer' | 'dialog'; refusal?: 'no_composer' | 'dialog' | 'unanswered'; text: string; cursor: number;}; -
The argument of
$.theme.set: one object of named attributes, so a later attribute is an addition and never a change of the call.backdrop?: ThemeBackdrop; overrideColorScheme?: 'light' | 'dark'; colors?: ThemeColors; sound?: ThemeSound; style?: ThemeStyle;}; -
What
$.ui.copyresolves to and what aui.copyhook's{ value }holds: whether the text reached a clipboard (isCopied), else why not.isCopied: true;} | { isCopied: false; reason: 'no-surface' | 'no-clipboard' | 'refused'; reason: 'no-surface' | 'no-clipboard' | 'unanswered' | 'refused';}; -
The input of
agent.report: one report of an agent, before it reaches the loop that waits for it. -
What an
agent.reporthook returns and whatnext(e)resolves to: the text to deliver with the report's review, or{ consumed: reason }. -
What auto mode's hand-off review made of a report.
-
What plays on behind the session: 1 to 8 layers.
-
How the box around a part looks. Lengths are numbers of points.
-
A short sound: 1 to 8 layers that start together.
-
A background that isn't one flat color.
-
Colors that run across a part's box, as in a still
backdrop. -
A drawing behind a part's words, as in a still
backdrop. -
A font every device has.
codeis the app's own font for code. -
How one hit starts and dies away.
-
What every layer may say about how it sounds.
-
How a message looks. What it says of the words beats
Text. -
Noise without a break.
-
A layer that is one burst of noise.
-
Bursts of noise that fall at random,
scattertimes a second on average: 0.02 to 10. -
Hiss to rumble, brightest first, and
crackle: the ticks of rain on leaves, a fire or gravel. -
A pitch: a note name such as
C5,F#3orBb2, a number of hertz from 20 to 10,000, or 0 for a rest. -
The
soundattribute of$.theme.set: what the desktop app plays, on the person's own device, once they turn the theme's sound on. -
The
styleattribute of$.theme.set: how the desktop app draws the conversation's own rows. -
A color in
style: anyThemeColor, or one of the four message colors thatcolors.inputsmay give for each mode (ThemeColorInputs). Where the mode gives none, abg-name draws assurface-2and atext-name astext-primary. -
Notes held together without a break.
-
A layer that plays its notes and ends, within 4 seconds.
-
Notes that fall at random,
scattertimes a second on average: 0.02 to 10. -
What a note is played on.
-
How a tool call's row looks: its box, and the color and generic font of its words.
-
How a part's words look. Lengths are numbers of points, and a property left out keeps the app's own value.
4 docs only: reworded, same shape
$.theme.setverbSets the session's theme from one object of named top-level attributes, the whole theme: what a set leaves out is gone.
backdropis a scene, drawn behind the conversation by whatui.renderanswers forBackdrop: full window on desktop under its frosted panels, full screen on mobile under one veil (tintandopacity, not yetblur). Or it's a still ground, which a surface draws with no hook: a color, a gradient or a vector.{ image }is refused, so redraw a picture as SVG.colorsis a theme for a surface to paint itself with, where it reads one. With no scene, noui.renderhook is asked to draw.soundis what the desktop app plays once the person turns it on.styleis how the desktop app draws messages and tool calls' rows. Display only:--resumebrings none back and a plugin that unloads takes its own with it, so set it atsession.start.BoxHoverPropstypeThe
Boxprops ahovermay override, none of which moves the Box's siblings, andscope, which names the hover group the Box joins.TextHoverPropstypeThe
Textprops ahovermay override (its colors and styles, not its wrapping) andscope, the hover group it joins; aButton's label too.ThemeColorInputstypeOne mode's colors in
ThemeColors: a six-digit hex color such as#1e1e2eunder the name of each design system token the theme sets. The type checks the leading#alone.
v2.1.328
+10 added · 0 removed · 10 changed · 19 docs only since 2.1.327The engine
-
Returns the machine the engine runs on: the system, kernel release and hardware as
uname -s,-rand-mprint them, and which of npm, yarn, pnpm, bun, deno and node are on the PATH.
Events
-
The argument of
$.session.machine(). -
Fires once per tool before a loop's first request, and again when its model calls the tool;
next(e)resolves to{ isOffered: true }. -
{ isOffered }.
Types
-
The input of
agent.offer: one agent type, at the moment the engine offers it to the model.description: string; source: string; provider: Origin; agentId?: string;}; -
The engine's own events as calls on
$, one signature each:$.<noun>.<event>(input)resolves to its result, or to its stream.judge: (input: ToolJudgeInput) => Promise<ToolJudgeResult>; run: (input: ToolCallInput) => Promise<ToolCallResult>; describe: (input: ToolDescribeInput) => Promise<ToolDescribeResult>; offer: (input: ToolOfferInput) => Promise<ToolOfferResult>; }; command: { run: (input: CommandRunArgs) => Promise<CommandRunResult>; -
nextin a hook on a glob or a negation: an overload per selected event, then one over their union for anenot yet narrowed.readonly signal: AbortSignal; readonly is: <M extends PatternOver<N>>(pattern: M, e: unknown) => e is Frozen<Args<Extract<N, Selected<M>>>>; readonly event: N; readonly origin: Origin; readonly origin: NextOrigin; readonly trace: readonly TraceEntry<N, Args<N>, GlobNextResult<N>>[]; readonly budget: NextBudget;}; -
The rest of the chain, as one hook receives it: made once per dispatch per hook, frozen;
next(e)resolves to the downstream result.readonly signal: AbortSignal; readonly is: <M extends PatternOver<N>>(pattern: M, e: unknown) => e is Frozen<S[Extract<N, Selected<M>>]>; readonly event: N; readonly origin: Origin; readonly origin: NextOrigin; readonly trace: readonly TraceEntry<N, E, O>[]; readonly budget: NextBudget;}; -
What each call on
$answers (thevalueof its event's result), by event name.'session.usage': SessionUsage; 'session.version': SessionVersion; 'session.info': SessionInfo; 'session.machine': SessionMachine; 'turn.abort': void; 'prompt.read': PromptBox; 'prompt.paint': PromptPainted; -
The input of
plugin.register: one plugin the engine is about to load, with a hooks module or without one, read off its manifest and, where it has a module, its scanned source. Every field is pinned butprovides, which only narrows.uses: PluginRegisterUses; provides: PluginProvides; unread: readonly (keyof PluginProvides)[]; hosts: PluginHosts;}; -
What a hooks module uses, as the host scanned its source before loading it: the same lists
claude plugin validateprints and the host's rule reads.reads: readonly StateName[]; writes: readonly StateName[]; }; hosts?: { named: readonly string[]; unread: readonly string[]; };}; -
What
claude plugin validate --jsonprints: a public contract, to which fields are added and in which none is renamed or retyped.manifest: PluginValidateFile | null; contents: PluginValidateFile[]; provides: PluginProvides | null; hosts: PluginHosts | null; advice: readonly PluginValidateAdvice[]; directory: PluginValidateDirectory | null;}; -
nextin a*hook: the set of events is open at runtime, soeisunknownuntilnext.is(pattern, e)narrows it to events it knows.readonly signal: AbortSignal; readonly is: <M extends Pattern>(pattern: M, e: unknown) => e is Frozen<Args<Selected<M>>>; readonly event: EventName; readonly origin: Origin; readonly origin: NextOrigin; readonly trace: readonly TraceEntry<EventName, unknown, unknown>[]; readonly budget: NextBudget;}; -
The input of
tool.check: the tool, its arguments, the organization's ceiling if it set one, and on a real call its id and the loop'sagentId.tool_use_id?: string; agentId?: string; ceiling?: ToolCheckDecision; isCeilingUnread?: true; op?: 'fs.read' | 'fs.list' | 'fs.write' | 'process.run' | 'process.spawn'; approver?: ToolCheckApprover; isReadOnly?: true;}; -
What
next.originholds: who raised the dispatch (Origin), and whose code that is. Set by the host; an event'sprovidercarries neither field. -
Where a host in PluginHosts came from, named as
providesnames the part. More types may be added, so a reader leaves room for one it does not know. -
The network hosts a plugin's files and source name, and the parts that could reach others: drawn from
provides,usesand what its author declares, with nothing dialed or run. -
What
$.session.machine()answers: the machine the engine runs on, asuname -s,-rand-mprint it (on Windows, what the runtime reports in their place), and which of six developer tools its PATH holds. -
The input of
tool.offer: one tool of a loop's pool, at the moment the engine offers it to that loop's model. Every field is pinned. -
What a
tool.offerhook returns: whether the loop's model is offered the tool, in its tool list and at its call.
19 docs only: reworded, same shape
$.agent.spawnverbSpawns a subagent: the event
agent.spawn, the same call the engine makes when the Agent tool starts one; the engine fills the rest.$.command.runverbRuns a slash command as if the person typed
/command args: the eventcommand.run, queued and run once the session is idle.$.http.fetchverbFetches
urlthrough the host (never the plugin's own network) and resolves{ status, ok, headers, text }once the body is read.$.prompt.submitverbSubmits a prompt: the event
prompt.submit, the same call the engine makes for a typed prompt; a turn of its own, once the session is idle.$.session.compactverbCompacts the conversation: the event
session.compactwithtriggerplugin, the same call/compactmakes, between turns.$.tool.callverbCalls a tool: the event
tool.call, the same call the engine makes for the model's tool calls, under atool_use_idof its own.$.ui.askverbAsks the user
questionin the engine's own AskUserQuestion dialog and resolves to the label they chose, or the text typed under "Other".$.wasm.compileverbCompiles a WebAssembly binary and resolves with its
WebAssembly.Module, to instantiate with the standard API or hand to emscripten's or wasm-bindgen's glue.agent.offereventFires when the engine offers an agent type to the model, in the agent listing and again at dispatch;
next(e)resolves to{ isOffered: true }.telemetry.logeventFires when a record is about to be logged to the destination
e.tonames: a built-in's$.telemetry.log, or the engine's own events.tool.checkeventFires when the engine decides whether a tool call may run, after the
tool.calland PreToolUse hooks and before the mode settles an ask.AgentSpectypeWhat
$.agent.registertakes: an agent type this plugin defines, spelled as an agent definition in settings JSON is, plus itsname.CommandRunResulttypeWhat a
command.runhook returns and whatnext(e)and$.command.runresolve to: the command's output text and the notes it leaves the model.HttpInittypeOptions of
$.http.fetch.OrigintypeWho raised a dispatch, as
next.originholds it: the calling plugin's name and the tier it sits in; the engine readsengineincore.-
The facts
prompt.attachmentpins undere.detail, by attachment type: what the engine computed for the row, as it rendered the row's text. TiertypeOne of the chain's five tiers (TIERS), outermost first; on every
next.traceentry, and whatnext.to(e, tier)names.ToolCheckArgstypetool.check's input as$.tool.checktakes it: the tool and its arguments; the call's id,agentId, ceiling,isCeilingUnread, approver andisReadOnlyare the engine's to set.ToolCheckResulttypeWhat a
tool.checkhook returns and whatnext(e)resolves to: the verdict, why, and what stands behind it, never who answers it.
v2.1.327
+0 added · 0 removed · 0 changed · 3 docs only since 2.1.3263 docs only: reworded, same shape
PluginRegisterInputtypeThe input of
plugin.register: one plugin the engine is about to load, with a hooks module or without one, read off its manifest and, where it has a module, its scanned source. Every field is pinned butprovides, which only narrows.TiertypeOne of the chain's five tiers (TIERS), outermost first; on every
next.traceentry, and whatnext.to(e, tier)names.ToolCallReservedtypeThe keys
tool.call's input carries beside the tool's own arguments, none of which the tool sees (the engine strips them before the tool runs).
v2.1.326
+120 added · 3 removed · 30 changed · 64 docs only since 2.1.325The engine
-
Runs a tool as an agent's own call: the event
agent.call, and beneath ittool.callin that agent's loop.$.tool.callis unchanged. -
Returns how many agents may run at once, how deep they may nest and whether they can run in the background (AgentLimits), read at each call.
-
Returns the variables that name the session and this plugin, as its command hook gets them, to pass as a child's
env;runandspawnset none of them. -
Returns the session's transcript file, scratchpad, prompt id, agent type, config root, platform and hosting (SessionInfo), as they stand at the call.
-
WebAssembly, run in the module's own environment, where its hooks run.
-
Compiles a WebAssembly binary and resolves with its
WebAssembly.Module, to instantiate with the standard API or hand to emscripten's or wasm-bindgen's glue.
Events
-
The argument of
$.agent.call(args, { signal }). A hook above may rewrite the tool and its input, and the call is then no longer its caller's own attool.judge;agentIdis pinned. The signal does not cross, it cuts the call. -
The argument of
$.agent.limits(). -
The argument of
$.process.hookEnv(). -
The argument of
$.session.info(). -
Fires when the person presses Stop: Esc or Ctrl+C on a turn, a client's Stop, Ctrl+C at an idle prompt where it stops running scripts.
-
{ isTurnRunning }. -
Fires when auto mode is about to ask its classifier about a call, after every rule, hook and check that only a person may answer.
-
{ decision, reason?, plugin? }. -
Fires when a call has been allowed and is about to run: after
tool.call, PreToolUse,tool.checkand whoever settled an ask; never for a refusal. -
{ result, context? },{ deny }, or core's{ ref, result }, read before any PostToolUse hook has had it. -
Fires when the person clicks or taps the backdrop where no part of the app covers it. Only the hooks of the plugin that set the theme see it.
-
{}: the click was heard. -
The bytes
$.wasm.compile(source)is about to compile, and the file they were read from;pathis identity, pinned.
Types
- removed
ThemeImageinterface breakingA picture from the mod's folder, filling its box unless
sizeandrepeattile it. - removed
ThemeImageGroundinterface breaking - removed
ThemeImageWiretype breakingHow a
Themeanswer names a ground's image: a surface pulls the bytes byid, and lays them out bysizeandrepeatas the mod gave them. The bytes are the mod's own, sowidthandheight, the size in the file's header before any EXIF rotation, are hints: a surface reads the file's header with its own decoder, decodes off the main thread, caps the pixels at 4096 on a side and, if it can't draw the picture, keeps the app's own ground. -
One agent loop of this session as
$.agent.list()returns it: a subagent or a teammate.parentId?: string; spawnedBy?: string; name?: string; kind: 'local_agent' | 'in_process_teammate'; taskStatus: 'pending' | 'running' | 'completed' | 'failed' | 'killed' | 'paused'; label: string; startTime: number; cwd: string; model?: string; effort?: ModelEffort | number; contextWindowSize?: number; tokenCount: number; tokenSamples: number[]; lastRequest?: AgentRequest; usage?: TurnUsage[]; cost?: SessionCost; hasRow: boolean;}; -
agent.spawn's input as the call takes it: what the Agent tool's caller says; the engine fills the rest.export type AgentSpawnArgs = Pick<AgentSpawnInput, 'prompt'> & Partial<Pick<AgentSpawnInput, 'description' | 'subagentType' | 'model' | 'name' | 'cwd'>>;export type AgentSpawnArgs = Pick<AgentSpawnInput, 'prompt'> & Partial<Pick<AgentSpawnInput, 'description' | 'subagentType' | 'model' | 'name' | 'cwd' | 'parentAgentId'>>; -
The props of
Box: the layout, position, margin, padding and border props of Ink's Box a tree may set, and the two of hover.borderDimColor?: boolean; backgroundColor?: Color; overflow?: 'visible' | 'hidden'; overflowX?: 'visible' | 'scroll'; display?: 'flex' | 'none';}; -
Each surface's primitive tags and their prop types, by
e.surface, for the surfaces the plugin was compiled against.Markdown: ElementConstructor<MarkdownProps>; Progress: ElementConstructor<ProgressProps>; Client: ElementConstructor<ClientProps>; Shader: ElementConstructor<ShaderProps>; }; mobile: { Box: ElementConstructor<BoxProps>;… Code: ElementConstructor<CodeProps>; Markdown: ElementConstructor<MarkdownProps>; Progress: ElementConstructor<ProgressProps>; Shader: ElementConstructor<ShaderProps>; }; vscode: { Box: ElementConstructor<BoxProps>; -
The engine's own events as calls on
$, one signature each:$.<noun>.<event>(input)resolves to its result, or to its stream.tool: { call: ToolCallOverloads; check: (input: ToolCheckArgs) => Promise<ToolCheckResult>; judge: (input: ToolJudgeInput) => Promise<ToolJudgeResult>; run: (input: ToolCallInput) => Promise<ToolCallResult>; describe: (input: ToolDescribeInput) => Promise<ToolDescribeResult>; }; command: {… attach: (input: SessionAttachInput) => Promise<SessionAttachResult>; detach: (input: SessionDetachInput) => Promise<SessionDetachResult>; measure: (input: SessionMeasureInput) => Promise<SessionMeasureResult>; stop: (input: SessionStopInput) => Promise<SessionStopResult>; end: (input: SessionEndInput) => Promise<SessionEndResult>; }; telemetry: { -
The options of
$.fs.readthat ask for the bytes: the call answers{ base64 }.export type FsReadBytesOptions = { as: 'bytes'; offset?: number; length?: number;}; -
$.fs.read: the file's text, or with{ as: "bytes" }its bytes as{ base64 }; withoffsetorlength, that range of it.export type FsReadCall = { (path: string): Promise<string>; (path: string, options: FsReadBytesOptions): Promise<FsBytes>; (path: string, options: FsReadTextOptions): Promise<string>; (path: string, options: FsReadOptions): Promise<string | FsBytes>;}; -
The options of
$.fs.read: how it answers, and which bytes of the file.export type FsReadOptions = { as: FsReadAs; as?: FsReadAs; offset?: number; length?: number; [Symbol.iterator]?: never;}; -
What each call on
$answers (thevalueof its event's result), by event name.'session.identity': SessionIdentity; 'session.usage': SessionUsage; 'session.version': SessionVersion; 'session.info': SessionInfo; 'turn.abort': void; 'prompt.read': PromptBox; 'prompt.paint': PromptPainted;… }; 'config.list': ConfigRow[]; 'agent.list': AgentInfo[]; 'agent.limits': AgentLimits; 'agent.register': { agent: string; }; 'agent.call': ToolCallResult; 'ui.toast': void; 'ui.status': void; 'ui.log': void;… 'http.fetch': HttpResponse; 'process.run': ProcessRunResult; 'process.spawn': ProcessSpawnResult; 'process.hookEnv': Record<string, string>; 'settings.read': Settings; 'env.get': string | undefined; 'env.set': EnvSetResult; 'wasm.compile': WasmBytes;}; -
The input of
plugin.register: one plugin the engine is about to load, with a hooks module or without one, read off its manifest and, where it has a module, its scanned source. Every field is pinned butprovides, which only narrows.root: string; version?: string; provenance: string; requiredByOrganization?: true; uses: PluginRegisterUses; provides: PluginProvides; unread: readonly (keyof PluginProvides)[];}; -
Everything
ui.rendercan draw: one name per component that has a render site; a matcher narrows on it.export type RenderComponent = 'AskUserQuestion' | 'UserMessage' | 'AssistantMessage' | 'ToolUse' | 'ToolResult' | 'ToolGroup' | 'ToolProgress' | 'CommandOutput' | 'Spinner' | 'TurnDuration' | 'InfoNotice' | 'SessionMode' | 'PromptHint' | 'AbovePrompt' | 'AbovePromptList' | 'Pane' | 'Placed' | 'Backdrop';export type RenderComponent = 'AskUserQuestion' | 'UserMessage' | 'AssistantMessage' | 'ToolUse' | 'ToolResult' | 'ToolGroup' | 'ToolProgress' | 'CommandOutput' | 'Spinner' | 'TurnDuration' | 'InfoNotice' | 'SessionMode' | 'PromptHint' | 'AbovePrompt' | 'AbovePromptList' | 'AgentRow' | 'ContextMenu' | 'Pane' | 'Placed' | 'Backdrop'; -
What a render hook returns, and what
next(e)resolves to: a plain-data tree of elements (a Box or Text is a StyledElement), strings as children.props: SvgProps; children?: undefined;} | { type: 'Shader'; props: ShaderProps; shader?: PluginStamp; children?: RenderNode[];} | { type: 'Progress'; props: ProgressProps; children?: undefined; -
The plain-data props of each renderable component, as
ui.rendersees them undere.props; a hook rewrites them withnext({ ...e, props }).scroll: SiteScroll; view: SiteView; }; AgentRow: AgentInfo & { rowIds: string[]; columns?: number; body?: string; isHidden: boolean; }; ContextMenu: { row?: { component: RenderComponent; requestId: string; }; link?: { href: string; text?: string; }; selection?: UiSelection; code?: { text: string; isBlock: boolean; }; }; Pane: { title: string; isFocused: boolean; -
What the session has cost, as
/costand the status line total it; on an agent (AgentInfo), its own requests' part of that.export type SessionCost = { usd: number; hasUnknownPrice?: true;}; -
What
$.session.identity()answers: how the session is signed in, the address the model was handed and, under a managed pin, the account the session holds.organizationType?: string; email?: string; isVerified: boolean; contextEmail?: string; deny?: undefined;} | { deny: string;… organizationType?: undefined; email?: undefined; isVerified?: undefined; contextEmail?: undefined;}; -
One message of the transcript as
$.session.messages()returns it.text: string; toolUses: ToolUseSummary[]; toolResults?: ToolResultSummary[]; uuid?: string; handle?: string;}; -
A
$.session.messagescall for the rows (SessionMessage) of the main conversation or of one agent's, whole or in part: noas.type SessionMessagesAgentArgs = { agentId?: string; as?: undefined; last?: number; after?: string;}; -
A
$.session.messagescall for the Messages API form (ApiMessage) of the main conversation or, withagentId, of one of this session's agents'.type SessionMessagesApiArgs = { as: 'api'; agentId?: string; last?: number; after?: undefined;}; -
What
$.session.messages(args)takes and asession.messageshook reads one: whose conversation, in which form, and which part of it.type SessionMessagesArgs = { agentId?: string; as?: 'api'; last?: number; after?: string;}; -
A
$.session.messages({ as: "api" })call naming no agent: the main conversation, whose answer is always the messages (ApiMessage).type SessionMessagesMainApiArgs = { as: 'api'; agentId?: undefined; last?: number; after?: undefined;}; -
Options of
$.audio.speak.export type SpeakOptions = { voice?: string; signal?: AbortSignal;}; -
The argument of
$.audio.speak(text, options)as the event carries it: the signal does not cross.type SpeakRequest = SpeakOptions & {type SpeakRequest = { text: string; voice?: SpeakOptions['voice'];}; -
The props of
Text: colors, styles, and the size, weight, face and digits each surface draws its own way. Colors are a theme key or a raw color.strikethrough?: boolean; inverse?: boolean; dir?: 'ltr' | 'rtl'; wrap?: 'wrap' | 'end' | 'middle' | 'truncate' | 'truncate-start' | 'truncate-middle' | 'truncate-end'; wrap?: 'wrap' | 'end' | 'middle' | 'truncate' | 'truncate-start' | 'truncate-middle' | 'truncate-end' | 'clip'; maxLines?: number;}; -
color: ThemeColor; gradient?: never; vector?: never; image?: never;} -
gradient: ThemeGradient; color?: never; vector?: never; image?: never;} -
A still ground behind the conversation: a flat color, a gradient or a drawing in paths. A scene draws what moves, and any other pattern. There is no picture ground for now, so redraw a picture as SVG.
export type ThemeGround = ThemeColorGround | ThemeGradientGround | ThemeImageGround | ThemeVectorGround;export type ThemeGround = ThemeColorGround | ThemeGradientGround | ThemeVectorGround; -
A live scene: what
ui.renderanswers forBackdrop, and how the surface frosts its panels over it.color?: never; gradient?: never; vector?: never; image?: never;}; -
vector: ThemeVector; color?: never; gradient?: never; image?: never;} -
The input of
tool.describe: one tool's description, at the moment the engine first renders the tool's schema for the model.description: string; isDeferred?: true; provider: Origin; mcpServer?: ToolMcpServer;}; -
What a model turn, or one response inside it, cost as the API reported it: the four token counts (ModelUsage), the cache writes by lifetime and the model's id.
export type TurnUsage = ModelUsage & { ephemeral_5m_input_tokens?: number; ephemeral_1h_input_tokens?: number; model: string;}; -
The argument of
$.agent.call: a tool, its arguments, and whose call it is. -
Options of
$.agent.call: what is no part of the call, so no hook onagent.callreads it one. -
What
$.agent.limits()answers: the bounds the session's agents run under, as they stand at the call. -
One request of an agent's loop (a
turn.step's) as it went out, past caps, fallbacks and a hook's rewrite. -
An out parameter: a function sets
.v. -
The options of
$.fs.readthat ask for the text: the call answers a string, U+FFFD at an edge where the range cuts a character. -
One settings hook a plugin ships (hooks.json or its manifest's
hooks): the classic event it stands on (PreToolUse), its entry's matcher when it names one, and what it runs. -
What a plugin provides, kind by kind, as the host read it off the plugin's folder: the same lists
claude plugin validateprints. -
One thing
claude plugin validateadvises and no verdict counts. -
What the plugin directory's checks found, in a validate report.
-
One finding of the plugin directory's checks.
-
One file of a validate report. It failed exactly when
errorsholds something; nothing else here is a verdict. -
One error or warning of a validate report, as display text: cleaned and cut.
-
One hook at a gating site as
claude plugin validate --jsonreports it: where it is written, what it is registered on, whether.catchfollows. -
One
on(...)call of a hooks module, as validate read it. -
A matcher, or a part of one, as validate read it off the source.
anyOfis an array, or the literals afor...ofregisters a hook on in turn. -
What a hooks module does, as validate read it off its source. An empty list and
falsemean nothing; every name is whole. -
What a module's
engine.createhook does to$if it registers. -
One figure for each class of GPU.
-
What
claude plugin validate --jsonprints: a public contract, to which fields are added and in which none is renamed or retyped. -
One shader file as
claude plugin validateread it. The report's text is drawn from this; every name is whole. -
A shader's worst-case cost in a window of 1512x945 points.
-
One thing a hooks module's
$.wasm.compilecalls compile. -
One
.wasmfile a hooks module lists, asclaude plugin validatereports it: which bytes they are, and what they ask for and offer. -
What
$.session.info()answers: what a settings hook's input says of the session that no other read on$.sessiondoes, and where the engine runs. -
The input of
session.stop: what the person's Stop found. -
What a
session.stophook returns and whatnext(e)resolves to:{ isTurnRunning }, echoed by core; a hook's own value changes nothing. -
The props of
Shader, a scenedesktopplays on the GPU: the shader filemodulenames, fedvalues, over oneSvgchild, shown alone onmobile. -
aandbare the vertices', blended across the shape. -
The input of
tool.judge:tool.check's question about a real call. All of it is pinned. -
What a
tool.judgehook returns and whatnext(e)resolves to: a verdict on one call, why, and whose it is. -
The MCP server a tool comes from, as
tool.describereports it (ToolDescribeInput.mcpServer). -
The input of
ui.pointer: what the pointer did on the backdrop, and where. Every key is pinned. -
What a
ui.pointerhook returns and whatnext(e)resolves to:{}. -
A WebAssembly binary as a hook on
wasm.compilereads and answers it: base64, since only plain data crosses between environments. -
What a hook on
wasm.compilereceives: the bytes about to compile, and the file they were read from when the call named one. -
The standard API over the modules
$.wasm.compileanswers, frozen. -
A texture that lasts between frames: reading it gives its last write. With no body it is an empty target for shapes. With no
scaleorsizeit is as sharp as the picture. To read itself, it names its type:const trail: Buffer = buffer({}, p => vec4(trail.sample(p.uv) * exp(-dt))). -
True on frame 0.
-
Cuts toward zero and wraps, as
x | 0does. -
A 32-bit int that wraps:
+ - * & | ^ ~ << >> >>>with their JS meaning,*as Math.imul, shifts masked to 0..31. A whole number written beside an int is an int.int(a + b)names the result again. -
What shows, premultiplied, over the Svg. Exactly one.
-
0 to 4.
-
A loop over these stops at
pointerCount, and is charged for 4. -
The whole numbers from
from(or 0) up to, not including,to. -
A picture of the Svg under the shader; as
into, the picture itself. -
The module's default export. Passes run in order, 24 at most with tables.
-
Draws
countvertices,instancestimes, onto the picture or a buffer.atis -1 to 1 across the target (a vec4 is divided by its w, and hidden when z is outside it).sizeis a point's pixels, 1 to 64.hide: truehides every shape the vertex is part of, and keeps itsaandbout of the cost.paintanswers a premultiplied color:vec4(rgb * a, a). -
step(edge, x): 0 below the edge, else 1. -
Up to 256 rows of 1 to 4 numbers, kept as data.
.at(i)clampsi. An 'int' row of several reads as a list of ints. -
Seconds since the start.
-
The numbers the mod sets while it plays (
Shader'svalues), each held to its range. A file with more than 8 names is refused. -
Builds a vector from parts whose lanes add up, or from one number.
-
A vector is a number with lanes, so
+ - * /type-check, lane by lane, and a plain number goes to every lane. The result reads asnumber: name its width again withvec2(a + b), which the compiler proves. Lanes arexyzworrgba, read and written in any order (c.rgb = vec3(0)), or by index (v[i]). Vectors copy.
64 docs only: reworded, same shape
$.agent.spawnverbSpawns a subagent: the event
agent.spawn, the same call the engine makes when the Agent tool starts one; the engine fills the rest.$.audio.speakverbSpeaks
textwith the platform's own synthesizer (sayon macOS). Plain text.$.clocknounThe time and timers, each an event through the host:
clock.nowreads the time;clock.sleep,afterandeverywait until it has passed.$.env.setverbSets the variable for this process and everything it starts after, or unsets it when
valueisundefined.$.fsnounThe file system as the engine's own process reaches it; a relative path is under the session's working directory, and text is UTF-8.
$.fs.readverbReads a file and returns its text, or with
{ as: "bytes" }its bytes as{ base64 }; withoffsetorlength, that range of bytes alone.$.mcp.callverbCalls
toolon one of the engine's connected MCP servers with the engine's own connection and credentials.$.plugin.rootverbThe plugin's directory (the one holding
.claude-plugin/plugin.json), absolute.$.session.appendverbAppends a row to a conversation of the session: the event
session.append, the engine's own call for every row it keeps.$.session.identityverbReturns how the session is signed in, and the account (organization, plan, email) where managed
forceLoginOrgUUIDlists it. No request is made.$.session.messagesverbReturns the transcript so far, one SessionMessage per user or assistant message; progress rows,
$.ui.loglines and notices are not messages.$.session.usageverbReturns when the session began, and the context window's fill, the rate-limit windows and the cost as the status line has them, itemized. The cost includes every mod's answered
$.modelcalls, and is an estimate, not the bill (SessionCost).$.theme.setverbSets the session's theme from one object of named top-level attributes, the whole theme: what a set leaves out is gone.
backdropis a scene, drawn behind the conversation by whatui.renderanswers forBackdrop: full window on desktop under its frosted panels, full screen on mobile under one veil (tintandopacity, not yetblur). Or it's a still ground, which a surface draws with no hook: a color, a gradient or a vector.{ image }is refused, so redraw a picture as SVG.colorsis a theme for a surface to paint itself with, where it reads one. With no scene, noui.renderhook is asked to draw. Display only:--resumebrings none back and a plugin that unloads takes its own with it, so set it atsession.start.$.tool.callverbCalls a tool: the event
tool.call, the same call the engine makes for the model's tool calls, under atool_use_idof its own.$.tool.registerverbDeclares a tool the model can call from the next prompt on: the name, description and input schema of
mcp__<plugin>__<name>.agent.spawneventFires when the Agent tool, or a workflow script's
agent()(e.workflow), is about to start an agent, its model not yet resolved.audio.speakeventThe argument of
$.audio.speak(text, { voice, signal }); the signal does not cross, it aborts the call.engine.createeventRuns while
$is being built, once per load or reload of this plugin and before any other hook of it;next(e)resolves to$built so far.plugin.registereventFires once per hooks module about to join the chain, at load (the set folded and built, nothing swapped in) and at reload; core allows.
session.messageseventThe argument of
$.session.messages(args):{}for the main conversation,{ agentId }for one of its agents,asfor the form.tool.calleventFires when the engine is about to run a tool. Each
next(e)runs the hooks beneath, then core (the permission prompt, the tool itself).tool.checkeventFires when the engine decides whether a tool call may run, after the
tool.calland PreToolUse hooks and before the mode settles an ask.turn.starteventFires when a model turn begins, main's or a subagent's (
e.agentId), before its first model call;next(e)resolves to{ turnId }.AgentSpawnInputtypeThe input of
agent.spawn: what is decided about an agent about to start, before its model is resolved.AgentSpawnResulttypeWhat an
agent.spawnhook returns and whatnext(e)resolves to: the started subagent's{ model, agentId }, or{ deny: reason }, refusing it.ApiMessagetypeOne message of the conversation in Messages API form, as
$.session.messages({ as: "api" })returns it.CommandRunResulttypeWhat a
command.runhook returns and whatnext(e)and$.command.runresolve to: the command's output text and the notes it leaves the model.EnvSetResulttypeWhat
$.env.setresolves to and what anenv.sethook's{ value }holds:{}once the variable is set or unset, or why it was not.FsBytestypeWhat
$.fs.read(path, { as: "bytes" })resolves with: the file's bytes, base64, since only plain data crosses into a plugin's environment.HookBudgettypeThe time bounds every hook runs under, in milliseconds: the engine's own constants are typed by these members, and
next.budgetreads the live one.HooksModuletypeWhat a hooks module exports:
register, and nothing the loader reads besides.InstructionFiletypeOne instruction file behind the
claudeMdblock: where it was read, its tier, its text as loaded, and the file that@-imported it if one did.ModelUsagetypeWhat one model call cost, as the API counted it: the four token counts in the API's spelling, summed over the call's responses when it made several.
NextResultFortypeWhat
next(e)resolves to oncee.toolis the literalT: ontool.callandtool.runthe result typed for that tool; elseOas declared.OntypeRegisters
hookon the eventspatternselects: one by name, every one under a namespace (classic.*), all (*), or all but some (!tool.*).-
A
classic.PermissionRequestanswer'sdecision, as the classic hook'shookSpecificOutput.decision: allow (with a rewrite or rules) or deny. PluginRegisterResulttypeWhat a
plugin.registerhook returns and whatnext(e)resolves to:{ allow: true }from core, or{ refuse: reason }.PromptContextResulttypeWhat a
prompt.contexthook returns: the blocks the conversation carries, in order; one left out is not sent.PromptSubmitArgstypeprompt.submit's input as a plugin's call takes it:origin,turnIdandwaitare the engine's to set,contextthe hooks' to attach.RenderInputOftypeOne
ui.renderinput, for a component narrowed to one surface.SessionAppendArgstypesession.append's input as a plugin's$.session.append(args)takes it: the row's kind and text, and the loop it joins.SessionAppendResulttypeWhat a
session.appendhook returns and whatnext(e)resolves to: the row as the session stored it, or{ deny: reason }for a plugin's own call.SessionMeasureInputtypeThe input of
session.measure: what$.session.usage()answers at this moment, and which of its units moved since the last measurement a hook saw.SessionMessagesCalltype$.session.messages: the main conversation's rows with no argument, with{ as: "api" }its Messages API form; withagentIdan agent's, or deny.SessionMessagesDenytypeWhat
$.session.messagesresolves to whenagentIdnames no conversation this session can read, orafterno row to read on from: why, indeny.-
What
$.session.messages({ agentId, last, after })resolves to: the messages (SessionMessage), or{ deny }(SessionMessagesDeny). SessionRateLimittypeOne rate-limit window as the rate-limit notices read it.
SessionSendOrigintypeWho is sending at
session.send: the model through its SendMessage tool, or a plugin through$.session.send; stamped by the engine, pinned.SessionUsagetypeWhat
$.session.usage()answers: when the session began, the context window's fill, the account's rate-limit windows and the session's cost.ThemeBackdroptypeThe
backdropattribute of$.theme.set: what is behind the conversation.scenemakes a live scene, andcolor,gradientorvectormake a still ground. All of them are pure vector, with no embedded pictures or fonts.ThemeColorInputstypeOne mode's colors in
ThemeColors: a six-digit hex color such as#1e1e2eunder the name of each design system token the theme sets. The type checks the leading#alone.ThemeSetArgstypeThe argument of
$.theme.set: one object of named attributes, so a later attribute is an addition and never a change of the call.ThemeTilinginterfaceHow a drawing or a gradient lies in its box.
TiertypeOne of the chain's five tiers (TIERS), outermost first; on every
next.traceentry, and whatnext.to(e, tier)names.ToolCallInputtypeThe input of
tool.callandtool.run: the tool, the call's id, the tool's arguments beside them (e.commandfor Bash), andagentIdin a subagent.ToolCallResulttypeWhat a
tool.callortool.runhook returns and whatnext(e)and$.tool.call(input)resolve to:{ result, context? }or{ deny }.ToolCheckResulttypeWhat a
tool.checkhook returns and whatnext(e)resolves to: the verdict, why, and what stands behind it, never who answers it.ToolInfotypeOne tool as
$.tool.list()returns it and atool.listhook answers it.ToolResultSummarytypeOne tool_result block of a user message.
ToolUseSummarytypeOne tool_use block of an assistant message, with its outcome once the transcript holds the call's tool_result (paired by
tool_use_id).TurnCompleteFieldstypeWhat every
turn.completecarries whatever its reason: the answer, the duration, the interrupt flag, the turn's id, its loop and what it cost.TurnStartInputtypeThe input of
turn.start: the prompt a model turn begins with, the main loop's or a subagent's or teammate's run (agentId).TurnStepInputtypeThe input of
turn.step: one model request inside a turn, at the moment the engine is about to send it; the bottom of the chain sends it.-
One
prompt.attachmentinput of every other type, the ones PromptAttachmentDetailOf does not name: the attachment's text alone.