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.286
+9 added · 0 removed · 4 changed · 2 docs only since 2.1.285The engine
-
Returns the system prompt's sections for
facts: the eventprompt.compose, the call the engine makes for every prompt it sends.
Events
-
Fires when the engine renders a system prompt;
next(e)resolves to{ sections }, each{ id, text, scope }, in the order they are sent. -
{ sections }, everysharedone ahead of everysessionone (a section left out is not sent).
Types
-
The engine's own events as calls on
$, one signature each:$.<noun>.<event>(input)resolves to its result, or to its stream.section: (input: PromptSectionInput) => Promise<PromptSectionResult>; context: (input: PromptContextInput) => Promise<PromptContextResult>; attachment: (input: PromptAttachmentInput) => Promise<PromptAttachmentResult>; compose: (input?: PromptComposeArgs) => Promise<PromptComposeResult>; }; skill: { prompt: (input: SkillPromptInput) => Promise<SkillPromptResult>; -
Where a
prompt.submitsubmission came from, as the engine knows it at the site it was queued from; a closed set, never a text prefix.} | { kind: 'plugin'; name: string; asUser?: true;}; -
prompt.submit's input as a plugin's call takes it:origin,turnIdandwaitare the engine's to set,contextthe hooks' to attach.export type PromptSubmitArgs = Omit<PromptSubmitInput, 'origin' | 'turnId' | 'wait' | 'context'>;export type PromptSubmitArgs = Omit<PromptSubmitInput, 'origin' | 'turnId' | 'wait' | 'context'> & { asUser?: true;}; -
The plain-data props of each renderable component, as
ui.rendersees them undere.props; a hook rewrites them withnext({ ...e, props }).isDraft: boolean; isWorking: boolean; hint: string; tail?: string; }; AbovePrompt: { hasSurvey: boolean; -
What a plugin passes
$.prompt.compose: the facts it wants composed for, each one it leaves out read off the session (its model, its tools). -
The input of
prompt.compose: the facts a system prompt is composed from, each already resolved by the engine, at the moment it renders one. -
What a
prompt.composehook returns: the sections of the system prompt, in order, everysharedone ahead of everysessionone. -
Which side of the prompt cache's boundary a section of the system prompt sits on:
sharedbefore it,sessionafter it. -
One section of the system prompt as
prompt.composeanswers it: a stable id, the text the model reads, and the side of the cache boundary it is on. -
One branch the engine's own composition of the system prompt takes on the request or the session before it computes any section: a closed set.
2 docs only: reworded, same shape
prompt.sectioneventFires once per named section of the system prompt, when the engine assembles it;
next(e)resolves to{ text }as core computed it.PromptSectionInputtypeThe input of
prompt.section: one named section of the system prompt, at the moment the engine assembles it.
v2.1.285
+13 added · 0 removed · 5 changed · 9 docs only since 2.1.284The engine
-
Connects one of the MCP servers this plugin's own manifest lists; a server already connected answers at once.
-
Appends a row to a conversation of the session: the event
session.append, the engine's own call for every row it keeps.
Events
-
Fires once per row a conversation of this session keeps (a prompt, a response block, a tool result, a notice), before it is stored.
-
{ message, uuid }, the row as stored.
Types
-
The engine's own events as calls on
$, one signature each:$.<noun>.<event>(input)resolves to its result, or to its stream.session: { start: (input: SessionStartInput) => Promise<SessionStartResult>; receive: (input: SessionReceiveInput) => Promise<SessionReceiveResult>; append: (input: SessionAppendInput) => Promise<SessionAppendResult>; send: (input: SessionSendArgs) => Promise<SessionSendResult>; compact: (input?: SessionCompactArgs) => Promise<SessionCompactResult>; attach: (input: SessionAttachInput) => Promise<SessionAttachResult>; -
What each call on
$answers (thevalueof its event's result), by event name.'audio.play': void; 'audio.speak': SpeakResult; 'mcp.call': McpToolResult; 'mcp.connect': McpConnectResult; 'session.cwd': string; 'session.root': string; 'session.model': string; -
What a
prompt.edithook returns and whatnext(e)resolves to: the box after the edit (PromptBox), which the editor then shows.export type PromptEditResult = PromptBox;export type PromptEditResult = PromptBox & { decorations?: PromptDecoration[];}; -
prompt.fill's input as a plugin's$.prompt.fill(args)takes it: noorigin(the engine sets the calling plugin's),modeoptional.export type PromptFillArgs = { text: string; mode?: PromptFillMode; decorations?: PromptDecoration[];}; -
The input of
prompt.fill(prompt-fill/): a text about to be put in the prompt box as the person's draft, over it, after it, or at the cursor.text: string; mode: PromptFillMode; origin: PromptFillOrigin; decorations?: PromptDecoration[];}; -
Why
$.mcp.connectleft a server unconnected, in one word. -
What
$.mcp.connectresolves to and what anmcp.connecthook's{ value }holds: the server connected, or why not. -
One styled run a surface paints over the prompt draft:
[start, end)of a text, in UTF-16 code units like PromptBoxcursor. Paint only. -
session.append's input as a plugin's$.session.append(args)takes it: the row's kind and text, and the loop it joins. -
Which door a row came in by, decided from the row alone; a closed set, pinned on the event and the key a matcher narrows on.
-
The input of
session.append: one row being appended to a conversation of this session, by the engine site that originates it or by a plugin's call. -
One row of a conversation as
session.appendhands it: how the transcript files it, under which role a request carries it, and its blocks. -
Who caused a row, as the engine knows it from the row itself: a submission's sender, an injected row's author, the model, or the tool that was called.
-
What 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.
9 docs only: reworded, same shape
$.mcpnounThe engine's MCP servers: calling a connected one's tools, and connecting one the plugin lists itself.
$.telemetry.logverbLogs one record to the destination
entry.tonames, the eventtelemetry.log;e.tois pinned, andanthropicwhen left out.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.
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.ClassicEventtypeA classic hook event the engine raises on its own, by its own name (
SessionStart,Stop): all butPreToolUse, which ridestool.call.ClassicEventNametypeThe name of a classic hook event as a function-hooks event: the settings hook's own name under
classic(classic.Stop,classic.PreToolUse).PluginRegisterResulttypeWhat a
plugin.registerhook returns and whatnext(e)resolves to:{ allow: true }from core, or{ refuse: reason }.PreToolUseResulttypeWhat a
classic.PreToolUsehook returns: one ofallow,ask,deny, or none of them, which passes the call on to the normal permission flow.RenderPropsOftypeThe plain-data props of each renderable component, as
ui.rendersees them undere.props; a hook rewrites them withnext({ ...e, props }).
v2.1.284
+22 added · 0 removed · 7 changed · 12 docs only since 2.1.283The engine
-
Runs one text completion through the session's own API client and resolves a result: the reply's text and cost, or why there is no text.
(request: ModelCompleteRequest) => Promise<ModelCompleteResult>(request: ModelCompleteRequest, options?: ModelCompleteOptions) => Promise<ModelCompleteResult> -
Analytics: first-party rows and feature marks for Anthropic, and records for the telemetry collector the session's operator configured.
-
Logs one record to the destination
entry.tonames, the eventtelemetry.log;e.tois pinned, andanthropicwhen left out. -
Marks one use of a feature as the CLI's own feature events do, the event
telemetry.mark; it takes notoand always meansanthropic.
Events
-
Fires 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. -
{ value: undefined }, or{ deny }. -
Fires when one use of a feature is marked (
$.telemetry.mark), as the CLI's own feature events mark one; always foranthropic, noto. -
{ value: undefined }, or{ deny }.
Types
-
The props of
Button, every surface's pressable leaf: an address, a label, the closure a press runs, and the label styles a hover overrides.role?: 'dismiss'; autoFocus?: true; hover?: TextHoverProps; onPress: () => void; onPress: (e: UiPressArgument) => void;}; -
What a
command.runhook returns and whatnext(e)and$.command.runresolve to: the command's output text and the notes it leaves the model.export type CommandRunResult = { text?: string; context?: readonly string[]; exitCode?: number; ref?: number;}; -
The engine's own events as calls on
$, one signature each:$.<noun>.<event>(input)resolves to its result, or to its stream.measure: (input: SessionMeasureInput) => Promise<SessionMeasureResult>; end: (input: SessionEndInput) => Promise<SessionEndResult>; }; telemetry: { log: (input: TelemetryLogArgs) => Promise<TelemetryLogResult>; mark: (input: TelemetryMarkInput) => Promise<TelemetryMarkResult>; }; turn: { start: (input: TurnStartInput) => Promise<TurnStartResult>; step: (input: TurnStepInput) => HookStream<TurnStepChunk, TurnStepResult>; -
One entry of
$.fs.list: the entry itself, a link not followed.name: string; kind: 'file' | 'dir' | 'other'; size: number; mtimeMs: number; isLink: boolean;}; -
What
$.process.runresolves with once the child has exited.exitCode: number; stdout: string; stderr: string; isStdoutTruncated: boolean; isStderrTruncated: boolean;}; -
What
testtakes beside its name: the inline plugins it loads beside the one under test, and how long it may run (5000 ms when not given).export type TestOptions = { plugins?: readonly Plugin[]; timeoutMs?: number; options?: PluginOptions;}; -
Options of
$.model.complete: what is no part of the request, so no hook onmodel.completereads it one. -
One attribute of a collector record, as the collector receives it.
-
A string property of a first-party row: the value and the list it is chosen from, so no free text reaches a row.
-
Where a telemetry record goes:
anthropic, Anthropic's first-party analytics, orcollector, the one the session's operator configured. -
What a call of
$.telemetry.logpasses: a first-party row,tooptional, or a collector record. -
The input of
telemetry.log: one record about to be logged to the destinationtonames, which is always present and pinned. -
What a
telemetry.loghook returns andnext(e)resolves to:{ value: undefined }, or{ deny }, which rejects the caller's promise. -
The input of
telemetry.mark: one use of a feature, as the CLI's own feature events mark one. -
How one use of a feature went, as the CLI's own feature events count it.
-
What a
telemetry.markhook returns andnext(e)resolves to:{ value: undefined }, or{ deny }, which rejects the caller's promise. -
One property of a first-party row or a mark: a number, a boolean, or a string chosen from a list (TelemetryChoice).
-
A record for the telemetry collector the session's operator configured.
-
A first-party row as a call passes it:
toleft out reads asanthropic. -
A first-party row as a hook reads it:
tois always present, the engine having completed it before any hook or matcher readse. -
The span a collector record belongs to, as W3C trace context spells it: the ids in lowercase hex.
12 docs only: reworded, same shape
$.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.existsverbReturns whether the path exists; rejects only a network location, which the implementation beneath the hooks never touches.
$.fs.listverbLists a directory by name:
{ name, kind, size, mtimeMs, isLink }per entry, each entry as it stands.$.process.runverbRuns a command on the host by its argument vector (no shell) and resolves
{ exitCode, stdout, stderr }once it exits, any exit code.model.completeeventThe argument of
$.model.complete(request, { signal }); the signal does not cross, it aborts the call.BoxHoverPropstypeThe
Boxprops ahovermay override, none of which moves the Box's siblings, andscope, which names the hover group the Box joins.GlobtypeEvery event (
*), or every event under a namespace (classic.*: each one whose name starts withclassic.).ModelCompleteResulttypeWhat one model call resolves to: the reply when the model answered (
isAnswered), else which of three things left it without text (reason).Negationtype!before a name or a glob: every event except the ones it selects.!*would select none, so it is no pattern.ProcessSpawnChunktypeOne piece of a spawned child's output as
$.process.spawnstreams it: which pipe it came from, and the text.RenderPropsOftypeThe plain-data props of each renderable component, as
ui.rendersees them undere.props; a hook rewrites them withnext({ ...e, props }).UiCopyResulttypeWhat
$.ui.copyresolves to and what aui.copyhook's{ value }holds: whether the text reached a clipboard (isCopied), else why not.
v2.1.283
+0 added · 0 removed · 2 changed · 2 docs only since 2.1.282Types
-
The props of
Button, every surface's pressable leaf: an address, a label, the closure a press runs, and the label styles a hover overrides.plain?: true; dimColor?: boolean; variant?: 'primary' | 'secondary'; role?: 'dismiss'; autoFocus?: true; hover?: TextHoverProps; onPress: () => void; -
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.plain?: true; dimColor?: TextProps['dimColor']; variant?: ButtonProps['variant']; role?: ButtonProps['role']; autoFocus?: true; }; press: {
2 docs only: reworded, same shape
RenderPropsOftypeThe plain-data props of each renderable component, as
ui.rendersees them undere.props; a hook rewrites them withnext({ ...e, props }).TurnCompleteFieldstypeWhat every
turn.completecarries whatever its reason: the answer, the duration, the interrupt flag, the turn's id, its loop and what it cost.
v2.1.282
+0 added · 0 removed · 5 changed · 3 docs only since 2.1.281Types
-
The props of
Button, every surface's pressable leaf: an address, a label, the closure a press runs, and the label styles a hover overrides.action?: string; plain?: true; dimColor?: boolean; variant?: 'primary' | 'secondary'; autoFocus?: true; hover?: TextHoverProps; onPress: () => void; -
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';}; -
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'; text: string; cursor: number;}; -
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.action?: string; plain?: true; dimColor?: TextProps['dimColor']; variant?: ButtonProps['variant']; autoFocus?: true; }; press: { -
An external-event wake the delivery's text parsed as (a GitHub relay event, a signal's notice): the envelope's attributes and its JSON body.
export type SessionReceiveEvent = { source: string; kind: string; from?: string; data: Record<string, unknown>; untrustedKeys: readonly string[];};
3 docs only: reworded, same shape
MarkdownPropstypeThe props of
Markdown, a block of markdown every surface draws as it draws an assistant reply's text: its own renderer, links, tables, fences.RenderPropsOftypeThe plain-data props of each renderable component, as
ui.rendersees them undere.props; a hook rewrites them withnext({ ...e, props }).TurnCompleteFieldstypeWhat every
turn.completecarries whatever its reason: the answer, the duration, the interrupt flag, the turn's id, its loop and what it cost.