Skip to content

Transport & Wire Format

CKP uses JSON-RPC 2.0 as its wire format for communication between Agents and other actors. This is consistent with MCP and enables interoperability across the ecosystem.


CKP defines a closed vocabulary of five actors. Every JSON-RPC method declares its direction using exactly two of these actors.

ActorDefinition
OperatorHuman or automation managing the agent lifecycle (start, stop, configure)
UserHuman interacting with the agent via a Channel
AgentThe Claw runtime instance executing the agent loop
PeerAnother Agent participating in a Swarm
ServiceExternal system: MCP server, memory backend, registry, sandbox runtime

Protocol messages MUST NOT use ad-hoc actor names.


All CKP messages follow standard JSON-RPC 2.0 framing:

{
"jsonrpc": "2.0",
"id": "req-001",
"method": "claw.tool.call",
"params": {
"name": "web-fetch",
"arguments": {
"url": "https://example.com/data.json"
},
"context": {
"identity": "research-assistant",
"sandbox": "network-sandbox",
"policy": "standard-policy",
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}
}

CKP defines 15 protocol methods across four groups:

WorldModel in CKP 0.3.0 is intentionally manifest- and runtime-profile-level only. It does not add new JSON-RPC methods in this release.

MethodDirectionTypePurpose
claw.initializeOperator —> AgentRequestStart agent with manifest. MUST be the first message in a session.
claw.initializedOperator —> AgentNotificationConfirm handshake complete.
claw.statusOperator —> AgentRequestQuery agent lifecycle state.
claw.shutdownOperator —> AgentRequestGraceful shutdown with drain timeout.
claw.heartbeatAgent —> OperatorNotificationProactive liveness signal (default: every 30s).
MethodDirectionTypePurpose
claw.tool.callAgent —> ServiceRequestExecute a tool. MUST include request_id for idempotency.
claw.tool.approveUser —> AgentRequestApprove a pending tool execution.
claw.tool.denyUser —> AgentRequestDeny a pending tool execution.
MethodDirectionTypePurpose
claw.swarm.delegateAgent —> PeerRequestAssign a task to a peer agent.
claw.swarm.reportPeer —> AgentRequestReturn task results.
claw.swarm.broadcastAgent —> Peer*NotificationSend message to all peers.
claw.swarm.discoverAgent —> ServiceRequestFind available peers.
MethodDirectionTypePurpose
claw.memory.queryAgent —> ServiceRequestSearch memory stores (semantic, key, time-range).
claw.memory.storeAgent —> ServiceRequestPersist information. MUST include request_id.
claw.memory.compactAgent —> ServiceRequestTrigger memory compaction.

claw.initialize is the protocol handshake. The Operator sends the protocol version, client identity, manifest, and capability request. The Agent responds with its identity, negotiated capabilities, and runtime metadata.

Two rules matter for interoperability:

  • claw.initialize MUST be the first request in a session
  • top-level capabilities: {} means the Operator is not restricting the response

That second rule is easy to misread. An empty top-level capabilities object does not mean “support nothing.” It means “report everything you actually support.” If the Operator sends explicit keys such as {"tools":{}}, the Agent should respond with the intersection of those requested groups and its real support.

Example unrestricted request:

{
"jsonrpc": "2.0",
"id": "req-init-1",
"method": "claw.initialize",
"params": {
"protocolVersion": "0.3.0",
"clientInfo": {
"name": "ckp-test",
"version": "0.3.0"
},
"manifest": {
"kind": "Claw",
"metadata": {
"name": "demo-agent",
"version": "1.0.0"
}
},
"capabilities": {}
}
}

Example restricted request:

{
"jsonrpc": "2.0",
"id": "req-init-2",
"method": "claw.initialize",
"params": {
"protocolVersion": "0.3.0",
"clientInfo": {
"name": "ckp-test",
"version": "0.3.0"
},
"manifest": {
"kind": "Claw",
"metadata": {
"name": "demo-agent",
"version": "1.0.0"
}
},
"capabilities": {
"memory": {}
}
}
}

In the second case, an L3 agent should report only memory in the response capabilities object.


Method GroupLevel 1Level 2Level 3
claw.initialize, claw.status, claw.shutdownMUSTMUSTMUST
claw.heartbeatSHOULDSHOULDMUST
claw.initializedSHOULDSHOULDSHOULD
claw.tool.call, claw.tool.approve, claw.tool.denyMUSTMUST
claw.swarm.* methodsMUST
claw.memory.* methodsMUST

If an Agent receives a method it does not support, it MUST respond with error code -32601 (Method not found).


CodeNameMeaning
-32001Protocol version not supportedclaw.initialize version mismatch
-32010Sandbox deniedTool execution blocked by Sandbox constraints
-32011Policy deniedTool execution blocked by Policy rule
-32012Approval timeoutUser did not approve within the configured timeout
-32013Approval deniedUser explicitly denied the tool execution
-32014Tool execution timeoutTool exceeded its configured timeout_ms
-32021Provider quota exceededToken or cost limit reached
CodeNameMeaning
-32700Parse errorInvalid JSON received
-32600Invalid requestMalformed JSON-RPC structure
-32601Method not foundUnknown method name
-32602Invalid paramsParams do not match method schema

Error codes in the range [-32000, -32099] are reserved for CKP-specific errors. Implementations MUST NOT use codes in this range for custom purposes.

Error responses MUST include a message field with a human-readable description. Error responses SHOULD include a data field with structured context:

{
"jsonrpc": "2.0",
"id": "req-001",
"error": {
"code": -32011,
"message": "Policy denied: rule sec-003 blocks destructive file operations",
"data": {
"rule_id": "sec-003",
"tool": "file-delete",
"action": "deny"
}
}
}

The extended error catalog (provider errors, memory errors, swarm errors) is defined in the Runtime Profile.


TransportUse CaseMCP Compatible
stdioLocal process communicationYes
HTTP/SSE (Streamable HTTP)Remote agents, registriesYes
WebSocketReal-time bidirectional (swarm coordination)Extension
Message Queue (NATS, Redis)Distributed swarmsExtension
FilesystemContainer IPCExtension

The first two transports (stdio and HTTP/SSE) are MCP-compatible. The remaining three are CKP extensions. See the Runtime Profile for framing guidance on WebSocket, Message Queue, and Filesystem transports.