@anthropic-ai/claude-agent-sdk 0.2.120 → 0.2.122

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/manifest.json CHANGED
@@ -1,47 +1,47 @@
1
1
  {
2
- "version": "2.1.120",
3
- "commit": "080f07fb4224786b965b9ea0a35f0cff594f2eb6",
4
- "buildDate": "2026-04-24T21:51:03Z",
2
+ "version": "2.1.122",
3
+ "commit": "70046c58fb1c720f82bcbf39a3447dadf5bd33b2",
4
+ "buildDate": "2026-04-28T01:50:47Z",
5
5
  "platforms": {
6
6
  "darwin-arm64": {
7
7
  "binary": "claude",
8
- "checksum": "fad8faf49c7b1b454c38d785b75e17edbdadc7ffaf450b31349aafc6560b8ef6",
9
- "size": 213981440
8
+ "checksum": "4b01075bd923084fe56124bfb647f5eca98c2b1fa34cb039d2e75ccc84af4b86",
9
+ "size": 215880320
10
10
  },
11
11
  "darwin-x64": {
12
12
  "binary": "claude",
13
- "checksum": "ad68f225e96db8b7d12d0c31f0343bc3227ea2886ecefae2f483cb32310b0004",
14
- "size": 215529168
13
+ "checksum": "8c56cd72093c4b0002c7ec04ad69c0f0d04f0042c9fe399c194639f2d350934d",
14
+ "size": 217444560
15
15
  },
16
16
  "linux-arm64": {
17
17
  "binary": "claude",
18
- "checksum": "a6d0d25946c32a24b4e04471af70845a45428ca069fb3b489345f2a683262279",
19
- "size": 246024768
18
+ "checksum": "ec608f447cf8d8a323e174a7b95f664d4835a77562c31f8562fa35b01e326d07",
19
+ "size": 247925312
20
20
  },
21
21
  "linux-x64": {
22
22
  "binary": "claude",
23
- "checksum": "12c0d6eb6d39dc2597fd131d8ea4f12ed8bf25b47dadd9173878e6d025959c9f",
24
- "size": 245832320
23
+ "checksum": "5525f482dd1fa6e3fe5fa48ae7a82dd9e2db7293af165a56c95fcc7899cd8468",
24
+ "size": 247732864
25
25
  },
26
26
  "linux-arm64-musl": {
27
27
  "binary": "claude",
28
- "checksum": "8b8d02e87c842f90d5ad47321ea6f42b581fafe7cd50cd9fba5b27fe89ff51df",
29
- "size": 238750080
28
+ "checksum": "9faa638e6613adc80af412f4896e9a289d9eb8c90e437030883d1193a64a75c2",
29
+ "size": 240650624
30
30
  },
31
31
  "linux-x64-musl": {
32
32
  "binary": "claude",
33
- "checksum": "5406ef30a37413e9e6fdac1c641742e8c2b88f033256e8ba1ece0b4419d30157",
34
- "size": 240097664
33
+ "checksum": "a1fb02167a8eac04721f072148244a6954705529bc0bd428d10d002e84ef8e4d",
34
+ "size": 241998208
35
35
  },
36
36
  "win32-x64": {
37
37
  "binary": "claude.exe",
38
- "checksum": "987d99dfae28c9a554bbb15a9d432cfa75df7c175db523c232ef68950068df4c",
39
- "size": 251858080
38
+ "checksum": "65c4534c59e25cf3d490f1109e55e8193317489848c6e834cea21ceff2a5e4b4",
39
+ "size": 253690528
40
40
  },
41
41
  "win32-arm64": {
42
42
  "binary": "claude.exe",
43
- "checksum": "2bf424fe9772eadae4dc814126b5a1184d5d1d63be9f342fde251580d678fd04",
44
- "size": 247922336
43
+ "checksum": "179030909886e384edadbb8538615c88d8d259f879b56f0747abf5a3772b83f0",
44
+ "size": 249753248
45
45
  }
46
46
  }
47
47
  }
