Skip to main content

Overview

The zeroclaw daemon command launches the full ZeroClaw autonomous runtime. This is the recommended way to run ZeroClaw in production or as an always-on assistant. The daemon supervises and automatically restarts these components:
  • Gateway server - HTTP/WebSocket endpoint for webhooks and API access
  • Channel listeners - Telegram, Discord, Slack, WhatsApp, etc.
  • Heartbeat monitor - Health checks and status reporting
  • Cron scheduler - Scheduled task execution

Basic Usage

Command Syntax

Options

integer
Port for gateway component to listen on. Use 0 for random available port. Defaults to gateway.port in config (typically 8585).
string
Host address for gateway to bind to. Defaults to gateway.host in config (typically 127.0.0.1).Common values:
  • 127.0.0.1 - Localhost only (secure default)
  • 0.0.0.0 - All interfaces (public access)
  • Specific IP - Bind to specific network interface

Examples

Basic Daemon

Production Setup

Terminal Output

Supervised Components

Gateway Supervisor

The gateway supervisor:
  • Starts the HTTP/WebSocket gateway
  • Monitors for crashes and restarts automatically
  • Uses exponential backoff on repeated failures
  • Logs all restart events

Channel Supervisors

Each configured channel gets a supervisor that:
  • Starts the channel listener (Telegram, Discord, etc.)
  • Reconnects on network failures
  • Handles rate limits and API errors gracefully
  • Maintains separate failure tracking per channel

Heartbeat Monitor

When heartbeat.enabled = true:
  • Writes periodic status to workspace/.heartbeat
  • Tracks component health (gateway, channels, scheduler)
  • Enables external monitoring systems to detect failures

Cron Scheduler

When cron.enabled = true:
  • Loads scheduled tasks from config
  • Executes tasks at specified intervals
  • Logs execution results
  • Handles task failures gracefully

Startup Behavior

Port Conflict Detection

The daemon checks if the port is already in use before starting:
If the port is used by another process:

Component Failure Handling

  • Single component failure: Other components continue running
  • All components fail: Daemon exits with error
  • Repeated failures: Exponential backoff (1s β†’ 2s β†’ 4s β†’ … β†’ max)

Configuration

Daemon settings in config.toml:

Component Health Monitoring

Check daemon health:

Health Status Format

Running as a Service

systemd (Linux)

launchd (macOS)

Stopping the Daemon

Interactive Mode

Service Mode

Restart Strategies

Graceful Restart

Force Restart (on hang)

Logs and Monitoring

Log Locations

  • systemd: journalctl --user -u zeroclaw
  • launchd: ~/Library/Logs/zeroclaw.log
  • Direct run: stdout/stderr

Log Verbosity

Control via RUST_LOG environment variable:

Troubleshooting

Daemon Won’t Start

Component Keeps Restarting

High Memory/CPU Usage

Performance Tuning

Resource Limits

Backoff Configuration

Exit Codes

  • 0 - Success (daemon stopped gracefully)
  • 1 - Startup error (port in use, component failure)
  • 2 - Configuration error
  • 130 - Interrupted (Ctrl+C)

See Also