Harness Notes

Built-in tools

Updated 2026-11-22,

On this page

Compare documented built-in tools and their available input and result contracts. Start from a job, or search a tool name such as write_stdin or TaskStop. Availability varies by session.

Machine-readable contracts · Transcript envelopes and protocol items

Tools by job

JobClaude Code
Run a shell command
Keep a command running, send it input or stop it
Read files, PDFs or images
Create or change files
Search or fetch the web
Start, message and wait for other agents
Plan or track tasks
Ask or notify the user
Ask for more permissions

None listed

Read MCP resources
Load more tools or plugins
Use skills
Keep notes, memories or history

None listed

Schedule work, wait or check the time
Set goals or manage the context window
Run code that calls other tools
Manage threads, worktrees and environments
Post in shared channels

None listed

Deliver files, images or reports

Claude Code 2.1.310

56 tools.

Built in

Part of the harness. Each entry says what turns it on.

AgentDelegate work to a subagent.

CLI/SDK tool; own context and subagent allow/deny limits. Named calls can address teammates; forks and remote isolation have separate gates.

Aliases and version differences: Task (accepted compatibility alias; SDKSystemMessage init may still report Task, per publisher SDK docs)

InputPublished TypeScript

FieldTypeRequiredMeaning and defaults
descriptionstringYesA short (3-5 word) description of the task
promptstringYesThe task for the agent to perform
subagent_typestringNoThe type of specialized agent to use for this task
model"sonnet" | "opus" | "haiku" | "fable"NoOptional model override for this agent. Takes precedence over the agent definition's model frontmatter and the configured default subagent model. If omitted, uses the agent definition's model, else the default (inherits from the parent unless a default subagent model is configured). Ignored for subagent_type: "fork" — forks always inherit the parent model.
effort"low" | "medium" | "high" | "xhigh" | "max"NoReasoning effort for this agent. Set this ONLY when the user, or instructions such as CLAUDE.md or a skill, explicitly ask that this agent or delegated work run at a specific effort level, never on your own judgment; otherwise omit it and the agent runs at its usual effort. Ignored for subagent_type: "fork": a fork runs at your own effort.
run_in_backgroundbooleanNoAgents run in the background by default; you will be notified when one completes. Set to false only when your very next action depends on this agent's result and nothing else could usefully happen while it runs — otherwise leave it in the background so the user can hand you other work.
namestringNoName for the spawned agent. Makes it addressable via SendMessage({to: name}) while running.
team_namestringNoDeprecated; ignored. The session has a single implicit team.
mode"acceptEdits" | "auto" | "bypassPermissions" | "default" | "dontAsk" | "plan"NoDeprecated; ignored. Subagents inherit the parent session's permission mode; agent-definition frontmatter may override it.
isolation"worktree" | "remote"NoIsolation mode. "worktree" creates a temporary git worktree so the agent works on an isolated copy of the repo. "remote" launches the agent in a remote cloud environment (always runs in background; availability is gated).
Full input definition
export interface AgentInput {
    description: string;
    prompt: string;
    subagent_type?: string;
    model?: "sonnet" | "opus" | "haiku" | "fable";
    effort?: "low" | "medium" | "high" | "xhigh" | "max";
    run_in_background?: boolean;
    name?: string;
    team_name?: string;
    mode?: "acceptEdits" | "auto" | "bypassPermissions" | "default" | "dontAsk" | "plan";
    isolation?: "worktree" | "remote";
}

ResultPublished TypeScript

Full result definition
export type AgentOutput = {
    agentId: string;
    agentType?: string;
    content: {
        type: "text";
        text: string;
        citations?: unknown[] | null;
    }[];
    resolvedModel?: string;
    modelsUsed?: string[];
    totalToolUseCount: number;
    totalDurationMs: number;
    totalTokens: number;
    usage: {
        input_tokens: number;
        output_tokens: number;
        cache_creation_input_tokens: number | null;
        cache_read_input_tokens: number | null;
        server_tool_use: {
            web_search_requests: number;
            web_fetch_requests: number;
        } | null;
        service_tier: string | null;
        cache_creation: {
            ephemeral_1h_input_tokens: number;
            ephemeral_5m_input_tokens: number;
        } | null;
        inference_geo?: string | null;
        speed?: string | null;
        iterations?: unknown;
        output_tokens_details?: {
            thinking_tokens?: number | null;
        } | null;
        fallback_credit?: unknown;
    };
    toolStats?: {
        readCount: number;
        searchCount: number;
        bashCount: number;
        editFileCount: number;
        linesAdded: number;
        linesRemoved: number;
        otherToolCount: number;
        frameCount?: number;
    };
    status: "completed";
    prompt: string;
    worktreePath?: string;
    worktreeBranch?: string;
} | {
    status: "async_launched";
    isAsync?: true;
    agentId: string;
    description: string;
    resolvedModel?: string;
    modelsUsed?: string[];
    prompt: string;
    outputFile: string;
    canReadOutputFile?: boolean;
} | {
    status: "remote_launched";
    taskId: string;
    sessionUrl: string;
    description: string;
    prompt: string;
    outputFile: string;
};

Sources

ArtifactPublish a file as an artifact.

Subscriber plan and /login; publication prompts for permission. Hosted implementation unavailable.

InputPublished TypeScript

FieldTypeRequiredMeaning and defaults
action"publish" | "list" | "read" | "list_types" | "watch" | "unwatch" | "status" | "upload_asset" | "list_assets" | "read_asset" | "delete_asset" | "pin" | "unpin"NoOmit (or 'publish') to publish file_path. 'list' enumerates artifacts — the user's own by default, see scope; only limit and scope may accompany it. 'read' returns the content of the published artifact at url (raw HTML for the user's own; an isolated summary, steered by the optional prompt, for one someone else owns, though a page published in this session's own Slack channel can come back in full as untrusted content) — see **Calls**. 'watch', 'unwatch', and 'status' manage live-update subscriptions through which a session keeps track of new versions of an artifact published elsewhere, and those aren't available in this session: 'watch' only reports that — this session does not keep track of new versions — and 'status' lists this session's artifact watches (pass url to check one). 'upload_asset' adds one local media, PDF, font, or text file to an existing artifact — pass url and file_path (or file_paths for several in one call). 'list_assets' lists the files in an artifact's asset store (pass url; after continues a listing), 'read_asset' saves one of them to a local file named by its id (pass url and asset_id, optionally out_dir), and 'delete_asset' permanently removes one (pass url and asset_id). See **Artifact assets** above. 'pin' adds the artifact at url to the user's pinned list in their claude.ai sidebar and 'unpin' removes it (nothing else may accompany either) — private to the user, reversible, and no change to who can see the artifact.
file_pathstringNoPath to the .html file to render. Required to publish (the default action). Use a short, distinctive basename — it is the last-resort title when the HTML has no <title> and no title parameter is given. For 'upload_asset', the local image, video, PDF, font, stylesheet (CSS), script (JS), or text (CSV, Markdown, JSON, plain text) file to upload.
faviconstringNoDeprecated; omit it. Use icon.
iconstringNoOne short generic word for the artifact's browser-tab icon, such as chart, calendar, recipe, code or map — a plain signifier, not a product or brand name. Include it on every page's first publish; omit when republishing to keep the current icon, and pass a new one only when the user asks.
limitnumberNolist only: maximum artifacts to return (default 25).
scope"mine" | "shared" | "all"Nolist only: 'mine' (default) lists artifacts the user owns; 'shared' lists artifacts other people shared with the user; 'all' lists both. Rows are labeled (mine)/(shared) whenever scope is not 'mine'.
titlestringNoTitle for the artifact — the name shown in the browser tab and gallery. A short, distinctive noun-phrase name — not a generic label, a summary, or a name with an appended explainer. Prefer a <title> tag at the top of the HTML itself; this parameter fills in only when the file lacks one in the first 8KB of the file, and never overrides the tag. HTML publishes only — Markdown pages keep their filename identity. Content always comes from file_path — there is no inline content parameter.
descriptionstringNoOne-sentence subtitle shown on the gallery card. Say what the page is or does.
labelstringNoA short name for this publish, max 60 chars (e.g. "Draft to legal"). Optional — a few words, not a description.
urlstringNoAn existing artifact's claude.ai link (claude.ai/artifact/{id} or claude.ai/code/artifact/{uuid}; a chat, project or session link is not one) to update in place. Pass whenever the user wants to update an artifact this conversation did not publish — "update my artifact", "keep the same link", a pasted artifact URL — and find the URL with action: "list" or ask the user for the link if you don't have it; without this, the publish creates a separate artifact instead of updating the existing one. Omit for new artifacts and same-conversation redeploys. Must be an artifact the user owns or was given edit access to (a read of it says "writer"). Before publishing to an artifact this conversation has neither read nor published, read it (action: "read") and build on what comes back; a publish sent without that read is refused. A refusal that hands you the live version counts as that read: merge your edits into that version and publish that; never resend the refused content unchanged. For 'read' and the other url-addressed actions: the artifact to act on.
promptstringNoread only: what to extract from an artifact shared with the user — its content reaches you as an isolated summary answering this. Ignored for artifacts the user owns and for a page published in this session's own Slack channel (raw content is returned); optional.
forcebooleanNoLast-resort overwrite that DISCARDS the newer published version's page — another session's publish, or someone's save from a page that can publish new versions of itself. On a conflict the fix is to merge your changes onto the newer content (handed to you in the rejection, or re-read) and publish again — not force. Pass force:true only when the user has explicitly said to discard that specific version; never to get past a conflict on your own judgment. The tracked baseVersion is still sent; with force:true the server treats it as informational and overwrites, unless it refuses force over a version saved from inside the page. Omit (or false) so a concurrent write conflicts instead of being silently clobbered.
pinbooleanNopublish only: true also pins the published artifact to the user's claude.ai sidebar once it is published — pass it only when the user asked for that; a pin that fails never fails the publish (the result says so).
out_dirstringNoread_asset: directory to save into — default: this artifact’s folder in your scratchpad directory, where saving needs no approval and which you can Read from. read_asset names the file by the asset id plus the extension for its type; saving to any directory other than the default is an ordinary file save the user may be asked to approve.
file_paths[ string, ...string[] ]Noupload_asset: several local image, video, PDF, font, stylesheet or script files in place of file_path, up to 25 in one call, all into the artifact that url names; one approval covers the call, and the result lists each file's id and url, or why it was not uploaded. A CSV, Markdown, JSON or plain-text file, a symbolic or hard link, and a file outside the working directory each go in a call of their own with file_path.
asset_idstringNoread_asset and delete_asset: the asset's id (32 hex characters), from a list_assets or upload_asset result.
afterstringNolist_assets only: the next value from a previous list_assets result, to continue that listing.
capabilities{ [k: string]: unknown; }NoRuntime capabilities this page declares, as {name: config}. The control plane is the authority on valid names and config shapes. An empty object clears any previously stored declaration; omit the field on a redeploy to carry the stored declaration forward unchanged. Before declaring any capability, load the artifact-capabilities skill for the current contract and per-capability guidance.
contract"latest" | stringNoThe artifact's runtime version. Omit to keep its current version (the default); 'latest' to upgrade; a specific version to pin or roll back. Changing it changes how the published page behaves — pass only when the author explicitly intends the change, never as a side effect of editing.
Full input definition
export interface ArtifactInput {
    action?: "publish" | "list" | "read" | "list_types" | "watch" | "unwatch" | "status" | "upload_asset" | "list_assets" | "read_asset" | "delete_asset" | "pin" | "unpin";
    file_path?: string;
    favicon?: string;
    icon?: string;
    limit?: number;
    scope?: "mine" | "shared" | "all";
    title?: string;
    description?: string;
    label?: string;
    url?: string;
    prompt?: string;
    force?: boolean;
    pin?: boolean;
    out_dir?: string;
    file_paths?: [
        string,
        ...string[]
    ];
    asset_id?: string;
    after?: string;
    capabilities?: {
        [k: string]: unknown;
    };
    contract?: "latest" | string;
}

