Claw drivers are standalone binaries named claw-driver-<arch> that communicate with the claw CLI via newline-delimited JSON (NDJSON) on stdin/stdout.
Drivers are discovered by searching:
~/.claw/drivers/$PATH
Any executable matching claw-driver-* is treated as a candidate driver.
All messages are single-line JSON objects with a "type" field.
Used to identify the driver and check compatibility.
{"type": "version_request", "source_dir": "/path/to/install"}{
"type": "version_response",
"arch": "nanoclaw",
"arch_version": "1.2.3",
"driver_version": "0.1.0",
"claw_protocol": "0.1.0",
"driver_type": "local",
"requires_config": []
}Used for auto-detecting architecture from a directory.
{"type": "probe_request", "source_dir": "/path/to/install"}{"type": "probe_response", "arch": "nanoclaw", "confidence": 0.9}List running agent instances.
{"type": "ps_request", "source_dir": "/path/to/install"}Driver emits zero or more instance messages, then a completion:
{"type": "instance", "id": "nanoclaw-main", "arch": "nanoclaw", "group": "main", "folder": "main", "jid": "...", "state": "running", "age": "3m", "is_main": true}
{"type": "ps_complete", "warnings": []}Send a prompt to an agent.
{
"type": "agent_request",
"source_dir": "/path/to/install",
"group": "main",
"jid": "",
"prompt": "What is 2+2?",
"session_id": "",
"resume_at": "",
"native": false,
"verbose": false,
"timeout": "5m",
"ephemeral": false
}native— run without a container (driver-specific; nanoclaw runs the agent-runner via Node.js). Drivers that don't support native mode may ignore this field.verbose— pipe agent-runner/container diagnostic stderr to the terminal.timeout— max duration for the agent response (Go duration string, e.g."30s","5m"). Driver kills the agent process on deadline and returnsagent_completewithstatus: "timeout".ephemeral— use a disposable workspace with no session persistence. Workspace is removed after the run. Mutually exclusive withsession_id.
Driver streams output chunks, then a completion:
{"type": "agent_output", "text": "...", "chunk": true}
{"type": "agent_complete", "session_id": "abc123", "status": "success", "input_tokens": 42, "output_tokens": 11}Status values: success, error, timeout. Omit session_id when ephemeral is true.
Stream messages from the database in real time.
{
"type": "watch_request",
"source_dir": "/path/to/install",
"group": "main",
"jid": "",
"lines": 20
}Driver emits historical messages then polls for new ones:
{"type": "message", "timestamp": "2026-03-26T10:01:33Z", "sender": "You", "content": "Hello", "is_bot": false}The driver exits when the orchestrator closes stdin.
Run health diagnostics against an installation.
{
"type": "health_request",
"source_dir": "/path/to/install",
"group": "",
"checks": ["runtime", "credentials", "database", "disk", "sessions", "groups", "skills", "image"]
}group— if non-empty, scope group-level checks to this group onlychecks— list of checks to run; omit or send[]for all
Driver emits one check_result per check, then a completion:
{"type": "check_result", "name": "runtime", "status": "pass", "detail": "docker 27.3.1"}
{"type": "check_result", "name": "disk", "status": "fail", "detail": "group dir 94% full", "remediation": "Free up space or move groups to a larger volume"}
{"type": "health_complete", "pass": 5, "warn": 1, "fail": 1}Status values: pass, warn, fail. Optional remediation field provides a suggested fix.
Drivers that don't implement health checks return {"type": "error", "code": "UNSUPPORTED"}.
List registered groups for an installation.
{"type": "groups_request", "source_dir": "/path/to/install"}Driver emits zero or more group messages, then a completion:
{"type": "group", "source_dir": "/path/to/install", "jid": "...", "name": "main", "folder": "main", "trigger": "@Andy", "is_main": true, "requires_trigger": false}
{"type": "groups_complete"}Drivers that don't support groups return {"type": "error", "code": "UNSUPPORTED"}.
List recent sessions for a group.
{"type": "sessions_request", "source_dir": "/path/to/install", "group": "main", "limit": 50}group— group name (fuzzy match) or JIDlimit— max sessions to return (default: 50)
Driver emits zero or more session messages, then a completion:
{"type": "session", "session_id": "abc123", "group": "main", "started_at": "2026-03-27T09:00:00Z", "last_active": "2026-03-27T09:45:00Z", "message_count": 12, "summary": "Reviewed deploy config"}
{"type": "sessions_complete"}Any request can result in an error:
{"type": "error", "code": "GROUP_NOT_FOUND", "message": "no group matching 'foo'"}| Code | Meaning |
|---|---|
PARSE_ERROR |
Invalid JSON received |
UNKNOWN_TYPE |
Unrecognized message type |
MISSING_PROMPT |
agent_request without a prompt |
GROUP_NOT_FOUND |
Could not resolve the specified group |
NO_RUNTIME |
No container runtime (docker/container) found |
SPAWN_ERROR |
Failed to start the agent container or process |
DB_ERROR |
Database read error |
NATIVE_NO_NODE |
--native requested but node not found in PATH |
NATIVE_NO_DIST |
--native requested but agent-runner dist not built |
UNSUPPORTED |
Driver does not implement the requested message type |
CHECK_ERROR |
A health check could not be run (distinct from a failed check) |
- The orchestrator spawns the driver binary
- Sends one NDJSON request on stdin
- Reads NDJSON responses from stdout
- For
watch_request: closes stdin to signal the driver to exit - For all others: the driver exits after sending the completion message