Documentation

Everything you need to deploy SuperFastClaw and connect your AI to the world.

Installation

Prerequisites

Clone & build

git clone https://github.com/kaushikdharamshi/superfastclaw-releases
cd superfastclaw

# Build a static binary (no CGO, no libc dependency)
CGO_ENABLED=0 go build -ldflags="-s -w" -o superfastclaw ./cmd/superfastclawbash
The resulting binary is typically under 8 MB and has zero runtime dependencies. Copy it anywhere and run it.

Cross-compile for other platforms

# Linux amd64
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build ./cmd/superfastclaw

# Linux arm64 (Raspberry Pi, AWS Graviton)
GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build ./cmd/superfastclaw

# Windows
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build ./cmd/superfastclawbash

Configuration

Copy the example config and fill in your secrets. All values support ${ENV_VAR} expansion.

cp config.example.yaml config.yaml
$EDITOR config.yamlbash

Minimal config

gateway:
  host: "127.0.0.1"
  port: 18789

providers:
  anthropic:
    enabled: true
    api_key: "${ANTHROPIC_API_KEY}"
    default: "claude-sonnet-4-6"

channels:
  telegram:
    enabled: true
    adapter: telegram
    accounts:
      - id: main
        token: "${TELEGRAM_BOT_TOKEN}"
        name: "MyBot"yaml

Gateway options

KeyTypeDefaultDescription
gateway.hoststring127.0.0.1Bind address for the WebSocket server
gateway.portint18789TCP port (1–65535)
gateway.max_connectionsint100Max concurrent WebSocket clients
gateway.read_timeoutduration30sWebSocket read deadline
gateway.write_timeoutduration30sWebSocket write deadline
gateway.ping_intervalduration20sKeepalive ping interval

Session options

KeyTypeDefaultDescription
session.max_historyint200Max messages kept per session
session.ttlduration24hSession expiry after last message
session.persist_pathstring""Directory to persist sessions (empty = memory only)

Security options

security:
  tokens: ["your-secret-token"]   # require Bearer auth on WS
  allow_origins: ["https://myapp.com"]

allowlist:
  mode: allowlist   # open | allowlist | denylist
  users: ["telegram:123456789"]
  groups: ["slack:C12345"]yaml

Running

  1. Set your API key Export the environment variable before starting. The config reads it via ${ANTHROPIC_API_KEY}.
  2. Start the gateway Run the binary with your config path. Use --config flag or place config.yaml in the working directory.
  3. Verify health The gateway exposes a /health HTTP endpoint. A 200 OK means it's running.
export ANTHROPIC_API_KEY=sk-ant-...
export TELEGRAM_BOT_TOKEN=123456:ABC...

./superfastclaw start --config config.yaml

# In another terminal:
curl http://127.0.0.1:18789/health
# → {"status":"ok","uptime":"3.4s","connections":0}bash

Build Flags

FlagEffect
CGO_ENABLED=0Produce a pure-Go static binary — no libc, runs on any Linux/macOS/Windows
-ldflags="-s -w"Strip debug symbols (~40% size reduction). Safe on Linux; avoid on macOS Sequoia due to LC_UUID bug in older Go versions.
-trimpathRemove local build paths from the binary (good for reproducible builds)

WebSocket Gateway

Connect to ws://127.0.0.1:18789/ws. All messages are JSON. The gateway uses a simple request/response/event model.

// Request frame
{
  "id": "req-1",
  "method": "chat.send",
  "payload": {
    "session_id": "sess-abc",
    "content": "Hello!"
  }
}

// Response frame
{
  "id": "req-1",
  "ok": true,
  "payload": { ... }
}

// Event frame (server → client, unsolicited)
{
  "event": "stream.chunk",
  "payload": {
    "session_id": "sess-abc",
    "chunk": "Hello back!"
  }
}json

Sessions

Every conversation belongs to a session. Sessions carry message history and are keyed by a unique ID. Create one before sending messages.

// Create session
{ "id":"1", "method":"sessions.create", "payload":{"provider":"anthropic","model":"claude-sonnet-4-6"} }

// Send message — streaming response arrives as stream.chunk events
{ "id":"2", "method":"chat.send", "payload":{"session_id":"sess-abc","content":"What is Go?"} }json

Providers

Three providers are supported. All use raw HTTP + SSE — no SDKs, no extra dependencies.