ResultPublished TypeScript

Full result definition
export type ArtifactOutput = {
    url: string;
    path: string;
    artifact_id?: string;
    title?: string;
    version?: string;
    capabilities?: unknown;
    stored?: {
        contract: string;
        preferredContract?: string;
        capabilities?: {
            [k: string]: unknown;
        };
        carried?: boolean;
        read?: string;
    };
    warnings?: string[];
    publishesRemaining?: number;
    publishesResetAt?: number;
    contract?: string;
    updated?: boolean;
    owned?: boolean;
    icon?: string;
    faviconSent?: true;
    iconDropped?: true;
    audience?: string;
    seq?: number;
    unchanged?: true;
    liveSubscription?: string;
    pinned?: boolean;
} | {
    artifacts: {
        title: string;
        url: string;
        favicon?: string;
        updatedAt?: string;
        rel?: "mine" | "shared";
        external?: true;
        role?: "editor" | "commenter" | "reader" | "viewer";
        pinned?: boolean;
    }[];
    truncated?: boolean;
    total?: number;
    total_at_least?: true;
    pins_enabled?: boolean;
    scope?: "shared" | "all";
    external_listed?: true;
} | {
    read: {
        url: string;
        bytes: number;
        code: number;
        codeText: string;
        result: string;
        durationMs: number;
        title?: string;
    };
    owned?: boolean;
    artifactRead?: {
        slug: string;
        ver?: string;
        seeded?: false;
    };
} | {
    watch: {
        url: string;
        watching: boolean;
        outcome: string;
        reason?: string;
        durable_skip_reason?: string;
        task_id?: string;
        since?: number;
        token_expires_at?: number;
        rail?: string;
        trigger_id?: string;
        durable_since?: string;
        status?: number;
        detail?: string;
        note?: string;
        events?: string[];
    };
} | {
    unwatch: {
        url: string;
        was_watching: boolean;
    };
} | {
    watches: ({
        url: string;
        task_id: string;
        since: number;
        explicit: boolean;
        connected: boolean;
        connecting?: boolean;
        token_expires_at: number;
        armed_via?: string;
    } | {
        url: string;
        rail: "durable_wake";
        trigger_id: string;
        since: string;
        events?: string[];
        restored?: boolean;
    } | {
        url: string;
        rail: "live_stopped";
        since?: number;
        explicit?: boolean;
        armed_via?: string;
        stop_kind: string;
    })[];
    filter_url?: string;
    arms?: {
        url: string;
        rail?: string;
        state: string;
        reconnect?: boolean;
        failures?: number;
        max_failures?: number;
        next_in_s?: number;
        last_failure?: string;
        reason?: string;
        detail?: string;
        server_message?: string;
        at?: number;
    }[];
} | {
    written?: {
        url: string;
    };
    owned?: boolean;
    asset_upload: {
        id: string;
        url: string;
        size_bytes: number;
        content_type: string;
        sha256?: string;
        file_name: string;
    };
} | {
    written?: {
        url: string;
    };
    owned?: boolean;
    asset_uploads: {
        url: string;
        results: [
            ({
                file_path: string;
                status: "uploaded";
                id: string;
                url: string;
                size_bytes: number;
                content_type: string;
                sha256?: string;
                file_name: string;
            } | {
                file_path: string;
                status: "failed" | "not_attempted";
                reason: string;
                message: string;
                may_be_stored?: true;
            }),
            ...({
                file_path: string;
                status: "uploaded";
                id: string;
                url: string;
                size_bytes: number;
                content_type: string;
                sha256?: string;
                file_name: string;
            } | {
                file_path: string;
                status: "failed" | "not_attempted";
                reason: string;
                message: string;
                may_be_stored?: true;
            })[]
        ];
    };
} | {
    asset_list: {
        url: string;
        assets: {
            id: string;
            url: string;
            content_type: string;
            size_bytes: number;
            sha256?: string;
            created_at: string;
        }[];
        usage: {
            files: number;
            bytes: number;
            max_files: number;
            max_bytes: number;
        };
        next?: string;
        cowritten?: true;
        outside_writer?: true;
    };
} | {
    asset_read: {
        id: string;
        path: string;
        size_bytes: number;
        content_type: string;
        sha256: string;
        cowritten?: true;
        outside_writer?: true;
        public_read?: true;
        foreign?: true;
    };
} | {
    written?: {
        url: string;
    };
    owned?: boolean;
    asset_delete: {
        id: string;
        deleted: boolean;
    };
} | {
    pin: {
        action: "pin" | "unpin";
        url: string;
        pinned: boolean;
        title?: string;
    };
};

Sources

AskUserQuestionCollect user choices.

Built in. The model, platform, mode, tool settings and permission rules can still remove it.

InputPublished TypeScript

FieldTypeRequiredMeaning and defaults
questions[ { question: string; header: string; options: [ { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; } ] | [ { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; } ] | [ { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; } ]; multiSelect: boolean; } ] | [ { question: string; header: string; options: [ { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; } ] | [ { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; } ] | [ { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; } ]; multiSelect: boolean; }, { question: string; header: string; options: [ { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; } ] | [ { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; } ] | [ { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; } ]; multiSelect: boolean; } ] | [ { question: string; header: string; options: [ { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; } ] | [ { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; } ] | [ { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; } ]; multiSelect: boolean; }, { question: string; header: string; options: [ { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; } ] | [ { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; } ] | [ { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; } ]; multiSelect: boolean; }, { question: string; header: string; options: [ { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; } ] | [ { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; } ] | [ { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; } ]; multiSelect: boolean; } ] | [ { question: string; header: string; options: [ { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; } ] | [ { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; } ] | [ { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; } ]; multiSelect: boolean; }, { question: string; header: string; options: [ { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; } ] | [ { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; } ] | [ { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; } ]; multiSelect: boolean; }, { question: string; header: string; options: [ { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; } ] | [ { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; } ] | [ { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; } ]; multiSelect: boolean; }, { question: string; header: string; options: [ { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; } ] | [ { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; } ] | [ { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; } ]; multiSelect: boolean; } ]YesQuestions to ask the user (1-4 questions)
answers{ [k: string]: string; }NoUser answers collected by the permission component
annotations{ [k: string]: { preview?: string; notes?: string; }; }NoOptional per-question annotations from the user (e.g., notes on preview selections). Keyed by question text.
metadata{ source?: string; }NoOptional metadata for tracking and analytics purposes. Not displayed to user.
Full input definition
export interface AskUserQuestionInput {
    questions: [
        {
            question: string;
            header: string;
            options: [
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                }
            ] | [
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                }
            ] | [
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                }
            ];
            multiSelect: boolean;
        }
    ] | [
        {
            question: string;
            header: string;
            options: [
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                }
            ] | [
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                }
            ] | [
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                }
            ];
            multiSelect: boolean;
        },
        {
            question: string;
            header: string;
            options: [
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                }
            ] | [
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                }
            ] | [
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                }
            ];
            multiSelect: boolean;
        }
    ] | [
        {
            question: string;
            header: string;
            options: [
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                }
            ] | [
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                }
            ] | [
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                }
            ];
            multiSelect: boolean;
        },
        {
            question: string;
            header: string;
            options: [
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                }
            ] | [
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                }
            ] | [
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                }
            ];
            multiSelect: boolean;
        },
        {
            question: string;
            header: string;
            options: [
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                }
            ] | [
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                }
            ] | [
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                }
            ];
            multiSelect: boolean;
        }
    ] | [
        {
            question: string;
            header: string;
            options: [
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                }
            ] | [
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                }
            ] | [
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                }
            ];
            multiSelect: boolean;
        },
        {
            question: string;
            header: string;
            options: [
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                }
            ] | [
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                }
            ] | [
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                }
            ];
            multiSelect: boolean;
        },
        {
            question: string;
            header: string;
            options: [
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                }
            ] | [
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                }
            ] | [
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                }
            ];
            multiSelect: boolean;
        },
        {
            question: string;
            header: string;
            options: [
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                }
            ] | [
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                }
            ] | [
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                },
                {
                    label: string;
                    description: string;
                    preview?: string;
                }
            ];
            multiSelect: boolean;
        }
    ];
    answers?: {
        [k: string]: string;
    };
    annotations?: {
        [k: string]: {
            preview?: string;
            notes?: string;
        };
    };
    metadata?: {
        source?: string;
    };
}

ResultPublished TypeScript

FieldTypeRequiredMeaning and defaults
questions{ question: string; header: string; options: [ { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; } ] | [ { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; } ] | [ { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; }, { label: string; description: string; preview?: string; } ]; multiSelect: boolean; }[]YesThe questions that were asked
answers{ [k: string]: string; }YesThe answers provided by the user (question text -> answer string; multi-select answers are comma-separated)
responsestringNoFreeform text the user typed instead of selecting a structured option
annotations{ [k: string]: { preview?: string; notes?: string; }; }NoOptional per-question annotations from the user (e.g., notes on preview selections). Keyed by question text.
afkTimeoutMsnumberNoSet when the dialog auto-resolved after this many milliseconds of idle (user away from keyboard). Absent on every human-resolved path.
Full result definition
export interface AskUserQuestionOutput {
    questions: {
        question: string;
        header: string;
        options: [
            {
                label: string;
                description: string;
                preview?: string;
            },
            {
                label: string;
                description: string;
                preview?: string;
            }
        ] | [
            {
                label: string;
                description: string;
                preview?: string;
            },
            {
                label: string;
                description: string;
                preview?: string;
            },
            {
                label: string;
                description: string;
                preview?: string;
            }
        ] | [
            {
                label: string;
                description: string;
                preview?: string;
            },
            {
                label: string;
                description: string;
                preview?: string;
            },
            {
                label: string;
                description: string;
                preview?: string;
            },
            {
                label: string;
                description: string;
                preview?: string;
            }
        ];
        multiSelect: boolean;
    }[];
    answers: {
        [k: string]: string;
    };
    response?: string;
    annotations?: {
        [k: string]: {
            preview?: string;
            notes?: string;
        };
    };
    afkTimeoutMs?: number;
}

