@anthropic-ai/claude-agent-sdk 0.3.317 → 0.3.319
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/bridge.d.ts +9 -2
- package/bridge.mjs +82 -77
- package/browser-sdk.js +50 -50
- package/core-5fx2pfbt.mjs +18 -0
- package/core-actjkrgm.mjs +17 -0
- package/core-ed8v4zmx.mjs +45 -0
- package/core-ytn251z7.mjs +34 -0
- package/core.mjs +11 -11
- package/manifest.json +31 -22
- package/manifest.zst.json +35 -26
- package/package.json +14 -14
- package/sdk-tools.d.ts +2 -2
- package/sdk.d.ts +82 -22
- package/sdk.mjs +81 -78
- package/core-b5t19jrj.mjs +0 -33
- package/core-j104cwjy.mjs +0 -43
- package/core-kpjpwfwz.mjs +0 -18
- package/core-q7fanba0.mjs +0 -17
package/sdk.d.ts
CHANGED
|
@@ -304,7 +304,10 @@ export declare type CanUseTool = (toolName: string, input: Record<string, unknow
|
|
|
304
304
|
requestId: string;
|
|
305
305
|
/**
|
|
306
306
|
* Set when a user-configured ask RULE (permissions.ask) forced this
|
|
307
|
-
* prompt while the ask carries the tool's own decisionReason
|
|
307
|
+
* prompt while the ask carries the tool's own decisionReason, or when
|
|
308
|
+
* an ask rule reaches an MCP tool only under another name of its server
|
|
309
|
+
* (such as a connector's id or its claude.ai name), not the one given
|
|
310
|
+
* here. Hosts
|
|
308
311
|
* making policy on the reason (e.g. auto-deny a safetyCheck) or
|
|
309
312
|
* running host-side auto-approval should treat asks carrying this
|
|
310
313
|
* field as rule-forced: the user's stated intent is a human prompt.
|
|
@@ -689,7 +692,8 @@ export declare type CwdChangedHookSpecificOutput = {
|
|
|
689
692
|
};
|
|
690
693
|
|
|
691
694
|
/**
|
|
692
|
-
* Delete a session.
|
|
695
|
+
* Delete a session. Deletes data only on this computer, or only in
|
|
696
|
+
* `sessionStore` when one is passed, not anything stored by Anthropic.
|
|
693
697
|
*
|
|
694
698
|
* With `sessionStore`: calls `sessionStore.delete()` if implemented; no-op
|
|
695
699
|
* otherwise (per the SessionStore contract — appropriate for WORM/append-only
|
|
@@ -697,7 +701,9 @@ export declare type CwdChangedHookSpecificOutput = {
|
|
|
697
701
|
*
|
|
698
702
|
* Without `sessionStore`: removes `{sessionId}.jsonl` and the `{sessionId}/`
|
|
699
703
|
* subagent-transcript subdirectory from the local projects dir. Throws if the
|
|
700
|
-
* session is not found.
|
|
704
|
+
* session is not found. If the subdirectory cannot be removed, throws after
|
|
705
|
+
* the transcript is already deleted. A repeat call then throws "not found",
|
|
706
|
+
* so delete the subdirectory yourself.
|
|
701
707
|
*
|
|
702
708
|
* @param sessionId - UUID of the session
|
|
703
709
|
* @param options - `{ dir?, sessionStore? }`
|
|
@@ -2153,6 +2159,12 @@ export declare type Options = {
|
|
|
2153
2159
|
* on `task_progress` events via the `summary` field. The fork reuses the
|
|
2154
2160
|
* subagent's model and prompt cache, so cost is typically minimal.
|
|
2155
2161
|
*
|
|
2162
|
+
* Summaries are not a heartbeat. None is made while the conversation is
|
|
2163
|
+
* unchanged. A summary can also be delayed by up to 5 minutes while the
|
|
2164
|
+
* subagent is waiting for a model response and its prompt cache is likely cold
|
|
2165
|
+
* (no response yet, or none begun in the last 4.5 minutes). If the subagent
|
|
2166
|
+
* finishes first, that summary is not sent.
|
|
2167
|
+
*
|
|
2156
2168
|
* Applies to both foreground and background subagents. Defaults to false.
|
|
2157
2169
|
*/
|
|
2158
2170
|
agentProgressSummaries?: boolean;
|
|
@@ -4217,6 +4229,7 @@ export declare type SDKControlGetContextUsageResponse = {
|
|
|
4217
4229
|
cache_creation_input_tokens: number;
|
|
4218
4230
|
cache_read_input_tokens: number;
|
|
4219
4231
|
} | null;
|
|
4232
|
+
|
|
4220
4233
|
};
|
|
4221
4234
|
|
|
4222
4235
|
/**
|
|
@@ -4880,14 +4893,14 @@ declare type SDKControlInterruptRequest = {
|
|
|
4880
4893
|
*/
|
|
4881
4894
|
export declare type SDKControlInterruptResponse = {
|
|
4882
4895
|
/**
|
|
4883
|
-
* Uuids of async user messages that survive this interrupt: commands still in the queue, plus any batch already dequeued for the imminent turn but not yet reachable by the abort. An interrupt — plain or cancel_queued:true — that lands during the FIRST-command prewait window (before the first turn of the session has armed a controller) is additionally LATCHED, scoped to the user-intent work pending at that instant — the batch already dequeued and parked for the imminent turn, plus the user-intent main-thread commands then in the queue (the work this list enumerates): the first turn to arm that carries any of that doomed work starts already aborted, exactly once, so the listed prewait batch is delivered into an immediately-aborted turn, its frames and result flowing through the normal abort path, instead of running to completion. A turn carrying none of it arms live and leaves the latch waiting: a system delivery turn (for example a replayed host event), or a prompt enqueued after the interrupt — post-interrupt work is never coalesced with the doomed work and never dies to the latch, so the Stop kills exactly what this receipt listed. The latch is released when the doomed work is retired without arming: if a parked prewait batch is entirely cancelled, the latch is released even when other queued commands remain (those arm and run normally); with nothing parked, it is released once none of the doomed commands remains queued — work enqueued after the interrupt neither holds it up nor is aborted by it. Survivors that ride any later turn run normally. These WILL run (subject to that latch) unless cancelled first (or unless the request set cancel_queued:true, in which case every uuid-stamped survivor this process holds is removed, emitted a terminal `cancelled` synchronously, and listed under `cancelled` instead — leaving here only what a client driving a hosted session can no longer recall: a send already in flight to that session, or the first prompt the session was created with; a send that client still holds on its own machine behind a send gate (it waits there until that session is ready to take it) has not gone out, so it is withdrawn and listed under `cancelled` like a queued one, and cancel_async_message can withdraw it too, while a plain interrupt leaves it held and lists it here). Cancellation granularity: uuids still in the queue are individually cancellable via cancel_async_message (the re-run of an interrupted turn that also answers for other client messages only if this interrupt was for it; see the response to that request); once a batch is dequeued and coalesced into one turn, cancelling a NON-representative member uuid is a no-op (its content still runs), while cancelling the batch-representative uuid drops the WHOLE coalesced batch — in both cases the cancel response reports cancelled:false because the message was no longer in the queue. Coverage caveats: only uuid-STAMPED messages appear (a message enqueued without a uuid still runs but is never listed, so [] does not mean "nothing will run"); only main-thread messages are listed (subagent-addressed messages are out of scope); and the list may include internally-enqueued uuids the client never sent (cron triggers, auto-resume continuations) — ignore unknown uuids rather than treating them as an error. Ordering: on a clean interrupt this receipt is written before the interrupted turn result; a turn that crashes during interrupt handling emits its error result on a direct-write path that may precede the receipt. Snapshot is taken synchronously with abort processing — probing the queue after the interrupted result instead always loses the race against the drain loop, which starts the next queued turn immediately.
|
|
4896
|
+
* Uuids of async user messages that survive this interrupt: commands still in the queue, plus any batch already dequeued for the imminent turn but not yet reachable by the abort, plus any user message this process has read but not yet queued, from its own input stream (held, for instance, while a model change is still being checked or behind start-up work; a message a Remote Control client sent that is still being ingested is not listed). An interrupt — plain or cancel_queued:true — that lands during the FIRST-command prewait window (before the first turn of the session has armed a controller) is additionally LATCHED, scoped to the user-intent work pending at that instant — the batch already dequeued and parked for the imminent turn, plus the user-intent main-thread commands then in the queue or held ahead of it (the work this list enumerates): the first turn to arm that carries any of that doomed work starts already aborted, exactly once, so the listed prewait batch is delivered into an immediately-aborted turn, its frames and result flowing through the normal abort path, instead of running to completion. A turn carrying none of it arms live and leaves the latch waiting: a system delivery turn (for example a replayed host event), or a prompt enqueued after the interrupt — post-interrupt work is never coalesced with the doomed work and never dies to the latch, so the Stop kills exactly what this receipt listed. The latch is released when the doomed work is retired without arming: if a parked prewait batch is entirely cancelled, the latch is released even when other queued commands remain (those arm and run normally); with nothing parked, it is released once none of the doomed commands remains queued or held — work enqueued after the interrupt neither holds it up nor is aborted by it. Survivors that ride any later turn run normally. These WILL run (subject to that latch) unless cancelled first (or unless the request set cancel_queued:true, in which case every uuid-stamped survivor this process holds is removed, emitted a terminal `cancelled` synchronously, and listed under `cancelled` instead — leaving here only what a client driving a hosted session can no longer recall: a send already in flight to that session, or the first prompt the session was created with; a send that client still holds on its own machine behind a send gate (it waits there until that session is ready to take it) has not gone out, so it is withdrawn and listed under `cancelled` like a queued one, and cancel_async_message can withdraw it too, while a plain interrupt leaves it held and lists it here). Cancellation granularity: uuids still in the queue are individually cancellable via cancel_async_message (the re-run of an interrupted turn that also answers for other client messages only if this interrupt was for it; see the response to that request); a listed uuid whose message the process running the session (never a client driving a hosted session) still keeps out of its queue, behind a model change or start-up work, is not yet cancellable that way: cancel_async_message answers cancelled:false for it and plants a cancel-pending mark, which the drain honours once the message is queued and the mid-turn fold of a running turn does not; once a batch is dequeued and coalesced into one turn, cancelling a NON-representative member uuid is a no-op (its content still runs), while cancelling the batch-representative uuid drops the WHOLE coalesced batch — in both cases the cancel response reports cancelled:false because the message was no longer in the queue. Coverage caveats: only uuid-STAMPED messages appear (a message enqueued without a uuid still runs but is never listed, so [] does not mean "nothing will run"); only main-thread messages are listed (subagent-addressed messages are out of scope); and the list may include internally-enqueued uuids the client never sent (cron triggers, auto-resume continuations) — ignore unknown uuids rather than treating them as an error. Ordering: on a clean interrupt this receipt is written before the interrupted turn result; a turn that crashes during interrupt handling emits its error result on a direct-write path that may precede the receipt. Snapshot is taken synchronously with abort processing — probing the queue after the interrupted result instead always loses the race against the drain loop, which starts the next queued turn immediately.
|
|
4884
4897
|
*/
|
|
4885
4898
|
still_queued: string[];
|
|
4886
4899
|
|
|
4887
4900
|
|
|
4888
4901
|
|
|
4889
4902
|
/**
|
|
4890
|
-
* Present only when the request set cancel_queued:true — uuids of main-thread commands cancelled by this interrupt: every survivor that would otherwise have appeared under `still_queued`, including any uuid that was mid-fold at the interrupt instant (this request also aborts, so the fold never delivers it). Each listed uuid has been removed (queue-resident) or marked cancel-pending (the first-command prewait window, closed by the drain loop's backstop) and emits a terminal 'cancelled' lifecycle synchronously at the first such interrupt (a repeat interrupt over the same parked batch re-lists the uuid idempotently without re-emitting); none will run. Where one of them is the re-run of an interrupted turn that also answered for other client messages whose re-sent copies had been set aside for it, those messages' uuids are listed behind the commands' too: they were in no queue and never under `still_queued`, each has its terminal 'cancelled' lifecycle, and a repeat interrupt does not list them again. Same coverage caveats as `still_queued` (uuid-stamped main-thread only; internally-enqueued uuids may appear). Advertised by the `interrupt_cancel_queued_v1` capability.
|
|
4903
|
+
* Present only when the request set cancel_queued:true — uuids of main-thread commands cancelled by this interrupt: every survivor that would otherwise have appeared under `still_queued`, including any uuid that was mid-fold at the interrupt instant (this request also aborts, so the fold never delivers it). Each listed uuid has been removed (queue-resident), dropped before it was queued (a message this process had read and was still holding), or marked cancel-pending (the first-command prewait window, closed by the drain loop's backstop) and emits a terminal 'cancelled' lifecycle synchronously at the first such interrupt (a repeat interrupt over the same parked batch re-lists the uuid idempotently without re-emitting); none will run. Where one of them is the re-run of an interrupted turn that also answered for other client messages whose re-sent copies had been set aside for it, those messages' uuids are listed behind the commands' too: they were in no queue and never under `still_queued`, each has its terminal 'cancelled' lifecycle, and a repeat interrupt does not list them again. Same coverage caveats as `still_queued` (uuid-stamped main-thread only; internally-enqueued uuids may appear). Advertised by the `interrupt_cancel_queued_v1` capability.
|
|
4891
4904
|
*/
|
|
4892
4905
|
cancelled?: string[];
|
|
4893
4906
|
};
|
|
@@ -4917,7 +4930,7 @@ export declare type SDKControlListPermissionRulesResponse = {
|
|
|
4917
4930
|
};
|
|
4918
4931
|
|
|
4919
4932
|
/**
|
|
4920
|
-
* Invokes an MCP tool via the subprocess MCP client without a model turn. No permission check (control channel is trusted, same as other subtypes). SDK-type MCP servers (config.type === "sdk") are rejected — they are caller-provided, so the caller can invoke them directly without the subprocess round-trip. Result content passes through the same processing as model-turn MCP calls, unless result_not_for_model is set. Session expiry is not retried automatically; callers can mcp_reconnect and retry. UrlElicitationRequired (-32042) tries Elicitation hooks; if no hook resolves, the call errors with the URL in the message — open it out-of-band, then retry mcp_call. STAGED calls (input_files/output_files declared) additionally stage lane rows in/out around the call — see the input_files describe. Staged failures come back as a success-subtype response whose staging field carries a typed error_code; subtype:error is emitted only when the call could not be attempted at all (server not connected, kill switch, dispatch failure) and means nothing ran. A target server that is not yet connected is brought up on demand: dispatch runs the deferred plugin/MCP startup resolution (the work a first model turn would have done) and waits up to 30s — shortened by expires_at when that is sooner — for the server to connect before answering "MCP server not connected", so a dispatch that races plugin startup (e.g. after an idle-wake reattach) succeeds instead of failing until a turn runs. Standard RPC semantics: a redelivered request_id supersedes the in-flight run (it is aborted and its response suppressed — exactly one response per request_id); conversion is idempotent, so re-running is safe. Cancellable via control_cancel_request.
|
|
4933
|
+
* Invokes an MCP tool via the subprocess MCP client without a model turn. No permission check (control channel is trusted, same as other subtypes) unless check_permissions is set. SDK-type MCP servers (config.type === "sdk") are rejected — they are caller-provided, so the caller can invoke them directly without the subprocess round-trip. Result content passes through the same processing as model-turn MCP calls, unless result_not_for_model is set. Session expiry is not retried automatically; callers can mcp_reconnect and retry. UrlElicitationRequired (-32042) tries Elicitation hooks; if no hook resolves, the call errors with the URL in the message — open it out-of-band, then retry mcp_call. STAGED calls (input_files/output_files declared) additionally stage lane rows in/out around the call — see the input_files describe. Staged failures come back as a success-subtype response whose staging field carries a typed error_code; subtype:error is emitted only when the call could not be attempted at all (server not connected, kill switch, dispatch failure) and means nothing ran. A target server that is not yet connected is brought up on demand: dispatch runs the deferred plugin/MCP startup resolution (the work a first model turn would have done) and waits up to 30s — shortened by expires_at when that is sooner — for the server to connect before answering "MCP server not connected", so a dispatch that races plugin startup (e.g. after an idle-wake reattach) succeeds instead of failing until a turn runs. Standard RPC semantics: a redelivered request_id supersedes the in-flight run (it is aborted and its response suppressed — exactly one response per request_id); conversion is idempotent, so re-running is safe. Cancellable via control_cancel_request.
|
|
4921
4934
|
*/
|
|
4922
4935
|
declare type SDKControlMcpCallRequest = {
|
|
4923
4936
|
subtype: 'mcp_call';
|
|
@@ -4934,13 +4947,17 @@ declare type SDKControlMcpCallRequest = {
|
|
|
4934
4947
|
*/
|
|
4935
4948
|
expires_at?: string;
|
|
4936
4949
|
/**
|
|
4937
|
-
* Tool-execution timeout (staging and collection have their own transport timeouts). Clamped to [1000, 600000]; default 120000. Sending timeout_ms routes the call through the staging engine — so it is always enforced when present and the response carries a staging result; omit it for a plain call. Staged calls are POSIX-worker-only: on a Windows worker any staged-field call fails with a typed staging refusal.
|
|
4950
|
+
* Tool-execution timeout (staging and collection have their own transport timeouts); with check_permissions it also bounds hooks and the wait for an answer. Clamped to [1000, 600000]; default 120000. Sending timeout_ms routes the call through the staging engine — so it is always enforced when present and the response carries a staging result; omit it for a plain call. Staged calls are POSIX-worker-only: on a Windows worker any staged-field call fails with a typed staging refusal.
|
|
4938
4951
|
*/
|
|
4939
4952
|
timeout_ms?: number;
|
|
4940
4953
|
/**
|
|
4941
4954
|
* The caller hands the result to a program (a host that renders it, a script), not to a model, and bounds it itself. content is then the server's own content blocks as MCP defines them (the MCP SDK drops members it does not define), not what a model turn would be handed: no image is resized or put in the Messages API's shape, nothing is saved under tool-results, no embedded resource is flattened, and text blocks beside structuredContent stay. They are untrusted third-party data: any mimeType, images neither re-encoded nor bounded in pixels, each block's annotations and _meta unfiltered. The size check that protects a model's context is skipped too: no count_tokens request (which uploads the result), no truncation, no note in place of the content. Instead a result over 10485760 characters (content with its base64, structuredContent and _meta together) fails though the tool ran: a plain call answers the error subtype, a staged call staging.error_code tool_error with the text in detail, before its outputs are collected. A legacy toolResult still comes back as a string. Does not route the call through the staging engine. Absent or false: as before. Honoured only for a host on this process's own pipes, not over a remote transport nor on a lane that redacts what it persists. Feature-detected as `mcp_call_result_not_for_model_v1` in system/init.capabilities and in the initialize response's capabilities; where it is not said, and by a CLI without it, the member is ignored.
|
|
4942
4955
|
*/
|
|
4943
4956
|
result_not_for_model?: boolean;
|
|
4957
|
+
/**
|
|
4958
|
+
* The call is someone else's (a page a host renders), so it is decided as the model's own call to this tool is: permission rules under every spelling, the permission mode, requiresUserInteraction, managed settings, and PreToolUse and PostToolUse hooks, which see the arguments and the result. An ask reaches the host as a can_use_tool control request; where no host can answer, and in dontAsk or plan mode, it is refused. A refused call never reaches the server: on a plain call the error subtype, on a staged call staging error_code=tool_error, each with text starting 'The tool did not run: '. The other refusals of mcp_call come first and keep their own words. A PostToolUse hook's rewrite replaces content and drops structuredContent and _meta. The result stays out of the model's context. Only a CLI that says mcp_call_check_permissions_v1 honours this member: an older one ignores it and runs the tool with no check. Honoured only on the pipes of the host that spawned the process; elsewhere the call is refused. A value that is not a boolean is refused.
|
|
4959
|
+
*/
|
|
4960
|
+
check_permissions?: boolean;
|
|
4944
4961
|
/**
|
|
4945
4962
|
* Declaring input_files or output_files makes this a STAGED call: rows are fetched from the synced-file lane into a private per-request temp dir the WORKER chooses (random, per-UID — the caller never sees or computes paths; it references files via tokens in arguments), the tool runs, and declared outputs are written back as lane rows (durable-at-ack PUT). The response then carries a `staging` result the caller switches on.
|
|
4946
4963
|
*/
|
|
@@ -5010,7 +5027,7 @@ export declare type SDKControlMcpReadResourceResponse = {
|
|
|
5010
5027
|
*/
|
|
5011
5028
|
blob?: string;
|
|
5012
5029
|
/**
|
|
5013
|
-
* The content item's own `_meta` as the server sent it (MCP Apps puts the resource's `ui.csp` and `ui.permissions` here), minus keys under the CLI-reserved `com.anthropic/` prefix.
|
|
5030
|
+
* The content item's own `_meta` as the server sent it (MCP Apps puts the resource's `ui.csp` and `ui.permissions` here), minus keys under the CLI-reserved `com.anthropic/` prefix and `io.modelcontextprotocol/files` download targets: from a claude.ai connector, one that holds the download service's one-time token (every such target while connector downloads or their removal are on); from a server on a cloud session's MCP route, every such target.
|
|
5014
5031
|
*/
|
|
5015
5032
|
_meta?: Record<string, unknown>;
|
|
5016
5033
|
}[];
|
|
@@ -5092,7 +5109,7 @@ declare type SDKControlPermissionRequest = {
|
|
|
5092
5109
|
*/
|
|
5093
5110
|
default_to_no?: boolean;
|
|
5094
5111
|
/**
|
|
5095
|
-
* Set when a user-configured ask RULE (permissions.ask) forced this prompt but the ask carries the tool's own decision_reason — the ask-rule substitution keeps the richer tool-minted ask, so the rule rides here instead of decision_reason_type 'rule'. Hosts making policy on decision_reason_type (e.g. auto-deny safetyCheck) or running host-side auto-approval should treat asks carrying this field as rule-forced: the user's stated intent is a human prompt. Values are producer-authored but render-unsafe like decision_reason; sanitize before display.
|
|
5112
|
+
* Set when a user-configured ask RULE (permissions.ask) forced this prompt but the ask carries the tool's own decision_reason — the ask-rule substitution keeps the richer tool-minted ask, so the rule rides here instead of decision_reason_type 'rule'. May also be set, whatever the decision_reason, when an ask rule reaches an MCP tool only under another name of its server (such as a connector's id or its claude.ai name), not under the name in tool_name: a host that looks for the rule by that name does not find it. Hosts making policy on decision_reason_type (e.g. auto-deny safetyCheck) or running host-side auto-approval should treat asks carrying this field as rule-forced: the user's stated intent is a human prompt. Values are producer-authored but render-unsafe like decision_reason; sanitize before display.
|
|
5096
5113
|
*/
|
|
5097
5114
|
matched_ask_rule?: {
|
|
5098
5115
|
source: string;
|
|
@@ -5106,7 +5123,7 @@ declare type SDKControlPermissionRequest = {
|
|
|
5106
5123
|
|
|
5107
5124
|
description?: string;
|
|
5108
5125
|
/**
|
|
5109
|
-
* True when one-tap Approve/Deny must not be offered: the tool's approval card IS the user-interaction surface (Tool.requiresUserInteraction(): the user responds on the card itself), OR the pending ask is localDisplayOnly (its consent disclosure cannot ride this wire and only the local dialog renders it), OR the auto-mode classifier blocked the call and it was handed to a person (decision_reason_type 'classifier' on a person-only ask), which no stored grant or automatic approval may answer, OR the MCP server's name spells a claude.ai connector's key and the server came from neither claude.ai nor whoever launched the session,
|
|
5126
|
+
* True when one-tap Approve/Deny must not be offered: the tool's approval card IS the user-interaction surface (Tool.requiresUserInteraction(): the user responds on the card itself), OR the pending ask is localDisplayOnly (its consent disclosure cannot ride this wire and only the local dialog renders it), OR the auto-mode classifier blocked the call and it was handed to a person (decision_reason_type 'classifier' on a person-only ask), which no stored grant or automatic approval may answer, OR a grant keyed on the tool name must not answer it: the MCP server's name spells a claude.ai connector's key and the server came from neither claude.ai nor whoever launched the session, or, while Claude Code enforces grants, two tools of the server get that name, OR the SDK host worded the ask (title and description are its consent copy, which a push cannot carry whole), OR the ask stands in for the classifier's verdict on a call to Claude Desktop's Cowork shell, which no stored grant or automatic approval may answer. In each case the user has to open the session to answer.
|
|
5110
5127
|
*/
|
|
5111
5128
|
requires_user_interaction?: boolean;
|
|
5112
5129
|
|
|
@@ -5268,6 +5285,7 @@ declare type SDKControlRenameSessionRequest = {
|
|
|
5268
5285
|
* The session the title is for. When given and this process has since moved to another session (/clear, an in-session resume), the request is refused instead of naming the new session.
|
|
5269
5286
|
*/
|
|
5270
5287
|
session_id?: string;
|
|
5288
|
+
|
|
5271
5289
|
};
|
|
5272
5290
|
|
|
5273
5291
|
/**
|
|
@@ -5284,7 +5302,7 @@ export declare type SDKControlRequest = {
|
|
|
5284
5302
|
|
|
5285
5303
|
};
|
|
5286
5304
|
|
|
5287
|
-
declare type SDKControlRequestInner = SDKControlInterruptRequest | SDKControlPermissionRequest | SDKControlInitializeRequest | SDKControlSetPermissionModeRequest | SDKControlSetModelRequest | SDKControlSetMaxThinkingTokensRequest | SDKControlRenameSessionRequest | SDKControlSetColorRequest | SDKControlMcpStatusRequest | SDKControlGetContextUsageRequest | SDKControlGetSessionCostRequest | SDKControlListModelsRequest | SDKControlGetUsageRequest | SDKControlGetBinaryVersionRequest | SDKControlMcpCallRequest | SDKControlFileSuggestionsRequest | SDKHookCallbackRequest | SDKControlMcpMessageRequest | SDKControlRewindFilesRequest | SDKControlCancelAsyncMessageRequest | SDKControlReadFileRequest | SDKControlSeedReadStateRequest | SDKControlMcpSetServersRequest | SDKControlRegisterRepoRootRequest | SDKControlReloadPluginsRequest | SDKControlReloadSkillsRequest | SDKControlReloadOutputStylesRequest | SDKControlMcpReconnectRequest | SDKControlMcpToggleRequest | SDKControlStopTaskRequest | SDKControlBackgroundTasksRequest | SDKControlGetTaskOutputRequest | SDKControlApplyFlagSettingsRequest | SDKControlGetSettingsRequest | SDKControlGetHooksListingRequest | SDKControlUpdateSettingsRequest | SDKControlElicitationRequest | SDKControlRequestUserDialogRequest | SDKControlListPermissionRulesRequest | SDKControlMcpReadResourceRequest;
|
|
5305
|
+
declare type SDKControlRequestInner = SDKControlInterruptRequest | SDKControlPermissionRequest | SDKControlInitializeRequest | SDKControlSetPermissionModeRequest | SDKControlSetModelRequest | SDKControlSetMaxThinkingTokensRequest | SDKControlRenameSessionRequest | SDKControlSetColorRequest | SDKControlMcpStatusRequest | SDKControlGetContextUsageRequest | SDKControlGetSessionCostRequest | SDKControlListModelsRequest | SDKControlGetUsageRequest | SDKControlGetBinaryVersionRequest | SDKControlMcpCallRequest | SDKControlFileSuggestionsRequest | SDKHookCallbackRequest | SDKControlMcpMessageRequest | SDKControlRewindFilesRequest | SDKControlCancelAsyncMessageRequest | SDKControlReadFileRequest | SDKControlSeedReadStateRequest | SDKControlMcpSetServersRequest | SDKControlRegisterRepoRootRequest | SDKControlReloadPluginsRequest | SDKControlReloadSkillsRequest | SDKControlReloadOutputStylesRequest | SDKControlMcpReconnectRequest | SDKControlMcpToggleRequest | SDKControlSetHasSubscribersRequest | SDKControlStopTaskRequest | SDKControlBackgroundTasksRequest | SDKControlGetTaskOutputRequest | SDKControlApplyFlagSettingsRequest | SDKControlGetSettingsRequest | SDKControlGetHooksListingRequest | SDKControlUpdateSettingsRequest | SDKControlElicitationRequest | SDKControlRequestUserDialogRequest | SDKControlListPermissionRulesRequest | SDKControlMcpReadResourceRequest;
|
|
5288
5306
|
|
|
5289
5307
|
/**
|
|
5290
5308
|
* Progress for a long-running client-originated control_request (currently only side_question), correlated by request_id. status 'started' means the worker accepted the request and launched the work; 'api_retry' carries the same retry counters as SDKAPIRetryMessage and is present only for that status.
|
|
@@ -5358,6 +5376,17 @@ declare type SDKControlSetColorRequest = {
|
|
|
5358
5376
|
color: string;
|
|
5359
5377
|
};
|
|
5360
5378
|
|
|
5379
|
+
/**
|
|
5380
|
+
* Tells the CLI whether anybody is watching the output that the host reads from stream-json stdout and passes on. It matters only in a CLI started with CLAUDE_CODE_STREAM_EVENT_HOLD_MS, which holds most content_block_delta and thinking_tokens lines on stdout to join them, and with CLAUDE_CODE_STREAM_EVENT_NO_SUBSCRIBER_HOLD_MS: after false, each new wait of that hold lasts the second variable's time, if longer; after true or null, the first variable's time again. No line is dropped. The reply is an empty success, also where nothing changes, and like any other line it comes after the lines held so far, so each request ends the wait that is running: send one only when the answer changes, not after each message from your server. A new CLI process starts as watched, so send the answer again to each new process. An older CLI answers with the unsupported-subtype error, and a CLI that drives a cloud-hosted session refuses the request.
|
|
5381
|
+
*/
|
|
5382
|
+
declare type SDKControlSetHasSubscribersRequest = {
|
|
5383
|
+
subtype: 'set_has_subscribers';
|
|
5384
|
+
/**
|
|
5385
|
+
* false: nobody watches now. true: somebody does. null: the host does not know, which counts as true.
|
|
5386
|
+
*/
|
|
5387
|
+
has_subscribers: boolean | null;
|
|
5388
|
+
};
|
|
5389
|
+
|
|
5361
5390
|
/**
|
|
5362
5391
|
* Sets the maximum number of thinking tokens for extended thinking. When max_thinking_tokens is null, thinking resets to the session default: any mid-session budget override is cleared (back to the spawn-time budget, if one was set), and thinking stays off for sessions that have it disabled. When max_thinking_tokens is omitted, the budget is left as it is, so a request that only changes thinking_display can leave the field out. thinking_display optionally sets the thinking display mode for the rest of the session: a value replaces the session display mode, null clears that override so Claude Code's default display handling applies again, and when omitted the display mode from session start (--thinking-display) is kept. 'highlights' returns one short title per stretch of thinking instead of a prose summary. The API accepts it only from Claude Code sessions that Anthropic hosts; if the API rejects it, the session sends 'omitted' (no thinking text) in its place from then on. A request for 'highlights' gets an error reply after such a rejection, when experimental betas are off (CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS or organization policy), on a Claude 3 model (except on Microsoft Foundry), or on Amazon Bedrock (Mantle included), Google Vertex AI or a Claude apps gateway (API provider "gateway") with a model released before Claude Opus 4.7. The error names which of these it was; the display stays as it was, and max_thinking_tokens still applies when the request has it.
|
|
5363
5392
|
*/
|
|
@@ -5665,7 +5694,7 @@ export declare type SDKMessageOrigin = {
|
|
|
5665
5694
|
*/
|
|
5666
5695
|
senderTaskId?: string;
|
|
5667
5696
|
/**
|
|
5668
|
-
* Decoded message body with the peer envelope stripped — byte-exact with what the model sees. Present only when the turn is exactly one harness-formed envelope (or an in-process agent message); render this instead of re-parsing the message text.
|
|
5697
|
+
* Decoded message body with the peer envelope stripped — byte-exact with what the model sees. Present only when the turn is exactly one harness-formed envelope (or an in-process agent message), or when Claude Desktop declares it and the message text holds those exact bytes; render this instead of re-parsing the message text.
|
|
5669
5698
|
*/
|
|
5670
5699
|
body?: string;
|
|
5671
5700
|
/**
|
|
@@ -5978,6 +6007,7 @@ export declare type SDKRateLimitInfo = {
|
|
|
5978
6007
|
|
|
5979
6008
|
|
|
5980
6009
|
|
|
6010
|
+
|
|
5981
6011
|
/**
|
|
5982
6012
|
* Which spend limit blocked the request when it is not the member's own cap: 'group_pool' means a pooled group budget shared by the member's team is used up (the denial otherwise looks like the member's own monthly cap). Absent on a plain member denial and from older CLIs.
|
|
5983
6013
|
*/
|
|
@@ -6020,7 +6050,7 @@ export declare type SDKResultError = {
|
|
|
6020
6050
|
errors: string[];
|
|
6021
6051
|
|
|
6022
6052
|
/**
|
|
6023
|
-
* Set on the zeroed error_during_execution result a stream-json run writes before exiting on a known startup failure; errors carries the failure message. Failures that otherwise end with stderr alone write that result only when the host sets CLAUDE_CODE_STARTUP_FAILURE_RESULTS. Absent on every other result, on startup failures without a known cause, and from older producers.
|
|
6053
|
+
* Set on the zeroed error_during_execution result a stream-json run writes before exiting on a known startup failure; errors carries the failure message. Failures that otherwise end with stderr alone write that result only when the host sets CLAUDE_CODE_STARTUP_FAILURE_RESULTS, except org_config_required_unavailable, org_config_refused and config_file_invalid, which every stream-json run writes. Absent on every other result, on startup failures without a known cause, and from older producers.
|
|
6024
6054
|
*/
|
|
6025
6055
|
startup_failure_reason?: SDKStartupFailureReason;
|
|
6026
6056
|
/**
|
|
@@ -6040,10 +6070,15 @@ export declare type SDKResultError = {
|
|
|
6040
6070
|
|
|
6041
6071
|
terminal_reason?: TerminalReason;
|
|
6042
6072
|
|
|
6073
|
+
|
|
6043
6074
|
/**
|
|
6044
6075
|
* Delivery sequence of this result within the run: how many results the run numbered before this one, starting at 0, in the order the process writes them. A result held back while background work finishes is numbered when it is finally written, not when its text was produced; a result whose write fails still consumes its number, so a gap in a stream-json sequence means a result was lost. Distinct from num_turns, which counts model round-trips within one turn. Numbered by the process that hosts the run (`claude -p`, stream-json): a local client relaying a cloud session passes the cloud session's numbering through and its own locally built error results carry none; the in-process engine surface does not number yet. Absent from older producers.
|
|
6045
6076
|
*/
|
|
6046
6077
|
result_index?: number;
|
|
6078
|
+
/**
|
|
6079
|
+
* When the claude.ai credential this process's requests send ends for good, as an ISO 8601 instant, read as the result is written. For a stored claude.ai login it is the end of the login's refresh chain as stored at sign-in, which renewing the access token does not move. That date is the server's when it sent one and otherwise a 30-day estimate, and the real end can be up to 3 days earlier. The server is not asked, so a login revoked early still shows its date, and a date in the past means the login has probably ended, not that it has. Absent when no date is known, for every other credential (an API key, a token from the environment, another provider), on results this process did not number, and from older producers.
|
|
6080
|
+
*/
|
|
6081
|
+
credential_expires_at?: string;
|
|
6047
6082
|
fast_mode_state?: FastModeState;
|
|
6048
6083
|
fast_mode_disabled_reason?: FastModeDisabledReason;
|
|
6049
6084
|
origin?: SDKMessageOrigin;
|
|
@@ -6092,6 +6127,7 @@ export declare type SDKResultSuccess = {
|
|
|
6092
6127
|
|
|
6093
6128
|
|
|
6094
6129
|
|
|
6130
|
+
|
|
6095
6131
|
|
|
6096
6132
|
|
|
6097
6133
|
user_message_uuid?: string;
|
|
@@ -6159,10 +6195,15 @@ export declare type SDKResultSuccess = {
|
|
|
6159
6195
|
deferred_tool_use?: SDKDeferredToolUse;
|
|
6160
6196
|
terminal_reason?: TerminalReason;
|
|
6161
6197
|
|
|
6198
|
+
|
|
6162
6199
|
/**
|
|
6163
6200
|
* Delivery sequence of this result within the run: how many results the run numbered before this one, starting at 0, in the order the process writes them. A result held back while background work finishes is numbered when it is finally written, not when its text was produced; a result whose write fails still consumes its number, so a gap in a stream-json sequence means a result was lost. Distinct from num_turns, which counts model round-trips within one turn. Numbered by the process that hosts the run (`claude -p`, stream-json): a local client relaying a cloud session passes the cloud session's numbering through and its own locally built error results carry none; the in-process engine surface does not number yet. Absent from older producers.
|
|
6164
6201
|
*/
|
|
6165
6202
|
result_index?: number;
|
|
6203
|
+
/**
|
|
6204
|
+
* When the claude.ai credential this process's requests send ends for good, as an ISO 8601 instant, read as the result is written. For a stored claude.ai login it is the end of the login's refresh chain as stored at sign-in, which renewing the access token does not move. That date is the server's when it sent one and otherwise a 30-day estimate, and the real end can be up to 3 days earlier. The server is not asked, so a login revoked early still shows its date, and a date in the past means the login has probably ended, not that it has. Absent when no date is known, for every other credential (an API key, a token from the environment, another provider), on results this process did not number, and from older producers.
|
|
6205
|
+
*/
|
|
6206
|
+
credential_expires_at?: string;
|
|
6166
6207
|
fast_mode_state?: FastModeState;
|
|
6167
6208
|
fast_mode_disabled_reason?: FastModeDisabledReason;
|
|
6168
6209
|
origin?: SDKMessageOrigin;
|
|
@@ -6228,7 +6269,7 @@ export declare type SDKSessionStateChangedMessage = {
|
|
|
6228
6269
|
};
|
|
6229
6270
|
|
|
6230
6271
|
/**
|
|
6231
|
-
* The CLI could not save lines of a session transcript, changes to ~/.claude.json, or both, because the disk was full or its quota was used up. Sent at most once, as the CLI exits, after the last result if there was one. The results already received stand, and this message does not change the exit status. As on every message, session_id is the session the CLI is in; transcript_session_ids says whose transcript lost lines. Sent only with stream-json output on stdout, never under --sdk-url or a Claude Desktop entrypoint. Safe to ignore.
|
|
6272
|
+
* The CLI could not save lines of a session transcript, changes to ~/.claude.json, or both, because the disk was full or its quota was used up. Sent at most once, as the CLI exits with status 0, after the last result if there was one. A run that exits 1, as after an error result, gets only the line on stderr; CLI 2.1.317 and some later releases sent this message there too. The results already received stand, and this message does not change the exit status. As on every message, session_id is the session the CLI is in; transcript_session_ids says whose transcript lost lines. Sent only with stream-json output on stdout, never under --sdk-url or a Claude Desktop entrypoint. Safe to ignore.
|
|
6232
6273
|
*/
|
|
6233
6274
|
export declare type SDKSessionWritesLostMessage = {
|
|
6234
6275
|
type: 'system';
|
|
@@ -6268,9 +6309,9 @@ export declare type SDKSettingsParseError = {
|
|
|
6268
6309
|
};
|
|
6269
6310
|
|
|
6270
6311
|
/**
|
|
6271
|
-
* Why Claude Code refused to start, so a host can offer the fix instead of a retry. org_pin_api_key_conflict: managed settings pin a first-party or Cloud gateway sign-in, and an Anthropic API key or auth token is configured instead. provider_not_allowed: managed settings list the API providers this machine may use (allowedProviders), and the session is set up for one that is not listed. org_verify_failed: the sign-in's organization could not be verified against the pin (network, or a revoked token). org_pin_mismatch: the sign-in belongs to an organization the pin does not allow. managed_settings_invalid: managed policy settings could not be read, the pin names no organization, or managed model settings (deniedModels, or an availableModels list matched exactly) block the default model and leave no allowed model to use instead. remote_settings_required_unavailable: managed settings the organization requires could not be loaded. gateway_signin_required: the Cloud gateway ended this sign-in. gateway_access_denied: the Cloud gateway refused managed settings for this account. proxy_invalid: a proxy setting is not a complete URL. temp_dir_unusable: the per-user temp directory is unsafe or could not be created. cwd_unavailable: the working directory was deleted, moved or cannot be read. shell_tool_missing: Windows has no shell tool: Git Bash is missing, and PowerShell is missing or turned off by CLAUDE_CODE_USE_POWERSHELL_TOOL. session_held_by_background: the conversation to resume or continue is running as a background session. worktree_resume_refused: the resume was refused because the session's worktree failed its safety checks or the resume was launched from inside it; errors says whether a re-run continues without the worktree. worktree_unverified: the session's worktree could not be verified right now; retrying may succeed. cli_version_too_old: this Claude Code version is below the minimum Anthropic requires. bypass_root: bypass permissions mode was requested while running as root. org_config_required_unavailable: the organization requires its policy limits and managed settings before a session starts, and they could not be loaded (network, proxy, or an Anthropic error); retrying may succeed. org_config_refused: the organization requires its policy limits and managed settings, and Anthropic refused them for this sign-in (expired or revoked session, or the organization does not allow Claude Code for this account); signing in again or an admin's change is the fix, not a retry. sandbox_required_unavailable: a working sandbox is required and it cannot run in this session, for example because bubblewrap is missing or the platform is not supported; make the sandbox available or have the requirement changed. initialize_not_first: Claude Code was started with --await-initialize, and its first stdin line was not the initialize control request (another message, or not valid JSON). Either the host wrote something else first, or a wrapper script between the host and Claude Code read or changed that line; the fix is in the host or the wrapper script, not a retry.
|
|
6312
|
+
* Why Claude Code refused to start, so a host can offer the fix instead of a retry. org_pin_api_key_conflict: managed settings pin a first-party or Cloud gateway sign-in, and an Anthropic API key or auth token is configured instead. provider_not_allowed: managed settings list the API providers this machine may use (allowedProviders), and the session is set up for one that is not listed. org_verify_failed: the sign-in's organization could not be verified against the pin (network, or a revoked token). org_pin_mismatch: the sign-in belongs to an organization the pin does not allow. managed_settings_invalid: managed policy settings could not be read, the pin names no organization, or managed model settings (deniedModels, or an availableModels list matched exactly) block the default model and leave no allowed model to use instead. remote_settings_required_unavailable: managed settings the organization requires could not be loaded. gateway_signin_required: the Cloud gateway ended this sign-in. gateway_access_denied: the Cloud gateway refused managed settings for this account. proxy_invalid: a proxy setting is not a complete URL. temp_dir_unusable: the per-user temp directory is unsafe or could not be created. cwd_unavailable: the working directory was deleted, moved or cannot be read. shell_tool_missing: Windows has no shell tool: Git Bash is missing, and PowerShell is missing or turned off by CLAUDE_CODE_USE_POWERSHELL_TOOL. session_held_by_background: the conversation to resume or continue is running as a background session. worktree_resume_refused: the resume was refused because the session's worktree failed its safety checks or the resume was launched from inside it; errors says whether a re-run continues without the worktree. worktree_unverified: the session's worktree could not be verified right now; retrying may succeed. cli_version_too_old: this Claude Code version is below the minimum Anthropic requires. bypass_root: bypass permissions mode was requested while running as root. org_config_required_unavailable: the organization requires its policy limits and managed settings before a session starts, and they could not be loaded (network, proxy, or an Anthropic error); retrying may succeed. org_config_refused: the organization requires its policy limits and managed settings, and Anthropic refused them for this sign-in (expired or revoked session, or the organization does not allow Claude Code for this account); signing in again or an admin's change is the fix, not a retry. sandbox_required_unavailable: a working sandbox is required and it cannot run in this session, for example because bubblewrap is missing or the platform is not supported; make the sandbox available or have the requirement changed. initialize_not_first: Claude Code was started with --await-initialize, and its first stdin line was not the initialize control request (another message, or not valid JSON). Either the host wrote something else first, or a wrapper script between the host and Claude Code read or changed that line; the fix is in the host or the wrapper script, not a retry. config_file_invalid: a configuration file read at start-up is not valid JSON; errors names the file and, for the global configuration file, how to restore or repair it. The file is left unchanged, and every start without a terminal is refused until it is repaired, so a retry alone does not help.
|
|
6272
6313
|
*/
|
|
6273
|
-
export declare type SDKStartupFailureReason = 'org_pin_api_key_conflict' | 'provider_not_allowed' | 'org_verify_failed' | 'org_pin_mismatch' | 'managed_settings_invalid' | 'remote_settings_required_unavailable' | 'gateway_signin_required' | 'gateway_access_denied' | 'proxy_invalid' | 'temp_dir_unusable' | 'cwd_unavailable' | 'shell_tool_missing' | 'session_held_by_background' | 'worktree_resume_refused' | 'worktree_unverified' | 'cli_version_too_old' | 'bypass_root' | 'org_config_required_unavailable' | 'org_config_refused' | 'sandbox_required_unavailable' | 'initialize_not_first';
|
|
6314
|
+
export declare type SDKStartupFailureReason = 'org_pin_api_key_conflict' | 'provider_not_allowed' | 'org_verify_failed' | 'org_pin_mismatch' | 'managed_settings_invalid' | 'remote_settings_required_unavailable' | 'gateway_signin_required' | 'gateway_access_denied' | 'proxy_invalid' | 'temp_dir_unusable' | 'cwd_unavailable' | 'shell_tool_missing' | 'session_held_by_background' | 'worktree_resume_refused' | 'worktree_unverified' | 'cli_version_too_old' | 'bypass_root' | 'org_config_required_unavailable' | 'org_config_refused' | 'sandbox_required_unavailable' | 'initialize_not_first' | 'config_file_invalid';
|
|
6274
6315
|
|
|
6275
6316
|
export declare type SDKStatus = 'compacting' | 'requesting' | null;
|
|
6276
6317
|
|
|
@@ -6284,6 +6325,7 @@ export declare type SDKStatusMessage = {
|
|
|
6284
6325
|
|
|
6285
6326
|
|
|
6286
6327
|
|
|
6328
|
+
|
|
6287
6329
|
uuid: UUID;
|
|
6288
6330
|
session_id: string;
|
|
6289
6331
|
};
|
|
@@ -6410,6 +6452,9 @@ export declare type SDKTaskNotificationMessage = {
|
|
|
6410
6452
|
resource_links?: SDKMcpResourceLink[];
|
|
6411
6453
|
|
|
6412
6454
|
|
|
6455
|
+
|
|
6456
|
+
|
|
6457
|
+
|
|
6413
6458
|
skip_transcript?: boolean;
|
|
6414
6459
|
/**
|
|
6415
6460
|
* True for tasks that are not activity (every skip_transcript task, plus every live-update watcher, requested or auto-started); hosts should exclude them from activity indicators.
|
|
@@ -6444,6 +6489,7 @@ export declare type SDKTaskProgressMessage = {
|
|
|
6444
6489
|
*/
|
|
6445
6490
|
summary?: string;
|
|
6446
6491
|
|
|
6492
|
+
|
|
6447
6493
|
uuid: UUID;
|
|
6448
6494
|
session_id: string;
|
|
6449
6495
|
};
|
|
@@ -6678,6 +6724,7 @@ export declare type SDKUserMessage = {
|
|
|
6678
6724
|
|
|
6679
6725
|
|
|
6680
6726
|
|
|
6727
|
+
|
|
6681
6728
|
|
|
6682
6729
|
|
|
6683
6730
|
/**
|
|
@@ -6779,6 +6826,7 @@ export declare type SDKUserMessageReplay = {
|
|
|
6779
6826
|
|
|
6780
6827
|
|
|
6781
6828
|
|
|
6829
|
+
|
|
6782
6830
|
|
|
6783
6831
|
|
|
6784
6832
|
/**
|
|
@@ -7160,11 +7208,11 @@ export declare interface Settings {
|
|
|
7160
7208
|
|
|
7161
7209
|
|
|
7162
7210
|
/**
|
|
7163
|
-
* Number of days to retain chat transcripts before automatic cleanup (default: 30). Minimum 1. Use a large value for long retention; use --no-session-persistence to disable transcript writes entirely.
|
|
7211
|
+
* Number of days to retain chat transcripts before automatic cleanup (default: 30). Minimum 1. Use a large value for long retention; use --no-session-persistence to disable transcript writes entirely. Cleanup deletes data only on this computer, not anything stored by Anthropic.
|
|
7164
7212
|
*/
|
|
7165
7213
|
cleanupPeriodDays?: number;
|
|
7166
7214
|
/**
|
|
7167
|
-
* Retention ceiling in days for session transcripts created or last written by a desktop-host surface (Claude Desktop, Cowork), which are otherwise exempt from the cleanupPeriodDays sweep. 0 (the default) means no ceiling: such transcripts are kept until deleted another way. Unlike cleanupPeriodDays, 0 is allowed because this setting never disables writes — it only bounds an exemption from deletion. The ceiling is a hard cap: it also bounds an active archive grace, so the grace window of a release marker never keeps files past the ceiling. Ignored when cleanupPeriodDays is managed by org policy. A ceiling at or below cleanupPeriodDays effectively disables the exemption: those transcripts age out on the regular cleanupPeriodDays schedule, so the effective retention is whichever of the two periods is longer.
|
|
7215
|
+
* Retention ceiling in days for session transcripts created or last written by a desktop-host surface (Claude Desktop, Cowork), which are otherwise exempt from the cleanupPeriodDays sweep. 0 (the default) means no ceiling: such transcripts are kept until deleted another way. Unlike cleanupPeriodDays, 0 is allowed because this setting never disables writes — it only bounds an exemption from deletion. The ceiling is a hard cap: it also bounds an active archive grace, so the grace window of a release marker never keeps files past the ceiling. Ignored when cleanupPeriodDays is managed by org policy. A ceiling at or below cleanupPeriodDays effectively disables the exemption: those transcripts age out on the regular cleanupPeriodDays schedule, so the effective retention is whichever of the two periods is longer. Cleanup deletes data only on this computer, not anything stored by Anthropic.
|
|
7168
7216
|
*/
|
|
7169
7217
|
desktopSessionCleanupPeriodDays?: number;
|
|
7170
7218
|
/**
|
|
@@ -7212,7 +7260,7 @@ export declare interface Settings {
|
|
|
7212
7260
|
[k: string]: unknown;
|
|
7213
7261
|
};
|
|
7214
7262
|
/**
|
|
7215
|
-
* The claude.ai Project this session names for your organization's usage reports: the Project's
|
|
7263
|
+
* The claude.ai Project this session names for your organization's usage reports: the Project's ID, starting with "claude_proj_" or "chan_", or the UUID of a "claude_proj_" Project. An empty string names none and stops lower-precedence files from naming one; the organization default still applies. Sent only when Claude Code uses your claude.ai login, connects directly to the Anthropic API, is not in a cloud session, and CLAUDE_CODE_ATTRIBUTION_HEADER is not 0. CLAUDE_CODE_ATTRIBUTION_PROJECT takes precedence over it. Set in managed settings, it overrides people's own settings files. A project's .claude/settings.json and settings.local.json count only once the folder is trusted; for runs in a folder nobody has trusted, such as CI, use CLAUDE_CODE_ATTRIBUTION_PROJECT.
|
|
7216
7264
|
*/
|
|
7217
7265
|
attributionProject?: string;
|
|
7218
7266
|
/**
|
|
@@ -7220,7 +7268,7 @@ export declare interface Settings {
|
|
|
7220
7268
|
*/
|
|
7221
7269
|
attributionProjectPolicy?: {
|
|
7222
7270
|
/**
|
|
7223
|
-
* The Project used when neither CLAUDE_CODE_ATTRIBUTION_PROJECT nor attributionProject names one: its
|
|
7271
|
+
* The Project used when neither CLAUDE_CODE_ATTRIBUTION_PROJECT nor attributionProject names one: its ID, starting with "claude_proj_" or "chan_", or the UUID of a "claude_proj_" Project.
|
|
7224
7272
|
*/
|
|
7225
7273
|
default?: string;
|
|
7226
7274
|
};
|
|
@@ -7276,6 +7324,10 @@ export declare interface Settings {
|
|
|
7276
7324
|
* Disable auto mode
|
|
7277
7325
|
*/
|
|
7278
7326
|
disableAutoMode?: 'disable';
|
|
7327
|
+
/**
|
|
7328
|
+
* Never wait for a person to answer a tool permission prompt: a call that would prompt is denied at once, the model is told, and the turn carries on. This is what --permission-prompts none does for -p, in every kind of session, subagents and agent teams included. Allow rules, the permission mode, auto mode's classifier and PermissionRequest hooks decide first, as they do without it; it only ever denies, and allows nothing. Claude's questions and plan mode's tools are not offered to the model, and an MCP server's request for input is cancelled unless an Elicitation hook answers it. An app or script that answers prompts through canUseTool or --permission-prompt-tool is not asked either: answer from a PermissionRequest hook instead. Read from user settings, --settings and managed settings; project and local settings are ignored, and true in any of those sources wins.
|
|
7329
|
+
*/
|
|
7330
|
+
denyInsteadOfPrompting?: boolean;
|
|
7279
7331
|
/**
|
|
7280
7332
|
* Additional directories to include in the permission scope
|
|
7281
7333
|
*/
|
|
@@ -7657,6 +7709,10 @@ export declare interface Settings {
|
|
|
7657
7709
|
* Disable all hooks and statusLine execution: the hooks defined in settings files and by installed plugins. Features built into Claude Code are not hooks in this sense and keep working; each has its own switch.
|
|
7658
7710
|
*/
|
|
7659
7711
|
disableAllHooks?: boolean;
|
|
7712
|
+
/**
|
|
7713
|
+
* Disable the reply check in Claude Tag sessions on a self-hosted runner. The check re-prompts Claude, at most four times a turn, when a turn ends without a call to one of Claude Tag's reply tools. It is not a hook, so disableAllHooks does not affect it. Disabling it also stops two messages to Claude that Anthropic's service can request for such a session: a nudge after a long stretch of work with no visible update, and a reminder added to prompts. Claude Code's built-in reminder to give progress updates, on models that have it, is then no longer held back. Set it in managed settings; false there keeps the check on. Everywhere else it is ignored and the check stays on. Has no effect on sessions that Anthropic hosts.
|
|
7714
|
+
*/
|
|
7715
|
+
disableReplyCheck?: boolean;
|
|
7660
7716
|
/**
|
|
7661
7717
|
* Disable agent view (`claude agents`, `--bg`, /background, the on-demand daemon). Typically set in managed settings. Equivalent to CLAUDE_CODE_DISABLE_AGENT_VIEW=1.
|
|
7662
7718
|
*/
|
|
@@ -7693,6 +7749,10 @@ export declare interface Settings {
|
|
|
7693
7749
|
* 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.
|
|
7694
7750
|
*/
|
|
7695
7751
|
disableSkillShellExecution?: boolean;
|
|
7752
|
+
/**
|
|
7753
|
+
* Windows only. Set to true to keep every Bash command in a single argument to bash, so that endpoint security tools that match text in process command lines see it whole. Otherwise Claude Code may split a long command over several arguments. With true, a command of about 7,000 characters or more, or fewer if it is full of quotes, may reach bash cut short, and then usually fails with a syntax error. Only honored from managed settings; ignored in user, project, local and --settings sources.
|
|
7754
|
+
*/
|
|
7755
|
+
disableWindowsBashCommandSplit?: boolean;
|
|
7696
7756
|
/**
|
|
7697
7757
|
* Default shell for input-box ! commands. Defaults to 'bash' on all platforms (no Windows auto-flip).
|
|
7698
7758
|
*/
|
|
@@ -9052,7 +9112,7 @@ export declare interface Settings {
|
|
|
9052
9112
|
*/
|
|
9053
9113
|
disableSideloadFlags?: boolean;
|
|
9054
9114
|
/**
|
|
9055
|
-
* Marketplace names whose plugins may surface as contextual install suggestions (relevance-based tips). No marketplace-declared suggestions surface without this allowlist; the built-in
|
|
9115
|
+
* Marketplace names whose plugins may surface as contextual install suggestions (relevance-based tips). No marketplace-declared suggestions surface without this allowlist; the built-in tips for Anthropic's own plugins are unaffected. Only honored when set in managed settings (policy scope); the key is ignored in user, project, and local settings. A name only takes effect when the marketplace is registered on the machine AND its registered source is also declared in managed settings, either as the extraKnownMarketplaces entry for that name or as an entry of strictKnownMarketplaces. A marketplace registered from a different source under an allowlisted name is ignored. The official marketplace is exempt from the source requirement: allowlisting its name alone suffices, since that name can only register from the official Anthropic source.
|
|
9056
9116
|
*/
|
|
9057
9117
|
pluginSuggestionMarketplaces?: string[];
|
|
9058
9118
|
/**
|
|
@@ -9664,7 +9724,7 @@ export declare interface Settings {
|
|
|
9664
9724
|
startDirectory?: string;
|
|
9665
9725
|
}[];
|
|
9666
9726
|
/**
|
|
9667
|
-
* SSH connections in Claude Desktop
|
|
9727
|
+
* SSH connections in Claude Desktop whose host comes from a command. A list of entries, each with `id`, `name` and `command`, and optionally `sshIdentityFile` and `startDirectory`. Desktop runs `command` on this computer when you create the connection or another host for it, not each time you connect. `command` is a program name or absolute path (single-quote a path with spaces), then plain arguments. Nothing else can be quoted. For pipes, variables or a leading `~`, use a script. On Windows, the program must be a full path from a drive letter, such as `C:/tools/acme.exe`, ending in `.exe`, `.cmd` or `.bat`. Quoted paths and Windows need Claude Desktop v4.16336.0 or later. The command must print only the host on standard output: `host` or `user\@host` on one line, or a JSON object with `sshHost` and, optionally, `sshPort` and `startDirectory`. Desktop reads this key only from user settings and from this computer's managed settings. Claude Code itself does not use it.
|
|
9668
9728
|
*/
|
|
9669
9729
|
sshHostCommands?: unknown[];
|
|
9670
9730
|
/**
|