Follow Discord
Sweep 22 Oct 2026 · 04:32Z Build v2.1.308 527 read Stable v2.1.308 Latest v2.1.308 Next v2.1.308 Feeds RSS JSON llms.txt llms-full.txt Unofficial
One change · claude-code

Agent SDK reference - TypeScript changedagent-sdk/typescript

Nearest release: v2.1.238, published 6 hours before this site recorded the change. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.

Recorded here
Lines+22added
Lines−3removed
From line 621 where the diff opens
First seen 14 Aug 2026 this site's first read of the page
Recorded edits113to this page, all time

The whole hunk

from line 621, old and new numbered
/
lines

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 621
621621 account: AccountInfo;
622622 fast_mode_state?: "off" | "cooldown" | "on";
623623 fast_mode_disabled_reason?: FastModeDisabledReason;
624 hooks_applied?: boolean;
624625};
625626```
626627 
628`hooks_applied` reports whether Claude Code registered the `hooks` that the `initialize` request carried. The SDK sends that request once when the session starts and again on each [`reinitialize()`](#query-object) call. The field requires Agent SDK v0.3.238 or later.
629 
630Claude Code omits the field when the request carried no hooks. When the request carried hooks, the value depends on whether the request is the session's first initialize and, for a repeated one, on how it reached the session:
631 
632* `true`: Claude Code registered the hooks. A session's first initialize returns this value. So does a repeated initialize sent over the CLI's stdin. In that case the hooks in the new request replace the hooks registered earlier.
633* `false`: Claude Code ignored the hooks. A repeated initialize sent to a remote session returns this value, so a second client that joins a session can't replace the hooks the first client registered.
634 
635Before Agent SDK v0.3.238, the response never carried the field, and Claude Code ignored `hooks` on every repeated initialize.
636 
627637The response always reports `fast_mode_state`, and when something blocks [fast mode](/docs/en/fast-mode), `fast_mode_disabled_reason` carries the reason code alongside it, so you can explain the blocked state instead of re-deriving availability. Both behaviors require Claude Code v2.1.219 or later. Before v2.1.219, the response omitted `fast_mode_state` when fast mode wasn't available and never carried a reason. For the reason codes and their meanings, see [`fast_mode_disabled_reason`](#sdkresultmessage) on the result message.
628638 
629639When a client sends `initialize` to a session that is already running, the control-response wrapper also carries an optional `pending_permission_requests` array. The field is on the response wrapper itself, not in the `SDKControlInitializeResponse` payload above. Each entry is a complete `control_request` message with the same `{ type: "control_request", request_id, request }` shape the session streams for permission requests while running.
from line 4241
42314241};
42324242```
42334243 
4234### `McpServerStatusConfig`
4235 
4236The configuration of an MCP server as reported by `mcpServerStatus()`. This is the union of all MCP server transport types.
4237 
4238```typescript theme={null}
4239type McpServerStatusConfig =
4240 | McpStdioServerConfig
4241 | McpSSEServerConfig
4242 | McpHttpServerConfig
4243 | McpSdkServerConfig
4244 | McpClaudeAIProxyServerConfig;
4245```
4246 
4247See [`McpServerConfig`](#mcpserverconfig) for details on each transport type.
4248 
4249### `AccountInfo`
4250 
4251Account information for the authenticated user.
4252 
4253```typescript theme={null}
4254type AccountInfo = {
4255 email?: string;
4256 organization?: string;
4257 subscriptionType?: string;
4258 tokenSource?: string;
4259 apiKeySource?: string;
4260};
4261```
4262 
4263### `ModelUsage`
4264 
4265Per-model usage statistics returned in result messages. The `costUSD` value is a client-side estimate. See [Track cost and usage](/docs/en/agent-sdk/cost-tracking) for billing caveats.
4266 
4267```typescript theme={null}
4268type ModelUsage = {
4269 inputTokens: number;
4270 outputTokens: number;
4271 cacheReadInputTokens: number;
4272 cacheCreationInputTokens: number;
4273 webSearchRequests: number;
4274 costUSD: number;
4275 conte
4244### `
Feedback