Sources

BashRun a shell command.

Built in. The model, platform, mode, tool settings and permission rules can still remove it.

InputPublished TypeScript

FieldTypeRequiredMeaning and defaults
commandstringYesThe command to execute
timeoutnumberNoOptional timeout in milliseconds (max 600000 for a foreground command)
descriptionstringNoClear, concise description of what this command does in active voice. Never use words like "complex" or "risk" in the description - just describe what it does. Say what the command does in plain words: do not echo the command's text, its flags, or file paths - the user reads this description, often without seeing the command. For simple commands (git, npm, standard CLI tools), keep it brief (5-10 words): - ls → "List files in current directory" - git status → "Show working tree status" - npm install → "Install package dependencies" For commands that are harder to parse at a glance (piped commands, obscure flags, etc.), add enough context to clarify what it does: - find . -name "*.tmp" -exec rm {} \; → "Find and delete all .tmp files recursively" - git reset --hard origin/main → "Discard all local changes and match remote main" - curl -s url | jq '.data[]' → "Fetch JSON from URL and extract data array elements"
run_in_backgroundbooleanNoSet to true to run this command in the background. With it, timeout limits how long the command may run in the background before it is stopped (default 1800000 ms, max 7200000 ms).
dangerouslyDisableSandboxbooleanNoSet this to true to dangerously override sandbox mode and run commands without sandboxing.
Full input definition
export interface BashInput {
    command: string;
    timeout?: number;
    description?: string;
    run_in_background?: boolean;
    dangerouslyDisableSandbox?: boolean;
}

ResultPublished TypeScript

FieldTypeRequiredMeaning and defaults
stdoutstringYesThe standard output of the command
stderrstringYesThe standard error output of the command
rawOutputPathstringNoPath to raw output file for large MCP tool outputs
interruptedbooleanYesWhether the command was interrupted
isImagebooleanNoFlag to indicate if stdout contains image data
backgroundTaskIdstringNoID of the background task if command is running in background
backgroundedByUserbooleanNoTrue if the user manually backgrounded the command with Ctrl+B
timedOutAfterMsnumberNoSet when the command hit its timeout and was auto-backgrounded; the timeout value in ms
backgroundCwdHintstringNoModel-facing note that the session cwd was not changed by a backgrounded command containing a directory-change builtin (cd/pushd/popd/chdir)
backgroundEndsWithFinalResponsetrueNoTrue when this backgrounded command is terminated at its caller's final response, so no completion notification can follow (a synchronous subagent's command, or a headless session that takes no further input and is not waiting for background commands); absent when the command survives
dangerouslyDisableSandboxbooleanNoFlag to indicate if sandbox mode was overridden
returnCodeInterpretationstringNoSemantic interpretation for non-error exit codes with special meaning
noOutputExpectedbooleanNoWhether the command is expected to produce no output on success
structuredContentunknown[]NoStructured content blocks
persistedOutputPathstringNoPath to the persisted full output in tool-results dir (set when output is too large for inline)
persistedOutputSizenumberNoTotal size of the output in bytes (set when output is too large for inline)
staleReadFileStateHintstringNoModel-facing note listing readFileState entries whose mtime bumped during this command (set when WRITE_COMMAND_MARKERS matches)
ghRateLimitHintstringNoModel-facing system-reminder appended when a gh command reports a GitHub API rate-limit error
gitOperation{ commit?: { sha: string; kind: "committed" | "amended" | "cherry-picked"; branch?: string; }; push?: { branch: string; }; branch?: { ref: string; action: "merged" | "rebased"; }; pr?: { number: number; url?: string; action: "created" | "edited" | "merged" | "commented" | "closed" | "reopened" | "ready" | "draft" | "auto-merge-enabled" | "auto-merge-disabled"; }; }NoStructured classification of git/gh operations detected in this command (commit/push/merge/rebase/PR). Client-facing — lets clients render git activity without re-parsing stdout; not surfaced to the model.
Full result definition
export interface BashOutput {
    stdout: string;
    stderr: string;
    rawOutputPath?: string;
    interrupted: boolean;
    isImage?: boolean;
    backgroundTaskId?: string;
    backgroundedByUser?: boolean;
    timedOutAfterMs?: number;
    backgroundCwdHint?: string;
    backgroundEndsWithFinalResponse?: true;
    dangerouslyDisableSandbox?: boolean;
    returnCodeInterpretation?: string;
    noOutputExpected?: boolean;
    structuredContent?: unknown[];
    persistedOutputPath?: string;
    persistedOutputSize?: number;
    staleReadFileStateHint?: string;
    ghRateLimitHint?: string;
    gitOperation?: {
        commit?: {
            sha: string;
            kind: "committed" | "amended" | "cherry-picked";
            branch?: string;
        };
        push?: {
            branch: string;
        };
        branch?: {
            ref: string;
            action: "merged" | "rebased";
        };
        pr?: {
            number: number;
            url?: string;
            action: "created" | "edited" | "merged" | "commented" | "closed" | "reopened" | "ready" | "draft" | "auto-merge-enabled" | "auto-merge-disabled";
        };
    };
}

Shell edits shown as diffs

Claude Code can show readable file diffs after a Bash command edits files, including Perl or Python scripts. On macOS it snapshots the Git working tree before and after the command using a private Git index and object store, then renders the changed lines. It does not need to understand the editing script.

The saved user tool-result record carries toolUseResult.bashEditDiff: files[] contains filePath and hunks[], with optional created or deleted flags. Hunks contain old/new line positions, counts and prefixed lines. Associate the record with its Bash call through message.content → tool_result.tool_use_id → assistant tool_use.id. This internal rendering data is separate from model-facing output and from the published SDK type above; hooks receive it at tool_response.bashEditDiff.

CLAUDE_CODE_BASH_EDIT_DIFF overrides bashEditDiffEnabled. Without an explicit override, the implementation checks auto or bypassPermissions mode and its Bash-first model/cohort gate. Background commands and some Git operations do not receive a diff. The snapshot path shows at most five files; moreFiles, unavailable, skipped and shared describe limits. Other processes can change files during the command, so these diffs cannot establish which process wrote them. A missing diff does not prove that nothing changed.

Version boundary: existing local Claude Code 2.1.311 transcript records confirmed saved Bash diff hunks; the implementation and terminal renderer were traced in the installed 2.1.312 binary (embedded build commit f375cd85d4f70920de17ce3a4ad646e18834e833). Linux also has a write-observer path. SDK stream-json delivery and desktop or other host rendering were not verified.

Transcript format: Claude Code — Bash file-change diffs

Failures and lifecycle

  • SDK success output includes stdout, stderr and interrupted plus optional backgroundTaskId/outputFile and other declared fields. Backgrounding/completion, timeout and cancellation are lifecycle states, not a single exit-code result. SDK foreground timeout comment is 600000 ms; current docs also describe configurable ceilings and unattended background limits, so preserve this version/source boundary.

Sources

CronCreateCreate a session schedule.

Built in. The model, platform, mode, tool settings and permission rules can still remove it.

InputPublished TypeScript

FieldTypeRequiredMeaning and defaults
cronstringYesStandard 5-field cron expression in local time: "M H DoM Mon DoW" (e.g. "* /5 * * * *" = every 5 minutes, "30 14 28 2 *" = Feb 28 at 2:30pm local once).
promptstringYesThe prompt to enqueue at each fire time.
recurringbooleanNotrue (default) = fire on every cron match until deleted or auto-expired after 7 days. false = fire once at the next match, then auto-delete. Use false for "remind me at X" one-shot requests with pinned minute/hour/dom/month.
durablebooleanNotrue = persist to .claude/scheduled_tasks.json and survive restarts. false (default) = in-memory only, dies when this Claude session ends. Use true only when the user asks the task to survive across sessions.
Full input definition
export interface CronCreateInput {
    cron: string;
    prompt: string;
    recurring?: boolean;
    durable?: boolean;
}

ResultPublished TypeScript

FieldTypeRequiredMeaning and defaults
idstringYes
humanSchedulestringYes
recurringbooleanYes
durablebooleanNo
nextFireAtnumberNoEpoch ms of the job's next run, the scheduler's per-job offset included
Full result definition
export interface CronCreateOutput {
    id: string;
    humanSchedule: string;
    recurring: boolean;
    durable?: boolean;
    nextFireAt?: number;
}

Sources

CronDeleteDelete a session schedule.

Built in. The model, platform, mode, tool settings and permission rules can still remove it.

InputPublished TypeScript

FieldTypeRequiredMeaning and defaults
idstringYesJob ID returned by CronCreate.
Full input definition
export interface CronDeleteInput {
    id: string;
}

ResultPublished TypeScript

FieldTypeRequiredMeaning and defaults
idstringYes
Full result definition
export interface CronDeleteOutput {
    id: string;
}

Sources

CronListList session schedules.

Built in. The model, platform, mode, tool settings and permission rules can still remove it.

InputPublished TypeScript

Full input definition
export interface CronListInput {
}

ResultPublished TypeScript

FieldTypeRequiredMeaning and defaults
jobs{ id: string; cron: string; humanSchedule: string; prompt: string; recurring?: boolean; durable?: boolean; nextFireAt?: number; }[]Yes
Full result definition
export interface CronListOutput {
    jobs: {
        id: string;
        cron: string;
        humanSchedule: string;
        prompt: string;
        recurring?: boolean;
        durable?: boolean;
        nextFireAt?: number;
    }[];
}

Sources

EditReplace matching file text.

Built in. The model, platform, mode, tool settings and permission rules can still remove it.

Aliases and version differences: FileEdit (SDK type prefix, not a callable alias)

InputPublished TypeScript

FieldTypeRequiredMeaning and defaults
file_pathstringYesThe absolute path to the file to modify
old_stringstringYesThe text to replace
new_stringstringYesThe text to replace it with (must be different from old_string)
replace_allbooleanNoReplace all occurrences of old_string (default false)
Full input definition
export interface FileEditInput {
    file_path: string;
    old_string: string;
    new_string: string;
    replace_all?: boolean;
}