package/manifest.zst.json CHANGED
@@ -1,55 +1,55 @@
1
1
  {
2
- "version": "2.1.120",
3
- "commit": "080f07fb4224786b965b9ea0a35f0cff594f2eb6",
4
- "buildDate": "2026-04-24T21:58:09Z",
2
+ "version": "2.1.122",
3
+ "commit": "70046c58fb1c720f82bcbf39a3447dadf5bd33b2",
4
+ "buildDate": "2026-04-28T01:58:09Z",
5
5
  "platforms": {
6
6
  "darwin-arm64": {
7
7
  "binary": "claude.zst",
8
- "checksum": "adcdcaf24ae240fdc59a2c5e790c2d1eb3d93cb729ff9ba9993a3801553c7201",
9
- "size": 44236339,
8
+ "checksum": "de5f482f640d24554e402c5ccaa9ae11c922ff4467a4eec31ea1b44385f0eec7",
9
+ "size": 44626967,
10
10
  "bundle": {
11
- "checksum": "cf5f610c299ce7eddc8b83a32aff1aba4308b93e9d25539549f3c52c2315b5bb",
12
- "size": 44244892
11
+ "checksum": "da7354edbd69af353c195b9c9b2a0dea32aa5f777c6287211148da2999135bee",
12
+ "size": 44632790
13
13
  }
14
14
  },
15
15
  "darwin-x64": {
16
16
  "binary": "claude.zst",
17
- "checksum": "b2cbcbe5e57a7fbd89d73fdc1f6488116034aaa3c85b59530552cae50b478451",
18
- "size": 45941282,
17
+ "checksum": "16b2a3c3f2a4fab48558881ec3cb055d959c573b96e3f3ff068a750fd7695d77",
18
+ "size": 46355778,
19
19
  "bundle": {
20
- "checksum": "ad46d2cb1134bde351eb95406f07f33be2b27410b8e1029fc028b86f95a969fb",
21
- "size": 45945061
20
+ "checksum": "70cb14bd507175bc2f2786cfc594b0805ac743c2f4e46ca526d5f3740f1937a1",
21
+ "size": 46362451
22
22
  }
23
23
  },
24
24
  "linux-arm64": {
25
25
  "binary": "claude.zst",
26
- "checksum": "be345830447e7ac70aee331f1faae49c1f0c621aae0dfcec5f4555635a723691",
27
- "size": 53802919
26
+ "checksum": "39e80b05bcc39fe36a3e2be4d06b38e6995eebc4ac1f03dba0eef306c8e48b86",
27
+ "size": 54153349
28
28
  },
29
29
  "linux-x64": {
30
30
  "binary": "claude.zst",
31
- "checksum": "9a00a29b1acc0c18e214e18d435176baaab24ab49f33b67c25d30a8689378325",
32
- "size": 54375672
31
+ "checksum": "1eab939d384f3cf2f7f7c667ceeb5e59297377b7df64fd854f185a2000492074",
32
+ "size": 54752600
33
33
  },
34
34
  "linux-arm64-musl": {
35
35
  "binary": "claude.zst",
36
- "checksum": "db04f97ee06c0e6ec43cfeb1b78f76fafc245a9dc2107a821bdca6c451cccc02",
37
- "size": 52412046
36
+ "checksum": "b012fe945ce7a0ce44cf84cce5e97431a7757c17efad615b12828939f7ae3450",
37
+ "size": 52792068
38
38
  },
39
39
  "linux-x64-musl": {
40
40
  "binary": "claude.zst",
41
- "checksum": "ac0c7ebb578d0502cd35e1384eadf3a16307ab8c6a35ca9fb7af35ce0c9dd9ed",
42
- "size": 53073404
41
+ "checksum": "84c55cc4a14646e6e5fb1b484cfb8c1d098bf6b27dbfa5cb59b455d2838ea7ec",
42
+ "size": 53459786
43
43
  },
44
44
  "win32-x64": {
45
45
  "binary": "claude.exe.zst",
46
- "checksum": "573e670be41609ef16e34ff686a8e4aeb3249fca6166fd0978d2ba49750955d8",
47
- "size": 55443349
46
+ "checksum": "3b1bf92de8c1d955ec9da8450cc8f66234ad1ee791cf136d678544c0842b70e6",
47
+ "size": 55812105
48
48
  },
49
49
  "win32-arm64": {
50
50
  "binary": "claude.exe.zst",
51
- "checksum": "4713446d69307b5a026e6553ae64e6518ef82727ebaa1a8a9b09f80e5637b73b",
52
- "size": 53562966
51
+ "checksum": "4dd5c1f3aec4f350bc6a9b3c537df64db3ec27bbd6991b5fe0c406bf503f829d",
52
+ "size": 53919684
53
53
  }
54
54
  }
55
55
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anthropic-ai/claude-agent-sdk",
3
- "version": "0.2.120",
3
+ "version": "0.2.122",
4
4
  "main": "sdk.mjs",
5
5
  "types": "sdk.d.ts",
6
6
  "exports": {
@@ -55,14 +55,14 @@
55
55
  "zod": "^4.0.0"
56
56
  },
57
57
  "optionalDependencies": {
58
- "@anthropic-ai/claude-agent-sdk-linux-x64": "0.2.120",
59
- "@anthropic-ai/claude-agent-sdk-linux-arm64": "0.2.120",
60
- "@anthropic-ai/claude-agent-sdk-linux-x64-musl": "0.2.120",
61
- "@anthropic-ai/claude-agent-sdk-linux-arm64-musl": "0.2.120",
62
- "@anthropic-ai/claude-agent-sdk-darwin-x64": "0.2.120",
63
- "@anthropic-ai/claude-agent-sdk-darwin-arm64": "0.2.120",
64
- "@anthropic-ai/claude-agent-sdk-win32-x64": "0.2.120",
65
- "@anthropic-ai/claude-agent-sdk-win32-arm64": "0.2.120"
58
+ "@anthropic-ai/claude-agent-sdk-linux-x64": "0.2.122",
59
+ "@anthropic-ai/claude-agent-sdk-linux-arm64": "0.2.122",
60
+ "@anthropic-ai/claude-agent-sdk-linux-x64-musl": "0.2.122",
61
+ "@anthropic-ai/claude-agent-sdk-linux-arm64-musl": "0.2.122",
62
+ "@anthropic-ai/claude-agent-sdk-darwin-x64": "0.2.122",
63
+ "@anthropic-ai/claude-agent-sdk-darwin-arm64": "0.2.122",
64
+ "@anthropic-ai/claude-agent-sdk-win32-x64": "0.2.122",
65
+ "@anthropic-ai/claude-agent-sdk-win32-arm64": "0.2.122"
66
66
  },
67
67
  "files": [
68
68
  "sdk.mjs",
@@ -78,5 +78,5 @@
78
78
  "manifest.json",
79
79
  "manifest.zst.json"
80
80
  ],
81
- "claudeCodeVersion": "2.1.120"
81
+ "claudeCodeVersion": "2.1.122"
82
82
  }
