clawd

Claw’d Remote Worker

Run a remote worker on any machine to let Claw’d agents execute file tools (view, edit, create, grep, glob, bash) there via a WebSocket reverse tunnel.

Three implementations:

All three speak the same protocol and offer identical functionality, including 24 browser automation tools when started with --browser.

Quick Start

TypeScript

# Using Bun (recommended)
CLAWD_WORKER_TOKEN=your-token bun packages/clawd-worker/typescript/remote-worker.ts \
  --server wss://your-clawd-server.example.com

# Using Node.js 22.4+ (with tsx)
CLAWD_WORKER_TOKEN=your-token npx tsx packages/clawd-worker/typescript/remote-worker.ts \
  --server wss://your-clawd-server.example.com

Python

CLAWD_WORKER_TOKEN=your-token python3 packages/clawd-worker/python/remote_worker.py \
  --server wss://your-clawd-server.example.com

Java

javac --source 21 --enable-preview packages/clawd-worker/java/RemoteWorker.java
CLAWD_WORKER_TOKEN=your-token java --enable-preview -cp packages/clawd-worker/java RemoteWorker \
  --server wss://your-clawd-server.example.com

CLI Options

Flag Default Description
--server <url> (required) Claw’d server WebSocket URL
--token <token> $CLAWD_WORKER_TOKEN Authentication token
--project-root <path> cwd Root directory for file operations
--name <name> hostname Worker display name
--read-only false Disable edit, create, bash tools
--browser false Enable remote browser automation via CDP
--timeout <ms> 30000 Default tool timeout (bash uses 300s)
--max-concurrent <n> 4 Max parallel tool calls
--reconnect-max <s> 300 Max reconnect backoff delay
--insecure false Disable TLS certificate verification (dev only)
--ca-cert <path> Custom CA certificate file

Token precedence: --token flag > CLAWD_WORKER_TOKEN env var.

Use env var for tokens — CLI arguments are visible in ps aux.

Server Configuration

Add worker to ~/.clawd/config.json:

{
  "worker": true
}

Or for channel-specific tokens:

{
  "worker": {
    "dev-team": ["wkr_abc123", "wkr_def456"],
    "staging": ["wkr_staging_789"]
  }
}

Config changes are hot-reloaded within 5 seconds.

Agent ↔ Worker Binding

In the Agents dialog, set the Worker field to the same token the worker uses. The agent will then execute file tools on that remote worker instead of locally.

Platform Notes

Windows

macOS

WSL2

Corporate / VDI

Security

Running as a Service

systemd (Linux)

[Unit]
Description=Clawd Remote Worker
After=network.target

[Service]
Type=simple
User=deploy
Environment=CLAWD_WORKER_TOKEN=your-token
ExecStart=/usr/bin/python3 /opt/clawd-worker/remote_worker.py --server wss://clawd.example.com --project-root /home/deploy/project
Restart=always
RestartSec=5

[Install]
WantedBy=multi-user.target

launchd (macOS)

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>Label</key>
  <string>com.clawd.remote-worker</string>
  <key>ProgramArguments</key>
  <array>
    <string>/usr/bin/python3</string>
    <string>/opt/clawd-worker/remote_worker.py</string>
    <string>--server</string>
    <string>wss://clawd.example.com</string>
  </array>
  <key>EnvironmentVariables</key>
  <dict>
    <key>CLAWD_WORKER_TOKEN</key>
    <string>your-token</string>
  </dict>
  <key>KeepAlive</key>
  <true/>
  <key>RunAtLoad</key>
  <true/>
</dict>
</plist>