ResultPublished TypeScript

FieldTypeRequiredMeaning and defaults
filePathstringYesThe file path that was edited
oldStringstringYesThe original string that was replaced
newStringstringYesThe new string that replaced it
originalFilestring | nullYesThe original file contents before editing
structuredPatch{ oldStart: number; oldLines: number; newStart: number; newLines: number; lines: string[]; }[]YesDiff patch showing the changes
userModifiedbooleanYesWhether the user modified the proposed changes
replaceAllbooleanYesWhether all occurrences were replaced
gitDiff{ filename: string; status: "modified" | "added"; additions: number; deletions: number; changes: number; patch: string; repository?: string | null; }No
stagedbooleanNoTrue when the edit was held for the machine owner to review instead of written; the file is unchanged
Full result definition
export interface FileEditOutput {
    filePath: string;
    oldString: string;
    newString: string;
    originalFile: string | null;
    structuredPatch: {
        oldStart: number;
        oldLines: number;
        newStart: number;
        newLines: number;
        lines: string[];
    }[];
    userModified: boolean;
    replaceAll: boolean;
    gitDiff?: {
        filename: string;
        status: "modified" | "added";
        additions: number;
        deletions: number;
        changes: number;
        patch: string;
        repository?: string | null;
    };
    staged?: boolean;
}

Sources

EndConversationEnd the conversation.

Built in. The model, platform, mode, tool settings and permission rules can still remove it.

InputSchema unavailable

ResultSchema unavailable

Sources

EnterPlanModeEnter planning mode.

Built in. The model, platform, mode, tool settings and permission rules can still remove it.

InputPublished TypeScript

Full input definition
export interface EnterPlanModeInput {
}

ResultPublished TypeScript

FieldTypeRequiredMeaning and defaults
messagestringYesConfirmation that plan mode was entered
Full result definition
export interface EnterPlanModeOutput {
    message: string;
}

Sources

EnterWorktreeEnter a Git worktree.

Built in. The model, platform, mode, tool settings and permission rules can still remove it.

InputPublished TypeScript

FieldTypeRequiredMeaning and defaults
namestringNoOptional name for a new worktree. Each "/"-separated segment may contain only letters, digits, dots, underscores, and dashes; max 64 chars total. A random name is generated if not provided. Mutually exclusive with path.
pathstringNoPath to an existing worktree to switch into instead of creating a new one. Must appear in git worktree list for the current repo — or, on first entry from the launch directory, for a repo nested inside it (multi-repo workspace). Mutually exclusive with name.
Full input definition
export interface EnterWorktreeInput {
    name?: string;
    path?: string;
}

ResultPublished TypeScript

FieldTypeRequiredMeaning and defaults
worktreePathstringYes
worktreeBranchstringNo
messagestringYes
Full result definition
export interface EnterWorktreeOutput {
    worktreePath: string;
    worktreeBranch?: string;
    message: string;
}

Sources

ExitPlanModeSubmit a plan and leave planning mode.

Built in. The model, platform, mode, tool settings and permission rules can still remove it.

InputPublished TypeScript

FieldTypeRequiredMeaning and defaults
allowedPrompts{ tool: "Bash"; prompt: string; }[]NoDeprecated: no longer used.
Full input definition
export interface ExitPlanModeInput {
    allowedPrompts?: {
        tool: "Bash";
        prompt: string;
    }[];
    [k: string]: unknown;
}

ResultPublished TypeScript

FieldTypeRequiredMeaning and defaults
planstring | nullYesThe plan that was presented to the user
isAgentbooleanYes
filePathstringNoThe file path where the plan was saved
hasTaskToolbooleanNoWhether the Agent tool is available in the current context
planWasEditedbooleanNoTrue when the user edited the plan (CCR web UI or Ctrl+G); determines whether the plan is echoed back in tool_result
awaitingLeaderApprovalbooleanNoWhen true, the teammate has sent a plan approval request to the team leader
requestIdstringNoUnique identifier for the plan approval request
Full result definition
export interface ExitPlanModeOutput {
    plan: string | null;
    isAgent: boolean;
    filePath?: string;
    hasTaskTool?: boolean;
    planWasEdited?: boolean;
    awaitingLeaderApproval?: boolean;
    requestId?: string;
}

Failures and lifecycle

  • Plan approval is a permission interaction; a normal tool result does not itself prove approval or subsequent execution.

Sources

ExitWorktreeLeave the session worktree.

Built in. The model, platform, mode, tool settings and permission rules can still remove it.

InputPublished TypeScript

FieldTypeRequiredMeaning and defaults
action"keep" | "remove"Yes"keep" leaves the worktree and branch on disk; "remove" deletes both.
discard_changesbooleanNoRequired true when action is "remove" and the worktree has uncommitted files or unmerged commits. The tool will refuse and list them otherwise.
Full input definition
export interface ExitWorktreeInput {
    action: "keep" | "remove";
    discard_changes?: boolean;
}

ResultPublished TypeScript

FieldTypeRequiredMeaning and defaults
action"keep" | "remove"Yes
originalCwdstringYes
worktreePathstringYes
worktreeBranchstringNo
tmuxSessionNamestringNo
discardedFilesnumberNo
discardedCommitsnumberNo
messagestringYes
Full result definition
export interface ExitWorktreeOutput {
    action: "keep" | "remove";
    originalCwd: string;
    worktreePath: string;
    worktreeBranch?: string;
    tmuxSessionName?: string;
    discardedFiles?: number;
    discardedCommits?: number;
    message: string;
}

Sources

GlobFind paths by glob.

Absent by default on macOS/Linux/WSL in current docs; may be restored with tool configuration. SDK types do not imply default exposure.

InputPublished TypeScript

FieldTypeRequiredMeaning and defaults
patternstringYesThe glob pattern to match files against
pathstringNoThe directory to search in. If not specified, the current working directory will be used. IMPORTANT: Omit this field to use the default directory. DO NOT enter "undefined" or "null" - simply omit it for the default behavior. Must be a valid directory path if provided.
Full input definition
export interface GlobInput {
    pattern: string;
    path?: string;
}

ResultPublished TypeScript

FieldTypeRequiredMeaning and defaults
durationMsnumberYesTime taken to execute the search in milliseconds
numFilesnumberYesNumber of file paths returned (after any truncation)
filenamesstring[]YesArray of file paths that match the pattern
truncatedbooleanYesWhether results were truncated (limited to 100 files)
totalMatchesnumberNoTotal number of matching files before truncation. A lower bound when countIsComplete is false. Absent on results persisted by CLI versions predating this field.
countIsCompletebooleanNoWhether totalMatches is the exact total (true) or a floor because the underlying search truncated its own output (false). Absent on results persisted by CLI versions predating this field.
Full result definition
export interface GlobOutput {
    durationMs: number;
    numFiles: number;
    filenames: string[];
    truncated: boolean;
    totalMatches?: number;
    countIsComplete?: boolean;
}

Sources

GrepSearch file contents.

Absent by default on macOS/Linux/WSL in current docs; may be restored with tool configuration. SDK types do not imply default exposure.

InputPublished TypeScript

FieldTypeRequiredMeaning and defaults
patternstringYesThe regular expression pattern to search for in file contents
pathstringNoFile or directory to search in (rg PATH). Defaults to current working directory.
globstringNoGlob pattern to filter files (e.g. "*.js", "*.{ts,tsx}") - maps to rg --glob
output_mode"content" | "files_with_matches" | "count"NoOutput mode: "content" shows matching lines (supports -A/-B/-C context, -n line numbers, head_limit), "files_with_matches" shows file paths (supports head_limit), "count" shows match counts (supports head_limit). Defaults to "files_with_matches".
-BnumberNoNumber of lines to show before each match (rg -B). Requires output_mode: "content", ignored otherwise.
-AnumberNoNumber of lines to show after each match (rg -A). Requires output_mode: "content", ignored otherwise.
-CnumberNoAlias for context.
contextnumberNoNumber of lines to show before and after each match (rg -C). Requires output_mode: "content", ignored otherwise.
-nbooleanNoShow line numbers in output (rg -n). Requires output_mode: "content", ignored otherwise. Defaults to true.
-ibooleanNoCase insensitive search (rg -i)
-obooleanNoPrint only the matched (non-empty) parts of each matching line, one match per output line (rg -o / --only-matching). Requires output_mode: "content", ignored otherwise. Defaults to false.
typestringNoFile type to search (rg --type). Common types: js, py, rust, go, java, etc. More efficient than include for standard file types.
head_limitnumberNoLimit output to first N lines/entries, equivalent to "| head -N". Works across all output modes: content (limits output lines), files_with_matches (limits file paths), count (limits count entries). Defaults to 250 when unspecified. Pass 0 for unlimited (use sparingly — large result sets waste context).
offsetnumberNoSkip first N lines/entries before applying head_limit, equivalent to "| tail -n +N | head -N". Works across all output modes. Defaults to 0.
multilinebooleanNoEnable multiline mode where . matches newlines and patterns can span lines (rg -U --multiline-dotall). Default: false.
Full input definition
export interface GrepInput {
    pattern: string;
    path?: string;
    glob?: string;
    output_mode?: "content" | "files_with_matches" | "count";
    "-B"?: number;
    "-A"?: number;
    "-C"?: number;
    context?: number;
    "-n"?: boolean;
    "-i"?: boolean;
    "-o"?: boolean;
    type?: string;
    head_limit?: number;
    offset?: number;
    multiline?: boolean;
}

ResultPublished TypeScript

FieldTypeRequiredMeaning and defaults
mode"content" | "files_with_matches" | "count"No
numFilesnumberYes
filenamesstring[]Yes
contentstringNo
numLinesnumberNo
numMatchesnumberNo
totalFilesnumberNo
totalLinesnumberNo
appliedLimitnumberNo
appliedOffsetnumberNo
Full result definition
export interface GrepOutput {
    mode?: "content" | "files_with_matches" | "count";
    numFiles: number;
    filenames: string[];
    content?: string;
    numLines?: number;
    numMatches?: number;
    totalFiles?: number;
    totalLines?: number;
    appliedLimit?: number;
    appliedOffset?: number;
}

Sources

LSPQuery language-server intelligence.

Requires configured language-server support; editor/plugin/provider dependent.

InputSchema unavailable

ResultSchema unavailable

Sources

ListAgentsList reachable agents.

Cross-session messaging enabled; CLI >=2.1.224; teammate/self rows >=2.1.239.

InputSchema unavailable

ResultSchema unavailable

Sources

MonitorWatch command or WebSocket events.