package/sdk.d.ts CHANGED
@@ -424,6 +424,14 @@ declare type CreateSdkMcpServerOptions = {
424
424
  name: string;
425
425
  version?: string;
426
426
  tools?: Array<SdkMcpToolDefinition<any>>;
427
+ /**
428
+ * When true, all tools from this server are always included in the prompt
429
+ * and never deferred behind tool search. Applied via
430
+ * `_meta['anthropic/alwaysLoad']` on each tool. Equivalent to
431
+ * `defer_loading: false` on the API. Per-tool `tool({ alwaysLoad })` still
432
+ * works and is OR'd with this.
433
+ */
434
+ alwaysLoad?: boolean;
427
435
  };
428
436
 
429
437
  export declare type CwdChangedHookInput = BaseHookInput & {
@@ -928,6 +936,10 @@ export declare type McpHttpServerConfig = {
928
936
  url: string;
929
937
  headers?: Record<string, string>;
930
938
  tools?: McpServerToolPolicy[];
939
+ /**
940
+ * When true, all tools from this server are always included in the prompt and never deferred behind tool search. Equivalent to setting defer_loading: false on the API. Default: tools are deferred when tool search is enabled.
941
+ */
942
+ alwaysLoad?: boolean;
931
943
  };
932
944
 
933
945
  export declare type McpSdkServerConfig = {
@@ -1029,6 +1041,10 @@ export declare type McpSSEServerConfig = {
1029
1041
  url: string;
1030
1042
  headers?: Record<string, string>;
1031
1043
  tools?: McpServerToolPolicy[];
1044
+ /**
1045
+ * When true, all tools from this server are always included in the prompt and never deferred behind tool search. Equivalent to setting defer_loading: false on the API. Default: tools are deferred when tool search is enabled.
1046
+ */
1047
+ alwaysLoad?: boolean;
1032
1048
  };
1033
1049
 
1034
1050
  export declare type McpStdioServerConfig = {
@@ -1036,6 +1052,10 @@ export declare type McpStdioServerConfig = {
1036
1052
  command: string;
1037
1053
  args?: string[];
1038
1054
  env?: Record<string, string>;
1055
+ /**
1056
+ * When true, all tools from this server are always included in the prompt and never deferred behind tool search. Equivalent to setting defer_loading: false on the API. Default: tools are deferred when tool search is enabled.
1057
+ */
1058
+ alwaysLoad?: boolean;
1039
1059
  };
1040
1060
 
1041
1061
  /**
@@ -1737,6 +1757,7 @@ export declare type Options = {
1737
1757
  */
1738
1758
  title?: string;
1739
1759
 
1760
+
1740
1761
  /**
1741
1762
  * Custom function to spawn the Claude Code process.
1742
1763
  * Use this to run Claude Code in VMs, containers, or remote environments.
@@ -1917,6 +1938,13 @@ export declare type PostToolUseHookInput = BaseHookInput & {
1917
1938
  export declare type PostToolUseHookSpecificOutput = {
1918
1939
  hookEventName: 'PostToolUse';
1919
1940
  additionalContext?: string;
1941
+ /**
1942
+ * Replaces the tool output before it is sent to the model
1943
+ */
1944
+ updatedToolOutput?: unknown;
1945
+ /**
1946
+ * Replaces the output for MCP tools only. Prefer updatedToolOutput, which works for all tools
1947
+ */
1920
1948
  updatedMCPToolOutput?: unknown;
1921
1949
  };
1922
1950
 
@@ -2086,10 +2114,12 @@ export declare interface Query extends AsyncGenerator<SDKMessage, void> {
2086
2114
  * denial, missing file, or transport error.
2087
2115
  *
2088
2116
  * @param path - File path (relative to cwd or absolute)
2089
- * @param options - Optional maxBytes cap (default 1MB)
2117
+ * @param options - Optional maxBytes cap (default 1MB) and encoding
2118
+ * (default utf-8; pass 'base64' for binary files like images)
2090
2119
  */
2091
2120
  readFile(path: string, options?: {
2092
2121
  maxBytes?: number;
2122
+ encoding?: 'utf-8' | 'base64';
2093
2123
  }): Promise<SDKControlReadFileResponse | null>;
2094
2124
  /**
2095
2125
  * Reload plugins from disk and return the refreshed commands, agents,
@@ -2552,6 +2582,7 @@ declare type SDKControlInitializeRequest = {
2552
2582
  * When provided, only skills whose names match an entry are loaded into the main session system prompt, using the same rules as AgentDefinition.skills: exact name, plugin-qualified name, or ":name" suffix. Omit to load every discovered skill. Applies to the main session only; subagents use AgentDefinition.skills.
2553
2583
  */
2554
2584
  skills?: string[];
2585
+
2555
2586
  promptSuggestions?: boolean;
2556
2587
  agentProgressSummaries?: boolean;
2557
2588
  forwardSubagentText?: boolean;
@@ -2666,6 +2697,10 @@ declare type SDKControlReadFileRequest = {
2666
2697
  subtype: 'read_file';
2667
2698
  path: string;
2668
2699
  max_bytes?: number;
2700
+ /**
2701
+ * How to encode the bytes in `contents`. Defaults to utf-8 (lossy for binary); pass 'base64' to read images.
2702
+ */
2703
+ encoding?: 'utf-8' | 'base64';
2669
2704
  };
2670
2705
 
2671
2706
  /**
@@ -2675,6 +2710,10 @@ export declare type SDKControlReadFileResponse = {
2675
2710
  contents: string;
2676
2711
  absPath: string;
2677
2712
  truncated?: boolean;
2713
+ /**
2714
+ * Set when the request asked for base64. Absent means utf-8 — including when an older CLI ignored the request's encoding field.
2715
+ */
2716
+ encoding?: 'base64';
2678
2717
  };
2679
2718
 
2680
2719
  /**
@@ -4072,6 +4111,10 @@ export declare interface Settings {
4072
4111
  * Disable all hooks and statusLine execution
4073
4112
  */
4074
4113
  disableAllHooks?: boolean;
4114
+ /**
4115
+ * Disable the background-agents fleet (`claude agents`, `--bg`, /background, the on-demand daemon). Typically set in managed settings. Equivalent to CLAUDE_CODE_DISABLE_AGENTS_FLEET=1.
4116
+ */
4117
+ disableBackgroundAgents?: boolean;
4075
4118
  /**
4076
4119
  * Disable inline shell execution in skills and custom slash commands from user, project, or plugin sources. Commands are replaced with a placeholder instead of being run.
4077
4120
  */
@@ -5063,7 +5106,7 @@ export declare interface Settings {
5063
5106
  */
5064
5107
  remoteControlAtStartup?: boolean;
5065
5108
  /**
5066
- * When no background daemon is running: 'transient' spawns one for this login session; 'ask' offers to install a persistent service
5109
+ * When no background service is running: 'transient' spawns one for this login session; 'ask' offers to install it persistently
5067
5110
  */
5068
5111
  daemonColdStart?: 'transient' | 'ask';
5069
5112
  /**