Agent SDK reference - TypeScript changedagent-sdk/typescript
Nearest release: v2.1.283, published 4 hours before upstream edited the page. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.
Upstream edited this page at 25 Sep 2026 22:47 UTC, give or take a minute or two: the time comes from Anthropic’s own sitemap rather than from a commit. This site recorded the change at 25 Sep 2026 23:07 UTC.
Upstream edited
Recorded here
Lines+7added
Lines−1removed
From line
523
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits58to this page, all time
The whole hunk
from line 523, old and new numbered
/
This page is larger than the 256 KiB this site keeps, so one side of the diff below stops where the stored text does.
from line 523
523523| `toolAliases` | `Record<string, string>` | `undefined` | Map built-in tool names to MCP tool names so Claude calls your MCP implementation in place of the built-in. For example, `{ Bash: 'mcp__workspace__bash' }` |
524524| `toolConfig` | [`ToolConfig`](#toolconfig) | `undefined` | Configuration for built-in tool behavior. See [`ToolConfig`](#toolconfig) for details |
525525| `tools` | `string[] \| { type: 'preset'; preset: 'claude_code' }` | `undefined` | Tool configuration. Pass an array of tool names or use the preset to get Claude Code's default tools |
526| `verbatimPrompts` | `boolean` | `false` | Deliver every prompt as written. The SDK sends each user message with `client_composed: true`. See [`client_composed`](#sdkusermessage) for what Claude Code skips on those messages. Use this option when your prompt text includes content the end user didn't type. For per-turn control, leave it off and set `client_composed` on individual streamed messages instead. Requires TypeScript Agent SDK v0.3.280 or later and Claude Code v2.1.248 or later; the Claude Code version bundled with those SDK versions satisfies the Claude Code requirement |
526527
527528#### Handle slow or stalled API responses
528529
from line 1356
13551356 parent_tool_use_id: string | null;
13561357 isSynthetic?: boolean;
13571358 shouldQuery?: boolean;
1359 client_composed?: true;
13581360 tool_use_result?: unknown;
13591361 origin?: SDKMessageOrigin;
13601362 inline_pastes?: string[];
from line 1365
13631365
13641366Set `pasted_content` to send content the user pasted into your prompt UI rather than typed, one entry per paste, each a string or an array of content blocks. Claude Code appends each entry's text after the typed text, in order, and may wrap each paste in `<pasted_content>` tags. Blocks other than text are ignored, so send images and documents in `message.content`. Requires Agent SDK v0.3.277 or later.
13651367
1366Set `shouldQuery` to `false` to append the message to the transcript without triggering an assistant turn. The message is held and merged into the next user message that does trigger a turn. Use this to inject context, such as the output of a command you ran out of band, without spending a model call on it.
1368Set `shouldQuery` or `client_composed` to change how Claude Code handles a message you send:
13671369
1370* `shouldQuery`: set it to `false` to append the message to the transcript without triggering an assistant turn. The message is held and merged into the next user message that does trigger a turn. Use this to inject context, such as the output of a command you ran out of band, without spending a model call on it.
1371* `client_composed`: set it to `true` to have Claude Code deliver the message text as written. Claude Code then doesn't expand `@path` or [`@server:resource`](/docs/en/mcp#use-mcp-resources) mentions, and doesn't run text that starts with `/` as a command. While the [`verbatimPrompts`](#options) option is on, the SDK sets the field on every message. Requires TypeScript Agent SDK v0.3.280 or later and Claude Code v2.1.248 or later.
1372
13681373On a message that carries a `tool_result` block, `tool_use_result` is the tool's structured output object rather than the text sent to the model. Its shape depends on the tool named by the matching `tool_use` block, so the field is typed `unknown`; the built-in shapes are listed under [Tool Output Types](#tool-output-types).
13691374
13701375For the `Agent` tool, `tool_use_result` is [`AgentOutput`](#agent-2). On a `completed` result, `content` holds the subagent's report without the agent ID and usage trailer that Claude Code appends to the `tool_result` text, so render from `tool_use_result` instead of parsing that text.
from line 1390
13851390 message: MessageParam;
13861391 parent_tool_use_id: string | null;
13871392 isSynthetic?: boolean;
1393 client_composed?: true;
13881394 tool_use_result?: unknown;
13891395 origin?: SDKMessageOrigin;
13901396 isReplay: true;
from line 2344
23382344
23392345```typescript theme={null}
23402346type TeammateIdleHookInput = BaseHookInput & {
2341 hook_event_name: "TeammateIdle";
2342 teammate_name: string;
2343 /** @deprecated since v2.1.178. Carries the session-derived team name; will be removed. */
2344 team_name: string;
2345};
2346```
2347
2348#### `TaskCreatedHookInput`
2349
2350```typescript theme={null}
2351type TaskCreatedHookInput = BaseHookInput & {
2352 hook_event_name: "TaskCreated";
2353 task_id: string;
2354 task_subject: string;
2355 task_description?: string;
2356 teammate_name?: string;
2357 /** @deprecated since v2.1.178. Carries the session-derived team name; will be removed. */
2358 team_name?: string;
2359};
2360```
2361
2362#### `TaskCompletedHookInput`
2363
2364```typescript theme={null}
2365type TaskCompletedHookInput = BaseHookInput & {
2366 hook_event_name: "TaskCompleted";
2367 task_id: string;
2368 task_subject: string;
2369 task_description?: string;
2370 teammate_name?: string;
2371 /** @deprecated since v2.1.178. Carries the session-derived team name; will be removed. */
2372 team_name?: string;
2373};
2374```
2375
2376#### `ElicitationHookInput`
2377
2378```typescript theme={null}
2379type ElicitationHookInput = BaseHookInput & {
2380 hook_event_name: "Elicitation";
2381 mcp_server_name: string;
2382 message: string;
2383 mode?: "form" | "url";
2384 url?: string;
2385 elicitation_id?: string;
2386 requested_schema?: Record<string, unknown>;
2387};
2388```
2389
2390#### `ElicitationResultHookInput`
2391
2392```typescript theme={null}
2393type ElicitationResultHookInput = BaseHookInput & {
2394 hook_event_name: "ElicitationResult";
2395 mcp_server_name: string;
2396 elicitation_id?: string;
2397 mode?: "form" | "url";
2398 action: "accept" | "decline" | "cancel";
2399 content?: Record<string, unknown>;
2400};
2401```
2402
2403#### `ConfigChangeHookInput`
2404
2405```typescript theme={null}
2406type ConfigChangeHookInput = BaseHookInput & {
2407 hook_event_name: "ConfigChange";
2408 source:
2409 | "user_settings"
2410 | "project_settings"
2411 | "local_settings"
2412 | "policy_settings"
2413 | "skills";
2414 file_path?: string;
2415};
2416```
2417
2418#### `InstructionsLoadedHookInput`
2419
2420```typescript theme={null}
2421type InstructionsLoadedHookInput = BaseHookInput & {
2422 hook_event_name: "InstructionsLoaded";
2423 file_path: string;
2424 memory_type: "Us
2347 ho
No line in this hunk matches that.