Built in. The model, platform, mode, tool settings and permission rules can still remove it. Publisher notes in 2.1.310 extend availability to Bedrock, Vertex, Foundry and telemetry/nonessential-traffic-disabled sessions.

InputPublished TypeScript

FieldTypeRequiredMeaning and defaults
descriptionstringYesShort human-readable description of what you are monitoring (shown in notifications).
timeout_msnumberYesKill the monitor after this deadline. Default 300000ms. Deadlines above 1800000ms are capped to 1800000ms. You are notified at expiry and can re-arm.
commandstringNoShell command or script. Each stdout line is an event; exit ends the watch.
ws{ url: string; protocols?: string[]; }NoWebSocket to open. Each text frame is an event; binary frames are reported as a placeholder line. Socket close ends the watch. Cannot be combined with command.
Full input definition
export interface MonitorInput {
    description: string;
    timeout_ms: number;
    command?: string;
    ws?: {
        url: string;
        protocols?: string[];
    };
}

ResultPublished TypeScript

FieldTypeRequiredMeaning and defaults
taskIdstringYesID of the background monitor task.
timeoutMsnumberYesTimeout deadline in milliseconds (0 when persistent).
persistentbooleanNoNo timeout — runs until TaskStop or session end.
Full result definition
export interface MonitorOutput {
    taskId: string;
    timeoutMs: number;
    persistent?: boolean;
}

Sources

NotebookEditModify a notebook cell.

Built in. The model, platform, mode, tool settings and permission rules can still remove it.

InputPublished TypeScript

FieldTypeRequiredMeaning and defaults
notebook_pathstringYesThe absolute path to the Jupyter notebook file to edit (must be absolute, not relative)
cell_idstringNoThe ID of the cell to edit. When inserting a new cell, the new cell will be inserted after the cell with this ID, or at the beginning if not specified.
new_sourcestringYesThe new source for the cell
cell_type"code" | "markdown"NoThe type of the cell (code or markdown). If not specified, it defaults to the current cell type. If using edit_mode=insert, this is required.
edit_mode"replace" | "insert" | "delete"NoThe type of edit to make (replace, insert, delete). Defaults to replace.
Full input definition
export interface NotebookEditInput {
    notebook_path: string;
    cell_id?: string;
    new_source: string;
    cell_type?: "code" | "markdown";
    edit_mode?: "replace" | "insert" | "delete";
}

ResultPublished TypeScript

FieldTypeRequiredMeaning and defaults
new_sourcestringYesThe new source code that was written to the cell
old_sourcestringNoThe previous cell source (replace/delete only). Enables cell-relative diff rendering without re-reading the notebook.
cell_idstringNoThe ID of the cell that was edited
cell_type"code" | "markdown"YesThe type of the cell
languagestringYesThe programming language of the notebook
edit_modestringYesThe edit mode that was used
errorstringNoError message if the operation failed
notebook_pathstringYesThe path to the notebook file
original_filestringYesThe original notebook content before modification
updated_filestringYesThe updated notebook content after modification
Full result definition
export interface NotebookEditOutput {
    new_source: string;
    old_source?: string;
    cell_id?: string;
    cell_type: "code" | "markdown";
    language: string;
    edit_mode: string;
    error?: string;
    notebook_path: string;
    original_file: string;
    updated_file: string;
}

Sources

PowerShellRun a PowerShell command.

Native tool preview and platform/setting gates; documented behavior does not establish full SDK schema.

InputSchema unavailable

ResultSchema unavailable

Sources

PushNotificationNotify the user.

Desktop and optional Remote Control push; hosted delivery restrictions.

InputPublished TypeScript

FieldTypeRequiredMeaning and defaults
messagestringYesThe notification body. Keep it under 200 characters; mobile OSes truncate.
statusproactiveYes
Full input definition
export interface PushNotificationInput {
    message: string;
    status: "proactive";
}

ResultPublished TypeScript

FieldTypeRequiredMeaning and defaults
messagestringYes
pushSentbooleanNo
localSentbooleanNo
disabledReason"config_off" | "user_present" | "no_transport"No
sentAtstringNoISO timestamp captured at tool execution on the emitting process. Optional — resumed sessions replay pre-sentAt outputs verbatim.
Full result definition
export interface PushNotificationOutput {
    message: string;
    pushSent?: boolean;
    localSent?: boolean;
    disabledReason?: "config_off" | "user_present" | "no_transport";
    sentAt?: string;
}

Sources

ReadRead a file.

Built in. The model, platform, mode, tool settings and permission rules can still remove it.

Aliases and version differences: FileRead (SDK type prefix, not a callable alias)

InputPublished TypeScript

FieldTypeRequiredMeaning and defaults
file_pathstringYesThe absolute path to the file to read
offsetnumberNoThe line number to start reading from. Only provide if the file is too large to read at once
limitnumberNoThe number of lines to read. Only provide if the file is too large to read at once.
pagesstringNoPage range for PDF files (e.g., "1-5", "3", "10-20"). Only applicable to PDF files. Maximum 20 pages per request.
allow_largebooleanNoSet to true to read a text file, or a line range of one, that is over the usual size limits, up to what still fits in your context. Only use this when you genuinely need all of it or the user asked for the whole file; otherwise read it in parts with offset and limit, or search it.
Full input definition
export interface FileReadInput {
    file_path: string;
    offset?: number;
    limit?: number;
    pages?: string;
    allow_large?: boolean;
}

ResultPublished TypeScript

Full result definition
export type FileReadOutput = {
    type: "text";
    file: {
        filePath: string;
        content: string;
        numLines: number;
        startLine: number;
        totalLines: number;
        truncatedByTokenCap?: boolean;
    };
    artifactRead?: {
        slug: string;
        ver: string;
    };
} | {
    type: "image";
    file: {
        base64: string;
        type: "image/jpeg" | "image/png" | "image/gif" | "image/webp";
        originalSize: number;
        dimensions?: {
            originalWidth?: number;
            originalHeight?: number;
            displayWidth?: number;
            displayHeight?: number;
        };
    };
} | {
    type: "notebook";
    file: {
        filePath: string;
        cells: unknown[];
    };
} | {
    type: "pdf";
    file: {
        filePath: string;
        base64: string;
        originalSize: number;
    };
} | {
    type: "parts";
    file: {
        filePath: string;
        originalSize: number;
        count: number;
        outputDir: string;
    };
    firstPage?: number;
    pages?: {
        base64: string;
        mediaType: "image/jpeg" | "image/png" | "image/gif" | "image/webp";
        error?: string;
    }[];
} | {
    type: "file_unchanged";
    file: {
        filePath: string;
    };
    source?: "seeded";
};

Sources

RemoteTriggerManage cloud schedules.

Subscriber cloud schedules and organization policy; hosted-provider restrictions.

InputPublished TypeScript

FieldTypeRequiredMeaning and defaults
action"list" | "get" | "create" | "update" | "run" | "create_webhook_trigger" | "list_runs" | "get_run_log"Yes
trigger_idstringNoRequired for get, update, run, and list_runs
session_idstringNoRequired for get_run_log: a run session id (cse_… or session_…, from list_runs)
cursorstringNonext_cursor from a previous list_runs or get_run_log page
body{ [k: string]: unknown; }NoRequired for create and update; optional for run
Full input definition
export interface RemoteTriggerInput {
    action: "list" | "get" | "create" | "update" | "run" | "create_webhook_trigger" | "list_runs" | "get_run_log";
    trigger_id?: string;
    session_id?: string;
    cursor?: string;
    body?: {
        [k: string]: unknown;
    };
}

ResultPublished TypeScript

FieldTypeRequiredMeaning and defaults
statusnumberYes
jsonstringYes
summarystringNo
Full result definition
export interface RemoteTriggerOutput {
    status: number;
    json: string;
    summary?: string;
}

Sources

ReportFindingsPresent structured code-review findings.

Built in. The model, platform, mode, tool settings and permission rules can still remove it.

InputPublished TypeScript

FieldTypeRequiredMeaning and defaults
level"low" | "medium" | "high" | "xhigh" | "max"NoEffort level the review ran at
findings{ file: string; line?: number; summary: string; short_summary?: string; failure_scenario: string; category?: string; verdict?: "CONFIRMED" | "PLAUSIBLE"; outcome?: "fixed" | "skipped" | "no_change_needed"; }[]YesVerified findings, most-severe first; empty if none survived
Full input definition
export interface ReportFindingsInput {
    level?: "low" | "medium" | "high" | "xhigh" | "max";
    findings: {
        file: string;
        line?: number;
        summary: string;
        short_summary?: string;
        failure_scenario: string;
        category?: string;
        verdict?: "CONFIRMED" | "PLAUSIBLE";
        outcome?: "fixed" | "skipped" | "no_change_needed";
    }[];
}

ResultPublished TypeScript

FieldTypeRequiredMeaning and defaults
countnumberYesNumber of findings reported
level"low" | "medium" | "high" | "xhigh" | "max"NoEffort level the review ran at
findings{ file: string; line?: number; summary: string; short_summary?: string; failure_scenario: string; category?: string; verdict?: "CONFIRMED" | "PLAUSIBLE"; outcome?: "fixed" | "skipped" | "no_change_needed"; }[]YesEchoed for the result body
Full result definition
export interface ReportFindingsOutput {
    count: number;
    level?: "low" | "medium" | "high" | "xhigh" | "max";
    findings: {
        file: string;
        line?: number;
        summary: string;
        short_summary?: string;
        failure_scenario: string;
        category?: string;
        verdict?: "CONFIRMED" | "PLAUSIBLE";
        outcome?: "fixed" | "skipped" | "no_change_needed";
    }[];
}

Sources

ScheduleWakeupChoose the next loop iteration.

Built in. The model, platform, mode, tool settings and permission rules can still remove it.

InputPublished TypeScript

FieldTypeRequiredMeaning and defaults
delaySecondsnumberNoSeconds from now to wake up. Clamped to [60, 3600] by the runtime. Required unless stop is true.
reasonstringNoOne short sentence explaining the chosen delay. Goes to telemetry and is shown to the user. Be specific. Required unless stop is true.
promptstringNoThe /loop input to fire on wake-up. Pass the same /loop input verbatim each turn so the next firing re-enters the skill and continues the loop. For autonomous /loop (no user prompt), pass the literal sentinel <<autonomous-loop-dynamic>> instead (the dynamic-pacing variant, not the CronCreate-mode <<autonomous-loop>>). Required unless stop is true.
stopbooleanNoSet to true to end the dynamic loop immediately instead of scheduling another wakeup. When true, all other fields are ignored and no further wakeups fire.
noopbooleanNotrue = nothing changed (you checked and there is nothing to report). false = something happened worth keeping (edited a file, posted a message, advanced state, surfaced a finding). Consecutive noop:true ticks are collapsed in the user's terminal view and tracked as a streak. Required unless stop is true.
Full input definition
export interface ScheduleWakeupInput {
    delaySeconds?: number;
    reason?: string;
    prompt?: string;
    stop?: boolean;
    noop?: boolean;
}

