Skip to main content
Response types define the structure of responses sent from agent to client in reply to requests.

Initialization Responses

InitializeResponse

Response to the initialize method containing negotiated protocol version and agent capabilities.
See also: InitializeRequest

AuthenticateResponse

Response to the authenticate method.

Session Management Responses

NewSessionResponse

Response from creating a new session.
See also: NewSessionRequest

LoadSessionResponse

Response from loading an existing session.

ListSessionsResponse

UNSTABLE - Response from listing sessions.

ForkSessionResponse

UNSTABLE - Response from forking an existing session.

ResumeSessionResponse

UNSTABLE - Response from resuming a stopped session.

StopSessionResponse

UNSTABLE - Response from stopping a running session.

Prompt Responses

PromptResponse

Response to a prompt request. The agent streams updates via SessionUpdate notifications during processing.
See also: PromptRequest, SessionUpdate

Configuration Responses

SetSessionModeResponse

Response to changing the session mode.

SetSessionConfigOptionResponse

Response to updating a session configuration option.

SetSessionModelResponse

UNSTABLE - Response to changing the session model.

File System Responses

These responses are sent from client to agent.

ReadTextFileResponse

Response containing the contents of the requested file.

WriteTextFileResponse

Response confirming the file was written.

RequestPermissionResponse

Response containing the user’s permission decision.
The RequestPermissionOutcome type is a union:

Terminal Responses

These responses are sent from client to agent for terminal operations.

CreateTerminalResponse

Response containing the ID of the created terminal.

TerminalOutputResponse

Response containing the current terminal state and output.
The Terminal type includes:

ReleaseTerminalResponse

Response confirming the terminal was released.

WaitForTerminalExitResponse

Response containing the terminal’s exit status.

KillTerminalResponse

Response confirming the terminal was killed.

Error Responses

All requests may return an error response instead of a success response:
Common error codes: