Skip to main content

Module control

Module control 

Source
Expand description

Control-protocol messages exchanged over the main stream-json stdio channel.

These carry out-of-band requests that the SDK must answer synchronously, such as permission checks (can_use_tool). The shapes here mirror what the CLI emits on that channel, observed rather than specified.

Re-exportsยง

use serde::Deserialize; ๐Ÿ”’
use serde::Deserialize; ๐Ÿ”’
use serde::Serialize; ๐Ÿ”’
use serde::Serialize; ๐Ÿ”’
use serde_json::Value; ๐Ÿ”’

Structsยง

ControlRequest
A control request emitted by the claude binary. The SDK must respond with a matching ControlResponse carrying the same request_id.
ControlResponse
Control response from SDK back to the claude binary.

Enumsยง

AllowBehavior
Serialisable shape for the response field inside a successful can_use_tool response.
ControlRequestKind
Enumerates the kinds of control requests we handle.
ControlRequestType
The discriminant type for ControlRequest. Always "control_request".
ControlResponseKind
Response body, success or error.
ControlResponseType
The discriminant type for ControlResponse. Always "control_response".

Functionsยง

default_control_response_type ๐Ÿ”’