ResultPublished TypeScript

FieldTypeRequiredMeaning and defaults
scheduledFornumberYesEpoch ms timestamp when the next wakeup will fire
clampedDelaySecondsnumberYesActual delay used after clamping to runtime bounds
wasClampedbooleanYesTrue if the requested delaySeconds was outside [60, 3600]
stoppedbooleanNoTrue when the model ended the loop via stop: true
cancelledWakeupsnumberNoHow many pending dynamic-loop wakeups stop:true cancelled. 0 means nothing was pending — a recurring /loop cron is not cancelled by stop:true.
Full result definition
export interface ScheduleWakeupOutput {
    scheduledFor: number;
    clampedDelaySeconds: number;
    wasClamped: boolean;
    stopped?: boolean;
    cancelledWakeups?: number;
}

Sources

SendFeedbackPrepare a feedback draft for review.

Built in. The model, platform, mode, tool settings and permission rules can still remove it.

InputPublished TypeScript

FieldTypeRequiredMeaning and defaults
type"bug" | "idea" | "missing_capability"YesWhat kind of feedback this is.
titlestringYesShort, specific one-line summary of the issue.
detailsstringYesLabeled bullets, in order: **What happened:** (observed vs. expected, exact error text if short); **What the user said:** (quoted, or "User didn't comment; observed by the model."); **Repro:** (minimal steps); **Evidence:** (request IDs, timestamps, paths, versions; omit if none); optionally a final **Cause:** only if verified in-session. One to three lines per bullet. No narrative paragraphs, no speculation, no secrets.
areastringNoOptional short tag naming the part of Claude Code this is about (e.g. "hooks config", "/help", "file editing"). Leave blank if unclear.
failure_mode"instruction_following" | "destructive_actions" | "code_quality" | "repetition_and_looping" | "model_regression" | "overconfidence_and_hallucination" | "context_and_memory" | "overeager" | "over_correction" | "stopping_short" | "dispute_or_decline" | "subagent_overspawn" | "tone_or_preachiness" | "excessive_questions" | "unwanted_scope" | "other"NoWhen the report is about MODEL BEHAVIOR (not a product bug), the closest failure mode, or other when it is a model-behavior issue that fits no listed value. Omit only when the report is a product/tool bug with no model-behavior component.
task_category"code_edit" | "debug" | "explain" | "plan" | "shell" | "search" | "review" | "other"NoWhat kind of task the session was doing when the issue occurred, or other when it is a clear task that fits no listed value. Omit only if genuinely unclear.
Full input definition
export interface SendFeedbackInput {
    type: "bug" | "idea" | "missing_capability";
    title: string;
    details: string;
    area?: string;
    failure_mode?: "instruction_following" | "destructive_actions" | "code_quality" | "repetition_and_looping" | "model_regression" | "overconfidence_and_hallucination" | "context_and_memory" | "overeager" | "over_correction" | "stopping_short" | "dispute_or_decline" | "subagent_overspawn" | "tone_or_preachiness" | "excessive_questions" | "unwanted_scope" | "other";
    task_category?: "code_edit" | "debug" | "explain" | "plan" | "shell" | "search" | "review" | "other";
}

ResultPublished TypeScript

FieldTypeRequiredMeaning and defaults
successbooleanYes
messagestringYes
Full result definition
export interface SendFeedbackOutput {
    success: boolean;
    message: string;
}

Failures and lifecycle

  • Creates a local draft; user review/send is a later action. Tool success does not prove feedback transmission.

Sources

SendMessageMessage another agent.

Reachability depends on local agents, team membership, remote connection and cross-session messaging enablement (>=2.1.224 for sessions).

InputSchema unavailable

ResultSchema unavailable

Sources

SendUserFileDeliver a generated file.

Remote Control client connected or cloud session; hosted delivery provider restrictions.

InputSchema unavailable

ResultSchema unavailable

Sources

ShareOnboardingGuideShare the onboarding guide.

Team/Enterprise subscription and onboarding workflow.

InputSchema unavailable

ResultSchema unavailable

Sources

SkillInvoke a skill in the conversation.

Built in. The model, platform, mode, tool settings and permission rules can still remove it.

InputSchema unavailable

ResultSchema unavailable

Sources

SubagentHandbackSubmit the final subagent report for review.

Auto-mode local non-fork Agent subagents only; CLI >=2.1.271. Classifier reviews the report.

InputSchema unavailable

ResultSchema unavailable

Sources

TaskCreateCreate a tracked task.

Model-dependent task-tracking exposure; opt-in for other models. Shared task list behavior differs in subagents/teams.

InputPublished TypeScript

FieldTypeRequiredMeaning and defaults
subjectstringYesA brief title for the task
descriptionstringYesWhat needs to be done
activeFormstringNoPresent continuous form shown in spinner when in_progress (e.g., "Running tests")
metadata{ [k: string]: unknown; }NoArbitrary metadata to attach to the task
Full input definition
export interface TaskCreateInput {
    subject: string;
    description: string;
    activeForm?: string;
    metadata?: {
        [k: string]: unknown;
    };
}

ResultPublished TypeScript

FieldTypeRequiredMeaning and defaults
task{ id: string; subject: string; }Yes
Full result definition
export interface TaskCreateOutput {
    task: {
        id: string;
        subject: string;
    };
}

Sources

TaskGetRead one tracked task.

Model-dependent task-tracking exposure; opt-in for other models. Shared task list behavior differs in subagents/teams.

InputPublished TypeScript

FieldTypeRequiredMeaning and defaults
taskIdstringYesThe ID of the task to retrieve
Full input definition
export interface TaskGetInput {
    taskId: string;
}

ResultPublished TypeScript

FieldTypeRequiredMeaning and defaults
task{ id: string; subject: string; description: string; status: "pending" | "in_progress" | "completed"; blocks: string[]; blockedBy: string[]; } | nullYes
Full result definition
export interface TaskGetOutput {
    task: {
        id: string;
        subject: string;
        description: string;
        status: "pending" | "in_progress" | "completed";
        blocks: string[];
        blockedBy: string[];
    } | null;
}

Sources

TaskListList tracked tasks.

Model-dependent task-tracking exposure; opt-in for other models. Shared task list behavior differs in subagents/teams.

InputPublished TypeScript

Full input definition
export interface TaskListInput {
}

ResultPublished TypeScript

FieldTypeRequiredMeaning and defaults
tasks{ id: string; subject: string; status: "pending" | "in_progress" | "completed"; owner?: string; blockedBy: string[]; }[]Yes
Full result definition
export interface TaskListOutput {
    tasks: {
        id: string;
        subject: string;
        status: "pending" | "in_progress" | "completed";
        owner?: string;
        blockedBy: string[];
    }[];
}

Sources

TaskStopStop a background task or agent.

Built in. The model, platform, mode, tool settings and permission rules can still remove it.

Aliases and version differences: shell_id (deprecated input alias; use task_id)

InputPublished TypeScript

FieldTypeRequiredMeaning and defaults
task_idstringNoThe ID of the background task to stop. Agent-team teammates and named background agents are also accepted by agent ID or name.
shell_idstringNoDeprecated: use task_id instead
Full input definition
export interface TaskStopInput {
    task_id?: string;
    shell_id?: string;
}

ResultPublished TypeScript

FieldTypeRequiredMeaning and defaults
messagestringYesStatus message about the operation
task_idstringYesThe ID of the task that was stopped
task_typestringYesThe type of the task that was stopped
commandstringNoThe command or description of the stopped task
Full result definition
export interface TaskStopOutput {
    message: string;
    task_id: string;
    task_type: string;
    command?: string;
}

Failures and lifecycle

  • SDK marks both task_id and deprecated shell_id optional. Do not strengthen this into a schema-level required task_id; runtime resolves the identifier and can report no matching task. Successful output requires message, task_id, task_type; command is optional.

Sources

TaskUpdateUpdate a tracked task.

Model-dependent task-tracking exposure; opt-in for other models. Shared task list behavior differs in subagents/teams.

InputPublished TypeScript

FieldTypeRequiredMeaning and defaults
taskIdstringYesThe ID of the task to update
subjectstringNoNew subject for the task
descriptionstringNoNew description for the task
activeFormstringNoPresent continuous form shown in spinner when in_progress (e.g., "Running tests")
status("pending" | "in_progress" | "completed") | "deleted"NoNew status for the task
addBlocksstring[]NoTask IDs that this task blocks
addBlockedBystring[]NoTask IDs that block this task
ownerstringNoNew owner for the task
metadata{ [k: string]: unknown; }NoMetadata keys to merge into the task. Set a key to null to delete it.
Full input definition
export interface TaskUpdateInput {
    taskId: string;
    subject?: string;
    description?: string;
    activeForm?: string;
    status?: ("pending" | "in_progress" | "completed") | "deleted";
    addBlocks?: string[];
    addBlockedBy?: string[];
    owner?: string;
    metadata?: {
        [k: string]: unknown;
    };
}

ResultPublished TypeScript

FieldTypeRequiredMeaning and defaults
successbooleanYes
taskIdstringYes
updatedFieldsstring[]Yes
errorstringNo
statusChange{ from: string; to: string; }No
Full result definition
export interface TaskUpdateOutput {
    success: boolean;
    taskId: string;
    updatedFields: string[];
    error?: string;
    statusChange?: {
        from: string;
        to: string;
    };
}

Sources

TodoWriteReplace the session checklist.

Disabled by default; CLAUDE_CODE_ENABLE_TASKS=0 can restore it where task tracking is available.

InputPublished TypeScript

FieldTypeRequiredMeaning and defaults
todos{ content: string; status: "pending" | "in_progress" | "completed"; activeForm: string; }[]YesThe updated todo list
Full input definition
export interface TodoWriteInput {
    todos: {
        content: string;
        status: "pending" | "in_progress" | "completed";
        activeForm: string;
    }[];
}

ResultPublished TypeScript

FieldTypeRequiredMeaning and defaults
oldTodos{ content: string; status: "pending" | "in_progress" | "completed"; activeForm: string; }[]YesThe todo list before the update
newTodos{ content: string; status: "pending" | "in_progress" | "completed"; activeForm: string; }[]YesThe todo list after the update
Full result definition
export interface TodoWriteOutput {
    oldTodos: {
        content: string;
        status: "pending" | "in_progress" | "completed";
        activeForm: string;
    }[];
    newTodos: {
        content: string;
        status: "pending" | "in_progress" | "completed";
        activeForm: string;
    }[];
}