providers:
  anthropic:
    enabled: true
    api_key: "${ANTHROPIC_API_KEY}"
    default: "claude-sonnet-4-6"
    models:
      - claude-opus-4-6
      - claude-sonnet-4-6
      - claude-haiku-4-5-20251001

  openai:
    enabled: false
    api_key: "${OPENAI_API_KEY}"
    default: "gpt-4o"

  ollama:
    enabled: false
    base_url: "http://localhost:11434/v1"
    default: "llama3.2"
    timeout: 120syaml
Ollama requires running ollama serve locally. Pull models first: ollama pull llama3.2. Great for fully offline deployments.

Agents

Define custom agents in config.yaml. The built-in security agent requires no config.

agents:
  code-reviewer:
    provider: anthropic
    model: claude-sonnet-4-6
    system_prompt: "You are a senior engineer reviewing code for correctness."
    max_turns: 10yaml
# Run an agent via CLI
./superfastclaw agent run security --input "Audit /path/to/project"

# List available agents
./superfastclaw agent listbash

Device Registry

Register mobile or IoT devices to receive push notifications and queue offline messages.

{ "method":"device.register", "payload":{
  "device_id": "iphone-alice",
  "push_token": "abc123...",
  "platform": "ios",
  "session_id": "sess-abc"
}}json
devices:
  persist_path: "~/.superfastclaw/devices.json"
  queue_size: 100     # max offline messages per device
  queue_ttl: 24hyaml

Push Notifications

APNs (iOS)

push:
  apns:
    key_id:    "${APNS_KEY_ID}"
    team_id:   "${APNS_TEAM_ID}"
    bundle_id: "com.yourcompany.app"
    key_path:  "/path/to/AuthKey.p8"
    sandbox:   trueyaml

FCM (Android)

push:
  fcm:
    server_key: "${FCM_SERVER_KEY}"yaml
APNs JWT signing is done entirely with Go's stdlib crypto/ecdsa — no Apple SDK required. Tokens are cached for 50 minutes and auto-rotated.

MQTT (IoT)

The MQTT adapter bridges an MQTT broker to the AI gateway. IoT devices publish to devices/{id}/messages and receive AI responses at devices/{id}/responses.

channels:
  mqtt:
    enabled: true
    adapter: mqtt
    options:
      broker:       "tcp://localhost:1883"
      client_id:    "superfastclaw"
      username:     "${MQTT_USERNAME}"
      password:     "${MQTT_PASSWORD}"
      topic_prefix: "devices"
      qos:          1yaml
You need a running MQTT broker such as Mosquitto: brew install mosquitto && brew services start mosquitto

Offline with Ollama

# Install Ollama
curl -fsSL https://ollama.com/install.sh | sh

# Pull a model
ollama pull llama3.2

# Enable in config.yaml
# providers.ollama.enabled: truebash

WebSocket API Reference

All 16 methods available over WebSocket:

sessions.create sessions.get sessions.list sessions.delete chat.send chat.history agents.run agents.list device.register device.list device.push device.flush device.update_token sessions.resume sessions.watch sessions.unwatch

CLI Reference

superfastclaw start [--config path]     Start the gateway
superfastclaw agent list                List registered agents
superfastclaw agent run <id>            Run an agent
  --input "..."                         Input string
  --stdin                               Read input from stdin
  --provider anthropic                  Override provider
  --model claude-sonnet-4-6             Override model
superfastclaw version                   Print versioncli

Environment Variables

VariableDescription
ANTHROPIC_API_KEYAnthropic API key (sk-ant-...)
OPENAI_API_KEYOpenAI API key (sk-...)
TELEGRAM_BOT_TOKENToken from @BotFather
DISCORD_BOT_TOKENDiscord bot token from developer portal
SLACK_BOT_TOKENSlack xoxb- bot token
WHATSAPP_ACCESS_TOKENMeta Cloud API access token
WHATSAPP_VERIFY_TOKENMeta webhook verify token (you choose)
WHATSAPP_PHONE_NUMBER_IDPhone Number ID from Meta dashboard
MATRIX_ACCESS_TOKENMatrix client access token
TWITCH_OAUTH_TOKENTwitch OAuth token (oauth:...)
BLUEBUBBLES_PASSWORDBlueBubbles server password (iMessage)
OBSIDIAN_API_KEYObsidian Local REST API key
APNS_KEY_IDApple APNS key ID (10 chars)
APNS_TEAM_IDApple Team ID (10 chars)
FCM_SERVER_KEYFirebase Cloud Messaging server key