Sources

ToolSearchLoad deferred tools.

Deferred tool search enabled; actual discovered MCP tools remain server-defined.

InputSchema unavailable

ResultSchema unavailable

Sources

WebFetchFetch and process a web page.

Built in. The model, platform, mode, tool settings and permission rules can still remove it.

InputPublished TypeScript

FieldTypeRequiredMeaning and defaults
urlstringYesThe URL to fetch content from
promptstringYesThe prompt to run on the fetched content
offsetnumberNoCharacter position in the page text to start reading from. Use it to read on through a page too long for one call, with the value the previous result gave.
Full input definition
export interface WebFetchInput {
    url: string;
    prompt: string;
    offset?: number;
}

ResultPublished TypeScript

FieldTypeRequiredMeaning and defaults
bytesnumberYesSize of the fetched content in bytes
codenumberYesHTTP response code
codeTextstringYesHTTP response code text
resultstringYesProcessed result from applying the prompt to the content
durationMsnumberYesTime taken to fetch and process the content
urlstringYesThe URL that was fetched
artifactRead{ slug: string; ver?: string; seeded?: false; }No
Full result definition
export interface WebFetchOutput {
    bytes: number;
    code: number;
    codeText: string;
    result: string;
    durationMs: number;
    url: string;
    artifactRead?: {
        slug: string;
        ver?: string;
        seeded?: false;
    };
}

Sources

WebSearchSearch the web.

Built in. The model, platform, mode, tool settings and permission rules can still remove it.

InputPublished TypeScript

FieldTypeRequiredMeaning and defaults
querystringYesThe search query to use
allowed_domainsstring[]NoOnly include search results from these domains
blocked_domainsstring[]NoNever include search results from these domains
Full input definition
export interface WebSearchInput {
    query: string;
    allowed_domains?: string[];
    blocked_domains?: string[];
}

ResultPublished TypeScript

FieldTypeRequiredMeaning and defaults
querystringYesThe search query that was executed
results({ tool_use_id: string; content: { title: string; url: string; snippet?: string; }[]; } | string)[]YesSearch results and/or text commentary from the model
durationSecondsnumberYesTime taken to complete the search operation
searchCountnumberNoNumber of web searches performed
Full result definition
export interface WebSearchOutput {
    query: string;
    results: ({
        tool_use_id: string;
        content: {
            title: string;
            url: string;
            snippet?: string;
        }[];
    } | string)[];
    durationSeconds: number;
    searchCount?: number;
}

Sources

WorkflowRun an orchestrated workflow.

Built in. The model, platform, mode, tool settings and permission rules can still remove it.

InputPublished TypeScript

FieldTypeRequiredMeaning and defaults
scriptstringNoSelf-contained workflow script. Must begin with export const meta = { name, description, phases } (pure literal, no computed values) followed by the script body using agent()/parallel()/pipeline()/phase().
namestringNoName of a predefined workflow (built-in or from .claude/workflows/). Resolves to a self-contained script.
descriptionstringNoIgnored — set the workflow description in the script's meta block.
titlestringNoIgnored — set the workflow title in the script's meta block.
args{ [k: string]: unknown; }NoOptional input value exposed to the script as the global args, verbatim. Pass arrays/objects as actual JSON values, NOT as a JSON-encoded string — a stringified list breaks args.filter/args.map in the script. Use for parameterized named workflows (e.g. a research question).
scriptPathstringNoPath to a workflow script file on disk. Every Workflow invocation persists its script under the session directory and returns the path in the tool result. To iterate, edit that file with Write/Edit and re-invoke Workflow with the same scriptPath instead of re-sending the full script. Takes precedence over script and name.
resumeFromRunIdstringNoRun ID of a prior Workflow invocation to resume from. Completed agent() calls with unchanged (prompt, opts) return their cached results instantly; only edited or new calls re-run. Same-session only. Stop the prior run first (TaskStop) before resuming.
Full input definition
export interface WorkflowInput {
    script?: string;
    name?: string;
    description?: string;
    title?: string;
    args?: {
        [k: string]: unknown;
    };
    scriptPath?: string;
    resumeFromRunId?: string;
}

ResultPublished TypeScript

FieldTypeRequiredMeaning and defaults
status"async_launched" | "remote_launched"Yes
taskIdstringYes
taskType"local_workflow" | "remote_agent"NoTaskType of the registered background task — 'local_workflow' for in-process runs, 'remote_agent' when remote:true dispatches to CCR. Set on all new writes; absent only on transcripts written before this field existed.
workflowNamestringNometa.name from the workflow script — same value as task_started.workflow_name. Set on all new writes; absent only on transcripts written before this field existed.
runIdstringNoLocal workflow run identifier for resumeFromRunId. Absent for remote_launched (the CCR session URL is the resume handle there) and on transcripts written before this field existed.
summarystringNo
transcriptDirstringNoDirectory where subagent transcripts are written during execution
scriptPathstringNoPath to the persisted workflow script for this invocation. Editable via Write/Edit; pass back as scriptPath to re-run without resending the script.
sessionUrlstringNoCCR session URL when status is remote_launched
warningstringNoNon-blocking heads-up (e.g. local git state diverges from the pushed branch the cloud session will clone)
errorstringNoSet if syntax check failed
Full result definition
export interface WorkflowOutput {
    status: "async_launched" | "remote_launched";
    taskId: string;
    taskType?: "local_workflow" | "remote_agent";
    workflowName?: string;
    runId?: string;
    summary?: string;
    transcriptDir?: string;
    scriptPath?: string;
    sessionUrl?: string;
    warning?: string;
    error?: string;
}

Sources

WriteWrite a file.

Built in. The model, platform, mode, tool settings and permission rules can still remove it.

Aliases and version differences: FileWrite (SDK type prefix, not a callable alias)

InputPublished TypeScript

FieldTypeRequiredMeaning and defaults
file_pathstringYesThe absolute path to the file to write (must be absolute, not relative)
contentstringYesThe content to write to the file
Full input definition
export interface FileWriteInput {
    file_path: string;
    content: string;
}

ResultPublished TypeScript

FieldTypeRequiredMeaning and defaults
type"create" | "update"YesWhether a new file was created or an existing file was updated
filePathstringYesThe path to the file that was written
contentstringYesThe content that was written to the file
structuredPatch{ oldStart: number; oldLines: number; newStart: number; newLines: number; lines: string[]; }[]YesDiff patch showing the changes (empty when nothing changed, the diff timed out, or — with originalFile null on an update — the previous content was too large to diff)
originalFilestring | nullYesThe original file content before the write (null for new files, or when the previous content was too large to include)
gitDiff{ filename: string; status: "modified" | "added"; additions: number; deletions: number; changes: number; patch: string; repository?: string | null; }No
userModifiedbooleanNoTrue when the user edited the proposed content in the permission dialog before accepting
stagedbooleanNoTrue when the write was held for the machine owner to review instead of written; the file is unchanged
Full result definition
export interface FileWriteOutput {
    type: "create" | "update";
    filePath: string;
    content: string;
    structuredPatch: {
        oldStart: number;
        oldLines: number;
        newStart: number;
        newLines: number;
        lines: string[];
    }[];
    originalFile: string | null;
    gitDiff?: {
        filename: string;
        status: "modified" | "added";
        additions: number;
        deletions: number;
        changes: number;
        patch: string;
        repository?: string | null;
    };
    userModified?: boolean;
    staged?: boolean;
}

Sources

MCP client

Work with resources on connected MCP servers.

ListMcpResourcesToolList connected MCP resources.

Built in. The model, platform, mode, tool settings and permission rules can still remove it.

InputPublished TypeScript

FieldTypeRequiredMeaning and defaults
serverstringNoOptional server name to filter resources by
Full input definition
export interface ListMcpResourcesInput {
    server?: string;
}

ResultPublished TypeScript

Full result definition
export type ListMcpResourcesOutput = {
    uri: string;
    name: string;
    mimeType?: string;
    description?: string;
    server: string;
}[];

Sources

ReadMcpResourceToolRead a resource URI.

Built in. The model, platform, mode, tool settings and permission rules can still remove it.

InputPublished TypeScript

FieldTypeRequiredMeaning and defaults
serverstringYesThe MCP server name
uristringYesThe resource URI to read
Full input definition
export interface ReadMcpResourceInput {
    server: string;
    uri: string;
}

ResultPublished TypeScript

FieldTypeRequiredMeaning and defaults
contents{ uri: string; mimeType?: string; text?: string; blobSavedTo?: string; }[]Yes
errorstringNoHuman-readable error when the server could not read the resource
Full result definition
export interface ReadMcpResourceOutput {
    contents: {
        uri: string;
        mimeType?: string;
        text?: string;
        blobSavedTo?: string;
    }[];
    error?: string;
}

Sources

WaitForMcpServersWait for pending MCP connections.

Only when tool search is disabled; otherwise ToolSearch handles wait.

InputSchema unavailable

ResultSchema unavailable

Sources

SDK types only

Published in the Agent SDK types; when the CLI offers them is not public.

ClaudeDesignPublisher SDK contract for ClaudeDesign.

Publisher SDK type only; concrete CLI/host registration and gates not established.

InputPublished TypeScript

FieldTypeRequiredMeaning and defaults
operationstringYesClaude Design action to perform. Call with "list" first to discover the available operations and their argument schemas.
arguments{ [k: string]: unknown; }YesAction input object (server-validated). Pass {} for operations that take no input.
Full input definition
export interface ClaudeDesignInput {
    operation: string;
    arguments: {
        [k: string]: unknown;
    };
}

ResultPublished TypeScript

FieldTypeRequiredMeaning and defaults
operationstringYes
content{ [k: string]: unknown; }[]Yes
isErrorbooleanNo
Full result definition
export interface ClaudeDesignOutput {
    operation: string;
    content: {
        [k: string]: unknown;
    }[];
    isError?: boolean;
}

Sources

OfferChromeSetupPublisher SDK contract for OfferChromeSetup.

Publisher SDK type only; concrete CLI/host registration and gates not established.

InputPublished TypeScript

FieldTypeRequiredMeaning and defaults
reasonstringNoA short phrase naming what the task needs the user's own browser for.
Full input definition
export interface OfferChromeSetupInput {
    reason?: string;
}

ResultPublished TypeScript

FieldTypeRequiredMeaning and defaults
outcome"connected" | "not_now" | "no_attempt_yet"Yes
Full result definition
export interface OfferChromeSetupOutput {
    outcome: "connected" | "not_now" | "no_attempt_yet";
}

Sources

ProjectsPublisher SDK contract for Projects.

Publisher SDK type only; concrete CLI/host registration and gates not established.

InputPublished TypeScript

FieldTypeRequiredMeaning and defaults
method"project_info" | "project_read" | "project_search" | "project_write" | "project_delete" | "project_memory_list" | "project_memory_read"Yes
pathstringNoproject_read/project_write/project_delete: doc path. project_write: an existing path is replaced in place; a new bare filename (no "/") is namespaced to "claude/<name>". project_memory_read: memory file path as listed by project_memory_list.
contentstringNoproject_write: inline doc text. Mutually exclusive with local_path. Use local_path for anything you have on disk.
local_pathstringNoproject_write: a file inside the working directory to upload. The tool reads, encodes, and uploads directly — contents never enter your context. Mutually exclusive with content.
present_to_userbooleanNoproject_write: true marks this doc as the file the user needs to see — the deliverable they asked for or must act on. Defaults to false; leave it unset for routine saves, notes, and bulk writes.
querystringNoproject_search: knowledge-base query
nnumberNoproject_search: number of hits (default 5)
Full input definition
export interface ProjectsInput {
    method: "project_info" | "project_read" | "project_search" | "project_write" | "project_delete" | "project_memory_list" | "project_memory_read";
    path?: string;
    content?: string;
    local_path?: string;
    present_to_user?: boolean;
    query?: string;
    n?: number;
}

ResultPublished TypeScript

Full result definition
export type ProjectsOutput = {
    method: "project_info";
    notice?: string;
    name: string;
    description: string;
    instructions: string;
    docs: {
        path: string;
        created_at: string | null;
    }[];
    files?: {
        path: string;
        file_kind: string;
        created_at: string | null;
    }[];
    sync_sources?: {
        type: string | null;
        config: {
            [k: string]: unknown;
        };
    }[];
    knowledge: {
        knowledge_size: number;
        max_knowledge_size: number;
    };
} | {
    method: "project_read";
    notice?: string;
    path: string;
    file_kind?: string;
    content?: string;
    local_file?: string;
    created_at: string | null;
} | {
    method: "project_search";
    notice?: string;
    rag: boolean;
    hits?: {
        name?: string;
        doc_uuid?: string;
        text?: string;
    }[];
    docs?: string[];
} | {
    method: "project_write";
    notice?: string;
    path: string;
    doc_uuid: string;
    replaced: boolean;
    present_to_user?: boolean;
    local_path?: string;
} | {
    method: "project_delete";
    notice?: string;
    path: string;
    deleted: boolean;
} | {
    method: "project_memory_list";
    notice?: string;
    files: {
        path: string;
        size_bytes: number;
        updated_at: string | null;
        truncated: boolean;
    }[];
    truncated: boolean;
} | {
    method: "project_memory_read";
    notice?: string;
    path: string;
    content?: string;
    local_file?: string;
    size_bytes: number;
    updated_at: string | null;
    truncated: boolean;
};

Sources

ProposeGoalPublisher SDK contract for ProposeGoal.

Publisher SDK type only; concrete CLI/host registration and gates not established.

InputPublished TypeScript

FieldTypeRequiredMeaning and defaults
conditionstringYesThe completion condition to propose, written so a separate evaluator can verify it from the conversation (e.g. "all tests in test/auth pass (bun test exits 0)"). At most 500 characters — the user must be able to read the whole condition in the approval dialog.
ask_userbooleanNoWhether to ask the user for approval before the goal is set. Defaults to true — an approval dialog is shown. Set false ONLY when the user's own words in this conversation stated this outcome as what they want; the goal is then set directly, with a visible notice in the transcript, and the user can clear it with /goal clear.
Full input definition
export interface ProposeGoalInput {
    condition: string;
    ask_user?: boolean;
}

ResultPublished TypeScript

FieldTypeRequiredMeaning and defaults
conditionstringYesThe condition shown to the user for approval, or set directly when ask_user was false
askUserbooleanYesWhether the user was asked for approval (true) or the goal was set directly (false)
Full result definition
export interface ProposeGoalOutput {
    condition: string;
    askUser: boolean;
}

Sources

ProposeSkillsPublisher SDK contract for ProposeSkills.

Publisher SDK type only; concrete CLI/host registration and gates not established.

InputPublished TypeScript

FieldTypeRequiredMeaning and defaults
proposals[ { name: string; kind: "new" | "improvement"; target?: string; description: string; evidence?: string[]; skillMd: string; } ] | [ { name: string; kind: "new" | "improvement"; target?: string; description: string; evidence?: string[]; skillMd: string; }, { name: string; kind: "new" | "improvement"; target?: string; description: string; evidence?: string[]; skillMd: string; } ] | [ { name: string; kind: "new" | "improvement"; target?: string; description: string; evidence?: string[]; skillMd: string; }, { name: string; kind: "new" | "improvement"; target?: string; description: string; evidence?: string[]; skillMd: string; }, { name: string; kind: "new" | "improvement"; target?: string; description: string; evidence?: string[]; skillMd: string; } ]Yes
Full input definition
export interface ProposeSkillsInput {
    proposals: [
        {
            name: string;
            kind: "new" | "improvement";
            target?: string;
            description: string;
            evidence?: string[];
            skillMd: string;
        }
    ] | [
        {
            name: string;
            kind: "new" | "improvement";
            target?: string;
            description: string;
            evidence?: string[];
            skillMd: string;
        },
        {
            name: string;
            kind: "new" | "improvement";
            target?: string;
            description: string;
            evidence?: string[];
            skillMd: string;
        }
    ] | [
        {
            name: string;
            kind: "new" | "improvement";
            target?: string;
            description: string;
            evidence?: string[];
            skillMd: string;
        },
        {
            name: string;
            kind: "new" | "improvement";
            target?: string;
            description: string;
            evidence?: string[];
            skillMd: string;
        },
        {
            name: string;
            kind: "new" | "improvement";
            target?: string;
            description: string;
            evidence?: string[];
            skillMd: string;
        }
    ];
}

ResultPublished TypeScript

FieldTypeRequiredMeaning and defaults
proposalCountnumberYesNumber of proposals shown on the review card
Full result definition
export interface ProposeSkillsOutput {
    proposalCount: number;
}

Sources

ReadMcpResourceDirToolPublisher SDK contract for ReadMcpResourceDirTool.

Publisher SDK type only; concrete CLI/host registration and gates not established.

InputPublished TypeScript

FieldTypeRequiredMeaning and defaults
serverstringYesThe MCP server name
uristringYesThe directory resource URI to list
Full input definition
export interface ReadMcpResourceDirInput {
    server: string;
    uri: string;
}

ResultPublished TypeScript

FieldTypeRequiredMeaning and defaults
resources{ uri: string; name: string; mimeType?: string; }[]YesDirect children of the directory resource. Subdirectories appear with mimeType "inode/directory".
errorstringNoHuman-readable error when the server could not list the directory
Full result definition
export interface ReadMcpResourceDirOutput {
    resources: {
        uri: string;
        name: string;
        mimeType?: string;
    }[];
    error?: string;
}

Sources

ReadNotificationsPublisher SDK contract for ReadNotifications.

Publisher SDK type only; concrete CLI/host registration and gates not established.

InputPublished TypeScript

Full input definition
export interface ReadNotificationsInput {
}

ResultPublished TypeScript

FieldTypeRequiredMeaning and defaults
notifications{ notification_id: string; origin: string; queued_at: string; content: string; arrived_at?: string; }[]Yes
remainingnumberYesNotifications still queued after this drain (drains are size-budgeted); call the tool again to read them.
read_atstringNoRFC3339 timestamp, by this machine's clock, of when this call read the queue. Missing from results saved before this field existed.
Full result definition
export interface ReadNotificationsOutput {
    notifications: {
        notification_id: string;
        origin: string;
        queued_at: string;
        content: string;
        arrived_at?: string;
    }[];
    remaining: number;
    read_at?: string;
}

Sources

RefreshMcpToolsPublisher SDK contract for RefreshMcpTools.

Publisher SDK type only; concrete CLI/host registration and gates not established.

InputPublished TypeScript

FieldTypeRequiredMeaning and defaults
serverstringNoOptional server name: refresh only this server. Omit to refresh all connected servers.
Full input definition
export interface RefreshMcpToolsInput {
    server?: string;
}

ResultPublished TypeScript

Full result definition
export type RefreshMcpToolsOutput = {
    server: string;
    status: "refreshed" | "error" | "not_connected";
    toolCount?: number;
    added?: string[];
    removed?: string[];
    error?: string;
}[];

Sources

ShowOnboardingRolePickerPublisher SDK contract for ShowOnboardingRolePicker.

Publisher SDK type only; concrete CLI/host registration and gates not established.

InputPublished TypeScript

Full input definition
export interface ShowOnboardingRolePickerInput {
}

ResultPublished TypeScript

FieldTypeRequiredMeaning and defaults
rolestringNo
dismissedbooleanNo
Full result definition
export interface ShowOnboardingRolePickerOutput {
    role?: string;
    dismissed?: boolean;
}

Sources

Removed

Kept for old transcripts and SDK code.

REPLExecute in the historical experimental REPL.

Removed in CLI 2.1.275. Experimental through 2.1.274 with CLAUDE_CODE_REPL=1. Historical contract unavailable.

InputSchema unavailable

ResultSchema unavailable

Sources

TaskOutputRead background task output (historical).

Removed in CLI 2.1.277; retained only as a historical name. Use Read on the background output file.

InputSchema unavailable

ResultSchema unavailable

Sources

How the Claude Code contracts were sourced

Checked 2026-10-27 against source revision @anthropic-ai/claude-agent-sdk@0.3.310. Inputs: 43 Published TypeScript; 13 Schema unavailable. Results: 43 Published TypeScript; 13 Schema unavailable.

  • No model-driven runtime probe was run.
  • Arbitrary host extensions, dynamic tools, MCP servers and future/closed-source tools are open-ended; universal inventory completeness is not claimed.
  • Hosted service internals and runtime catalog overrides are not established by source/type inspection.
  • Publisher-generated TypeScript; preserves required keys, unions, literals and tuples. Defaults, runtime bounds and extra-key rejection are not inferred from types.
  • CLI tool_use input and tool_result content are separate from SDK structured results. Permission/hook denial may prevent execution; is_error/content does not imply the success type.
  • No model execution or destructive tool probe was run. Closed-source CLI internals and hosted implementation are unavailable.
  • The pinned SDK does not publish this tool input type. Documentation confirms tool identity/behavior only; examples do not establish a complete schema.
  • No complete result type in the pinned publisher SDK. Text/examples are not an exhaustive result schema.