Configuration 🔧
CLAWDBOT reads an optional JSON5 config from~/.clawdbot/clawdbot.json (comments + trailing commas allowed).
If the file is missing, CLAWDBOT uses safe-ish defaults (embedded Pi agent + per-sender sessions + workspace ~/clawd). You usually only need a config to:
- restrict who can trigger the bot (
whatsapp.allowFrom,telegram.allowFrom, etc.) - control group allowlists + mention behavior (
whatsapp.groups,telegram.groups,discord.guilds,routing.groupChat) - customize message prefixes (
messages) - set the agent’s workspace (
agent.workspace) - tune the embedded agent (
agent) and session behavior (session) - set the agent’s identity (
identity)
New to configuration? Check out the Configuration Examples guide for complete examples with detailed explanations!
Schema + UI hints
The Gateway exposes a JSON Schema representation of the config viaconfig.schema for UI editors.
The Control UI renders a form from this schema, with a Raw JSON editor as an escape hatch.
Hints (labels, grouping, sensitive fields) ship alongside the schema so clients can render
better forms without hard-coding config knowledge.
Apply + restart (RPC)
Useconfig.apply to validate + write the full config and restart the Gateway in one step.
It writes a restart sentinel and pings the last active session after the Gateway comes back.
Params:
raw(string) — JSON5 payload for the entire configsessionKey(optional) — last active session key for the wake-up pingrestartDelayMs(optional) — delay before restart (default 2000)
gateway call):
Minimal config (recommended starting point)
Self-chat mode (recommended for group control)
To prevent the bot from responding to WhatsApp @-mentions in groups (only respond to specific text triggers):Common options
Env vars + .env
CLAWDBOT reads env vars from the parent process (shell, launchd/systemd, CI, etc.).
Additionally, it loads:
.envfrom the current working directory (if present)- a global fallback
.envfrom~/.clawdbot/.env(aka$CLAWDBOT_STATE_DIR/.env)
.env file overrides existing env vars.
You can also provide inline env vars in config. These are only applied if the
process env is missing the key (same non-overriding rule):
env.shellEnv (optional)
Opt-in convenience: if enabled and none of the expected keys are set yet, CLAWDBOT runs your login shell and imports only the missing expected keys (never overrides).
This effectively sources your shell profile.
CLAWDBOT_LOAD_SHELL_ENV=1CLAWDBOT_SHELL_ENV_TIMEOUT_MS=15000
Auth storage (OAuth + API keys)
Clawdbot stores per-agent auth profiles (OAuth + API keys) in:<agentDir>/auth-profiles.json(default:~/.clawdbot/agents/<agentId>/agent/auth-profiles.json)
~/.clawdbot/credentials/oauth.json(or$CLAWDBOT_STATE_DIR/credentials/oauth.json)
<agentDir>/auth.json(managed automatically; don’t edit manually)
~/.clawdbot/agent/*(migrated byclawdbot doctorinto~/.clawdbot/agents/<defaultAgentId>/agent/*)
- OAuth dir (legacy import only):
CLAWDBOT_OAUTH_DIR - Agent dir (default agent root override):
CLAWDBOT_AGENT_DIR(preferred),PI_CODING_AGENT_DIR(legacy)
oauth.json entries into auth-profiles.json.
Clawdbot also auto-syncs OAuth tokens from external CLIs into auth-profiles.json (when present on the gateway host):
- Claude Code →
anthropic:claude-cli- macOS: Keychain item “Claude Code-credentials” (choose “Always Allow” to avoid launchd prompts)
- Linux/Windows:
~/.claude/.credentials.json
~/.codex/auth.json(Codex CLI) →openai-codex:codex-cli
auth
Optional metadata for auth profiles. This does not store secrets; it maps
profile IDs to a provider + mode (and optional email) and defines the provider
rotation order used for failover.
identity
Optional agent identity used for defaults and UX. This is written by the macOS onboarding assistant.
If set, CLAWDBOT derives defaults (only when you haven’t set them explicitly):
messages.ackReactionfromidentity.emoji(falls back to 👀)routing.groupChat.mentionPatternsfromidentity.name(so “@Samantha” works in groups across Telegram/Slack/Discord/iMessage/WhatsApp)
wizard
Metadata written by CLI wizards (onboard, configure, doctor).
logging
- Default log file:
/tmp/clawdbot/clawdbot-YYYY-MM-DD.log - If you want a stable path, set
logging.fileto/tmp/clawdbot/clawdbot.log. - Console output can be tuned separately via:
logging.consoleLevel(defaults toinfo, bumps todebugwhen--verbose)logging.consoleStyle(pretty|compact|json)
- Tool summaries can be redacted to avoid leaking secrets:
logging.redactSensitive(off|tools, default:tools)logging.redactPatterns(array of regex strings; overrides defaults)
whatsapp.dmPolicy
Controls how WhatsApp direct chats (DMs) are handled:
"pairing"(default): unknown senders get a pairing code; owner must approve"allowlist": only allow senders inwhatsapp.allowFrom(or paired allow store)"open": allow all inbound DMs (requireswhatsapp.allowFromto include"*")"disabled": ignore all inbound DMs
clawdbot pairing list --provider whatsappclawdbot pairing approve --provider whatsapp <code>
whatsapp.allowFrom
Allowlist of E.164 phone numbers that may trigger WhatsApp auto-replies (DMs only).
If empty and whatsapp.dmPolicy="pairing", unknown senders will receive a pairing code.
For groups, use whatsapp.groupPolicy + whatsapp.groupAllowFrom.
whatsapp.accounts (multi-account)
Run multiple WhatsApp accounts in one gateway:
- Outbound commands default to account
defaultif present; otherwise the first configured account id (sorted). - The legacy single-account Baileys auth dir is migrated by
clawdbot doctorintowhatsapp/default.
telegram.accounts / discord.accounts / slack.accounts / signal.accounts / imessage.accounts
Run multiple accounts per provider (each account has its own accountId and optional name):
defaultis used whenaccountIdis omitted (CLI + routing).- Env tokens only apply to the default account.
- Base provider settings (group policy, mention gating, etc.) apply to all accounts unless overridden per account.
- Use
routing.bindings[].match.accountIdto route each account to a different agent.
routing.groupChat
Group messages default to require mention (either metadata mention or regex patterns). Applies to WhatsApp, Telegram, Discord, and iMessage group chats.
Mention types:
- Metadata mentions: Native platform @-mentions (e.g., WhatsApp tap-to-mention). Ignored in WhatsApp self-chat mode (see
whatsapp.allowFrom). - Text patterns: Regex patterns defined in
mentionPatterns. Always checked regardless of self-chat mode. - Mention gating is enforced only when mention detection is possible (native mentions or at least one
mentionPattern). - Per-agent override:
routing.agents.<agentId>.mentionPatterns(useful when multiple agents share a group).
[]):
whatsapp.groups, telegram.groups, imessage.groups, discord.guilds). When *.groups is set, it also acts as a group allowlist; include "*" to allow all groups.
To respond only to specific text triggers (ignoring native @-mentions):
Group policy (per provider)
Use*.groupPolicy to control whether group/room messages are accepted at all:
"open"(default): groups bypass allowlists; mention-gating still applies."disabled": block all group/room messages."allowlist": only allow groups/rooms that match the configured allowlist.- WhatsApp/Telegram/Signal/iMessage use
groupAllowFrom(fallback: explicitallowFrom). - Discord/Slack use channel allowlists (
discord.guilds.*.channels,slack.channels). - Group DMs (Discord/Slack) are still controlled by
dm.groupEnabled+dm.groupChannels.
Multi-agent routing (routing.agents + routing.bindings)
Run multiple isolated agents (separate workspace, agentDir, sessions) inside one Gateway. Inbound messages are routed to an agent via bindings.
routing.defaultAgentId: fallback when no binding matches (default:main).routing.agents.<agentId>: per-agent overrides.name: display name for the agent.workspace: default~/clawd-<agentId>(formain, falls back to legacyagent.workspace).agentDir: default~/.clawdbot/agents/<agentId>/agent.model: per-agent default model (provider/model), overridesagent.modelfor that agent.sandbox: per-agent sandbox config (overridesagent.sandbox).mode:"off"|"non-main"|"all"workspaceAccess:"none"|"ro"|"rw"scope:"session"|"agent"|"shared"workspaceRoot: custom sandbox workspace rootdocker: per-agent docker overrides (e.g.image,network,env,setupCommand, limits; ignored whenscope: "shared")browser: per-agent sandboxed browser overrides (ignored whenscope: "shared")prune: per-agent sandbox pruning overrides (ignored whenscope: "shared")tools: per-agent sandbox tool policy (deny wins; overridesagent.sandbox.tools)
subagents: per-agent sub-agent defaults.allowAgents: allowlist of agent ids forsessions_spawnfrom this agent (["*"]= allow any; default: only same agent)
tools: per-agent tool restrictions (overridesagent.tools; applied before sandbox tool policy).allow: array of allowed tool namesdeny: array of denied tool names (deny wins)
routing.bindings[]: routes inbound messages to anagentId.match.provider(required)match.accountId(optional;*= any account; omitted = default account)match.peer(optional;{ kind: dm|group|channel, id })match.guildId/match.teamId(optional; provider-specific)
match.peermatch.guildIdmatch.teamIdmatch.accountId(exact, no peer/guild/team)match.accountId: "*"(provider-wide, no peer/guild/team)routing.defaultAgentId
routing.bindings wins.
Per-agent access profiles (multi-agent)
Each agent can carry its own sandbox + tool policy. Use this to mix access levels in one gateway:- Full access (personal agent)
- Read-only tools + workspace
- No filesystem access (messaging/session tools only)
routing.agentToAgent (optional)
Agent-to-agent messaging is opt-in:
routing.queue
Controls how inbound messages behave when an agent run is already active.
commands (chat command handling)
Controls how chat commands are enabled across connectors.
- Text commands must be sent as a standalone message and use the leading
/(no plain-text aliases). commands.text: falsedisables parsing chat messages for commands.commands.native: trueregisters native commands on supported connectors (Discord/Slack/Telegram). Platforms without native commands still rely on text commands.commands.native: falseskips native registration; Discord/Telegram clear previously registered commands on startup. Slack commands are managed in the Slack app.commands.useAccessGroups: falseallows commands to bypass access-group allowlists/policies.
web (WhatsApp web provider)
WhatsApp runs through the gateway’s web provider. It starts automatically when a linked session exists.
Set web.enabled: false to keep it off by default.
telegram (bot transport)
Clawdbot starts Telegram only when a telegram config section exists. The bot token is resolved from TELEGRAM_BOT_TOKEN or telegram.botToken.
Set telegram.enabled: false to disable automatic startup.
Multi-account support lives under telegram.accounts (see the multi-account section above). Env tokens only apply to the default account.
- Uses Telegram
sendMessageDraft(draft bubble, not a real message). - Requires private chat topics (message_thread_id in DMs; bot has topics enabled).
/reasoning streamstreams reasoning into the draft, then sends the final answer. Retry policy defaults and behavior are documented in Retry policy.
discord (bot transport)
Configure the Discord bot by setting the bot token and optional gating:
Multi-account support lives under discord.accounts (see the multi-account section above). Env tokens only apply to the default account.
discord config section exists. The token is resolved from DISCORD_BOT_TOKEN or discord.token (unless discord.enabled is false). Use user:<id> (DM) or channel:<id> (guild channel) when specifying delivery targets for cron/CLI commands.
Guild slugs are lowercase with spaces replaced by -; channel keys use the slugged channel name (no leading #). Prefer guild ids as keys to avoid rename ambiguity.
Reaction notification modes:
off: no reaction events.own: reactions on the bot’s own messages (default).all: all reactions on all messages.allowlist: reactions fromguilds.<id>.userson all messages (empty list disables). Outbound text is chunked bydiscord.textChunkLimit(default 2000). Discord clients can clip very tall messages, sodiscord.maxLinesPerMessage(default 17) splits long multi-line replies even when under 2000 chars. Retry policy defaults and behavior are documented in Retry policy.
slack (socket mode)
Slack runs in Socket Mode and requires both a bot token and app token:
slack.accounts (see the multi-account section above). Env tokens only apply to the default account.
Clawdbot starts Slack when the provider is enabled and both tokens are set (via config or SLACK_BOT_TOKEN + SLACK_APP_TOKEN). Use user:<id> (DM) or channel:<id> when specifying delivery targets for cron/CLI commands.
Bot-authored messages are ignored by default. Enable with slack.allowBots or slack.channels.<id>.allowBots.
Reaction notification modes:
off: no reaction events.own: reactions on the bot’s own messages (default).all: all reactions on all messages.allowlist: reactions fromslack.reactionAllowliston all messages (empty list disables).
slack tool actions):
| Action group | Default | Notes |
|---|---|---|
| reactions | enabled | React + list reactions |
| messages | enabled | Read/send/edit/delete |
| pins | enabled | Pin/unpin/list |
| memberInfo | enabled | Member info |
| emojiList | enabled | Custom emoji list |
imessage (imsg CLI)
Clawdbot spawns imsg rpc (JSON-RPC over stdio). No daemon or port required.
imessage.accounts (see the multi-account section above).
Notes:
- Requires Full Disk Access to the Messages DB.
- The first send will prompt for Messages automation permission.
- Prefer
chat_id:<id>targets. Useimsg chats --limit 20to list chats. imessage.cliPathcan point to a wrapper script (e.g.sshto another Mac that runsimsg rpc); use SSH keys to avoid password prompts.
agent.workspace
Sets the single global workspace directory used by the agent for file operations.
Default: ~/clawd.
agent.sandbox is enabled, non-main sessions can override this with their
own per-scope workspaces under agent.sandbox.workspaceRoot.
agent.skipBootstrap
Disables automatic creation of the workspace bootstrap files (AGENTS.md, SOUL.md, TOOLS.md, IDENTITY.md, USER.md, and BOOTSTRAP.md).
Use this for pre-seeded deployments where your workspace files come from a repo.
agent.userTimezone
Sets the user’s timezone for system prompt context (not for timestamps in
message envelopes). If unset, Clawdbot uses the host timezone at runtime.
messages
Controls inbound/outbound prefixes and optional ack reactions.
responsePrefix is applied to all outbound replies (tool summaries, block
streaming, final replies) across providers unless already present.
ackReaction sends a best-effort emoji reaction to acknowledge inbound messages
on providers that support reactions (Slack/Discord/Telegram). Defaults to the
configured identity.emoji when set, otherwise "👀". Set it to "" to disable.
ackReactionScope controls when reactions fire:
group-mentions(default): only when a group/room requires mentions and the bot was mentionedgroup-all: all group/room messagesdirect: direct messages onlyall: all messages
talk
Defaults for Talk mode (macOS/iOS/Android). Voice IDs fall back to ELEVENLABS_VOICE_ID or SAG_VOICE_ID when unset.
apiKey falls back to ELEVENLABS_API_KEY (or the gateway’s shell profile) when unset.
voiceAliases lets Talk directives use friendly names (e.g. "voice":"Clawd").
agent
Controls the embedded agent runtime (model/thinking/verbose/timeouts).
agent.models defines the configured model catalog (and acts as the allowlist for /model).
agent.model.primary sets the default model; agent.model.fallbacks are global failovers.
agent.imageModel is optional and is only used if the primary model lacks image input.
Each agent.models entry can include:
alias(optional model shortcut, e.g./opus).params(optional provider-specific API params passed through to the model request).
- set
--thinking off, or - define
agent.models["zai/<model>"].params.thinkingyourself.
agent.models:
opus->anthropic/claude-opus-4-5sonnet->anthropic/claude-sonnet-4-5gpt->openai/gpt-5.2gpt-mini->openai/gpt-5-minigemini->google/gemini-3-pro-previewgemini-flash->google/gemini-3-flash-preview
agent.contextPruning (tool-result pruning)
agent.contextPruning prunes old tool results from the in-memory context right before a request is sent to the LLM.
It does not modify the session history on disk (*.jsonl remains complete).
This is intended to reduce token usage for chatty agents that accumulate large tool outputs over time.
High level:
- Never touches user/assistant messages.
- Protects the last
keepLastAssistantsassistant messages (no tool results after that point are pruned). - Protects the bootstrap prefix (nothing before the first user message is pruned).
- Modes:
adaptive: soft-trims oversized tool results (keep head/tail) when the estimated context ratio crossessoftTrimRatio. Then hard-clears the oldest eligible tool results when the estimated context ratio crosseshardClearRatioand there’s enough prunable tool-result bulk (minPrunableToolChars).aggressive: always replaces eligible tool results before the cutoff with thehardClear.placeholder(no ratio checks).
- Soft-trim: only for oversized tool results. Keeps the beginning + end and inserts
...in the middle.- Before:
toolResult("…very long output…") - After:
toolResult("HEAD…\n...\n…TAIL\n\n[Tool result trimmed: …]")
- Before:
- Hard-clear: replaces the entire tool result with the placeholder.
- Before:
toolResult("…very long output…") - After:
toolResult("[Old tool result content cleared]")
- Before:
- Tool results containing image blocks are skipped (never trimmed/cleared) right now.
- The estimated “context ratio” is based on characters (approximate), not exact tokens.
- If the session doesn’t contain at least
keepLastAssistantsassistant messages yet, pruning is skipped. - In
aggressivemode,hardClear.enabledis ignored (eligible tool results are always replaced withhardClear.placeholder).
mode is "adaptive" or "aggressive"):
keepLastAssistants:3softTrimRatio:0.3(adaptive only)hardClearRatio:0.5(adaptive only)minPrunableToolChars:50000(adaptive only)softTrim:{ maxChars: 4000, headChars: 1500, tailChars: 1500 }(adaptive only)hardClear:{ enabled: true, placeholder: "[Old tool result content cleared]" }
agent.blockStreamingDefault:"on"/"off"(default on).agent.blockStreamingBreak:"text_end"or"message_end"(default: text_end).agent.blockStreamingChunk: soft chunking for streamed blocks. Defaults to 800–1200 chars, prefers paragraph breaks (\n\n), then newlines, then sentences. Example:
agent.typingMode:"never" | "instant" | "thinking" | "message". Defaults toinstantfor direct chats / mentions andmessagefor unmentioned group chats.session.typingMode: per-session override for the mode.agent.typingIntervalSeconds: how often the typing signal is refreshed (default: 6s).session.typingIntervalSeconds: per-session override for the refresh interval. See /concepts/typing-indicators for behavior details.
agent.model.primary should be set as provider/model (e.g. anthropic/claude-opus-4-5).
Aliases come from agent.models.*.alias (e.g. Opus).
If you omit the provider, CLAWDBOT currently assumes anthropic as a temporary
deprecation fallback.
Z.AI models are available as zai/<model> (e.g. zai/glm-4.7) and require
ZAI_API_KEY (or legacy Z_AI_API_KEY) in the environment.
agent.heartbeat configures periodic heartbeat runs:
every: duration string (ms,s,m,h); default unit minutes. Default:30m. Set0mto disable.model: optional override model for heartbeat runs (provider/model).target: optional delivery provider (last,whatsapp,telegram,discord,slack,signal,imessage,none). Default:last.to: optional recipient override (provider-specific id, e.g. E.164 for WhatsApp, chat id for Telegram).prompt: optional override for the heartbeat body (default:Read HEARTBEAT.md if exists. Consider outstanding tasks. Checkup sometimes on your human during (user local) day time.). Overrides are sent verbatim; include aRead HEARTBEAT.md if existsline if you still want the file read.ackMaxChars: max chars allowed afterHEARTBEAT_OKbefore delivery (default: 30).
every, keep HEARTBEAT.md tiny, and/or choose a cheaper model.
agent.bash configures background bash defaults:
backgroundMs: time before auto-background (ms, default 10000)timeoutSec: auto-kill after this runtime (seconds, default 1800)cleanupMs: how long to keep finished sessions in memory (ms, default 1800000)
agent.subagents configures sub-agent defaults:
maxConcurrent: max concurrent sub-agent runs (default 1)archiveAfterMinutes: auto-archive sub-agent sessions after N minutes (default 60; set0to disable)tools.allow/tools.deny: per-subagent tool allow/deny policy (deny wins)
agent.tools configures a global tool allow/deny policy (deny wins).
This is applied even when the Docker sandbox is off.
Example (disable browser/canvas everywhere):
agent.elevated controls elevated (host) bash access:
enabled: allow elevated mode (default true)allowFrom: per-provider allowlists (empty = disabled)whatsapp: E.164 numberstelegram: chat ids or usernamesdiscord: user ids or usernames (falls back todiscord.dm.allowFromif omitted)signal: E.164 numbersimessage: handles/chat idswebchat: session ids or usernames
agent.elevatedis global (not per-agent). Availability is based on sender allowlists./elevated on|offstores state per session key; inline directives apply to a single message.- Elevated
bashruns on the host and bypasses sandboxing. - Tool policy still applies; if
bashis denied, elevated cannot be used.
agent.maxConcurrent sets the maximum number of embedded agent runs that can
execute in parallel across sessions. Each session is still serialized (one run
per session key at a time). Default: 1.
agent.sandbox
Optional Docker sandboxing for the embedded agent. Intended for non-main
sessions so they cannot access your host system.
Details: Sandboxing
Defaults (if enabled):
- scope:
"agent"(one container + workspace per agent) - Debian bookworm-slim based image
- agent workspace access:
workspaceAccess: "none"(default)"none": use a per-scope sandbox workspace under~/.clawdbot/sandboxes"ro": keep the sandbox workspace at/workspace, and mount the agent workspace read-only at/agent(disableswrite/edit)"rw": mount the agent workspace read/write at/workspace
- auto-prune: idle > 24h OR age > 7d
- tools: allow only
bash,process,read,write,edit,sessions_list,sessions_history,sessions_send,sessions_spawn(deny wins) - optional sandboxed browser (Chromium + CDP, noVNC observer)
- hardening knobs:
network,user,pidsLimit,memory,cpus,ulimits,seccompProfile,apparmorProfile
scope: "shared" means a shared container and shared workspace. No
cross-session isolation. Use scope: "session" for per-session isolation.
Legacy: perSession is still supported (true → scope: "session",
false → scope: "shared").
network: "none"; set agent.sandbox.docker.network
to "bridge" (or your custom network) if the agent needs outbound access.
Note: inbound attachments are staged into the active workspace at media/inbound/*. With workspaceAccess: "rw", that means files are written into the agent workspace.
Build the optional browser image with:
agent.sandbox.browser.enabled=true, the browser tool uses a sandboxed
Chromium instance (CDP). If noVNC is enabled (default when headless=false),
the noVNC URL is injected into the system prompt so the agent can reference it.
This does not require browser.enabled in the main config; the sandbox control
URL is injected per session.
models (custom providers + base URLs)
Clawdbot uses the pi-coding-agent model catalog. You can add custom providers
(LiteLLM, local OpenAI-compatible servers, Anthropic proxies, etc.) by writing
~/.clawdbot/agents/<agentId>/agent/models.json or by defining the same schema inside your
Clawdbot config under models.providers.
When models.providers is present, Clawdbot writes/merges a models.json into
~/.clawdbot/agents/<agentId>/agent/ on startup:
- default behavior: merge (keeps existing providers, overrides on name)
- set
models.mode: "replace"to overwrite the file contents
agent.model.primary (provider/model).
Z.AI (GLM-4.7) — provider alias support
Z.AI models are available via the built-inzai provider. Set ZAI_API_KEY
in your environment and reference the model by provider/model.
z.ai/*andz-ai/*are accepted aliases and normalize tozai/*.- If
ZAI_API_KEYis missing, requests tozai/*will fail with an auth error at runtime. - Example error:
No API key found for provider "zai". - Z.AI’s general API endpoint is
https://api.z.ai/api/paas/v4. GLM coding requests use the dedicated Coding endpointhttps://api.z.ai/api/coding/paas/v4. The built-inzaiprovider uses the Coding endpoint. If you need the general endpoint, define a custom provider inmodels.providerswith the base URL override (see the custom providers section above). - Use a fake placeholder in docs/configs; never commit real API keys.
Local models (LM Studio) — recommended setup
Best current local setup (what we’re running): MiniMax M2.1 on a beefy Mac Studio via LM Studio using the Responses API.- LM Studio must have the model loaded and the local server enabled (default URL above).
- Responses API enables clean reasoning/output separation; WhatsApp sees only final text.
- Adjust
contextWindow/maxTokensif your LM Studio context length differs.
- Supported APIs:
openai-completions,openai-responses,anthropic-messages,google-generative-ai - Use
authHeader: true+headersfor custom auth needs. - Override the agent config root with
CLAWDBOT_AGENT_DIR(orPI_CODING_AGENT_DIR) if you wantmodels.jsonstored elsewhere (default:~/.clawdbot/agents/main/agent).
session
Controls session scoping, idle expiry, reset triggers, and where the session store is written.
mainKey: direct-chat bucket key (default:"main"). Useful when you want to “rename” the primary DM thread without changingagentId.agentToAgent.maxPingPongTurns: max reply-back turns between requester/target (0–5, default 5).sendPolicy.default:allowordenyfallback when no rule matches.sendPolicy.rules[]: match byprovider,chatType(direct|group|room), orkeyPrefix(e.g.cron:). First deny wins; otherwise allow.
skills (skills config)
Controls bundled allowlist, install preferences, extra skill folders, and per-skill
overrides. Applies to bundled skills and ~/.clawdbot/skills (workspace skills
still win on name conflicts).
Fields:
allowBundled: optional allowlist for bundled skills only. If set, only those bundled skills are eligible (managed/workspace skills unaffected).load.extraDirs: additional skill directories to scan (lowest precedence).install.preferBrew: prefer brew installers when available (default: true).install.nodeManager: node installer preference (npm|pnpm|yarn, default: npm).entries.<skillKey>: per-skill config overrides.
enabled: setfalseto disable a skill even if it’s bundled/installed.env: environment variables injected for the agent run (only if not already set).apiKey: optional convenience for skills that declare a primary env var (e.g.nano-banana-pro→GEMINI_API_KEY).
browser (clawd-managed Chrome)
Clawdbot can start a dedicated, isolated Chrome/Chromium instance for clawd and expose a small loopback control server.
Profiles can point at a remote Chrome via profiles.<name>.cdpUrl. Remote
profiles are attach-only (start/stop/reset are disabled).
browser.cdpUrl remains for legacy single-profile configs and as the base
scheme/host for profiles that only set cdpPort.
Defaults:
- enabled:
true - control URL:
http://127.0.0.1:18791(CDP uses18792) - CDP URL:
http://127.0.0.1:18792(control URL + 1, legacy single-profile) - profile color:
#FF4500(lobster-orange) - Note: the control server is started by the running gateway (Clawdbot.app menubar, or
clawdbot gateway).
ui (Appearance)
Optional accent color used by the native apps for UI chrome (e.g. Talk Mode bubble tint).
If unset, clients fall back to a muted light-blue.
gateway (Gateway server mode + bind)
Use gateway.mode to explicitly declare whether this machine should run the Gateway.
Defaults:
- mode: unset (treated as “do not auto-start”)
- bind:
loopback - port:
18789(single port for WS + HTTP)
gateway.controlUi.basePathsets the URL prefix where the Control UI is served.- Examples:
"/ui","/clawdbot","/apps/clawdbot". - Default: root (
/) (unchanged).
clawdbot gatewayrefuses to start unlessgateway.modeis set tolocal(or you pass the override flag).gateway.portcontrols the single multiplexed port used for WebSocket + HTTP (control UI, hooks, A2UI).- Precedence:
--port>CLAWDBOT_GATEWAY_PORT>gateway.port> default18789. - Non-loopback binds (
lan/tailnet/auto) require auth. Usegateway.auth.token(orCLAWDBOT_GATEWAY_TOKEN). gateway.remote.tokenis only for remote CLI calls; it does not enable local gateway auth.gateway.tokenis ignored.
gateway.auth.modesets the handshake requirements (tokenorpassword).gateway.auth.tokenstores the shared token for token auth (used by the CLI on the same machine).- When
gateway.auth.modeis set, only that method is accepted (plus optional Tailscale headers). gateway.auth.passwordcan be set here, or viaCLAWDBOT_GATEWAY_PASSWORD(recommended).gateway.auth.allowTailscalecontrols whether Tailscale identity headers can satisfy auth.gateway.tailscale.mode: "serve"uses Tailscale Serve (tailnet only, loopback bind).gateway.tailscale.mode: "funnel"exposes the dashboard publicly; requires auth.gateway.tailscale.resetOnExitresets Serve/Funnel config on shutdown.
gateway.remote.urlsets the default Gateway WebSocket URL for CLI calls whengateway.mode = "remote".gateway.remote.tokensupplies the token for remote calls (leave unset for no auth).gateway.remote.passwordsupplies the password for remote calls (leave unset for no auth).
- Clawdbot.app watches
~/.clawdbot/clawdbot.jsonand switches modes live whengateway.modeorgateway.remote.urlchanges. - If
gateway.modeis unset butgateway.remote.urlis set, the macOS app treats it as remote mode. - When you change connection mode in the macOS app, it writes
gateway.mode(andgateway.remote.urlin remote mode) back to the config file.
gateway.reload (Config hot reload)
The Gateway watches ~/.clawdbot/clawdbot.json (or CLAWDBOT_CONFIG_PATH) and applies changes automatically.
Modes:
hybrid(default): hot-apply safe changes; restart the Gateway for critical changes.hot: only apply hot-safe changes; log when a restart is required.restart: restart the Gateway on any config change.off: disable hot reload.
Hot reload matrix (files + impact)
Files watched:~/.clawdbot/clawdbot.json(orCLAWDBOT_CONFIG_PATH)
hooks(webhook auth/path/mappings) +hooks.gmail(Gmail watcher restarted)browser(browser control server restart)cron(cron service restart + concurrency update)agent.heartbeat(heartbeat runner restart)web(WhatsApp web provider restart)telegram,discord,signal,imessage(provider restarts)agent,models,routing,messages,session,whatsapp,logging,skills,ui,talk,identity,wizard(dynamic reads)
gateway(port/bind/auth/control UI/tailscale)bridgediscoverycanvasHost- Any unknown/unsupported config path (defaults to restart for safety)
Multi-instance isolation
To run multiple gateways on one host, isolate per-instance state + config and use unique ports:CLAWDBOT_CONFIG_PATH(per-instance config)CLAWDBOT_STATE_DIR(sessions/creds)agent.workspace(memories)gateway.port(unique per instance)
clawdbot --dev …→ uses~/.clawdbot-dev+ shifts ports from base19001clawdbot --profile <name> …→ uses~/.clawdbot-<name>(port via config/env/flags)
docs/gateway.md for the derived port mapping (gateway/bridge/browser/canvas).
Example:
hooks (Gateway webhooks)
Enable a simple HTTP webhook endpoint on the Gateway HTTP server.
Defaults:
- enabled:
false - path:
/hooks - maxBodyBytes:
262144(256 KB)
Authorization: Bearer <token>orx-clawdbot-token: <token>or?token=<token>
POST /hooks/wake→{ text, mode?: "now"|"next-heartbeat" }POST /hooks/agent→{ message, name?, sessionKey?, wakeMode?, deliver?, provider?, to?, model?, thinking?, timeoutSeconds? }POST /hooks/<name>→ resolved viahooks.mappings
/hooks/agent always posts a summary into the main session (and can optionally trigger an immediate heartbeat via wakeMode: "now").
Mapping notes:
match.pathmatches the sub-path after/hooks(e.g./hooks/gmail→gmail).match.sourcematches a payload field (e.g.{ source: "gmail" }) so you can use a generic/hooks/ingestpath.- Templates like
{{messages[0].subject}}read from the payload. transformcan point to a JS/TS module that returns a hook action.deliver: truesends the final reply to a provider;providerdefaults tolast(falls back to WhatsApp).- If there is no prior delivery route, set
provider+toexplicitly (required for Telegram/Discord/Slack/Signal/iMessage). modeloverrides the LLM for this hook run (provider/modelor alias; must be allowed ifagent.modelsis set).
clawdbot hooks gmail setup / run):
- If
hooks.enabled=trueandhooks.gmail.accountis set, the Gateway startsgog gmail watch serveon boot and auto-renews the watch. - Set
CLAWDBOT_SKIP_GMAIL_WATCHER=1to disable the auto-start (for manual runs). - Avoid running a separate
gog gmail watch servealongside the Gateway; it will fail withlisten tcp 127.0.0.1:8788: bind: address already in use.
tailscale.mode is on, Clawdbot defaults serve.path to / so
Tailscale can proxy /gmail-pubsub correctly (it strips the set-path prefix).
canvasHost (LAN/tailnet Canvas file server + live reload)
The Gateway serves a directory of HTML/CSS/JS over HTTP so iOS/Android nodes can simply canvas.navigate to it.
Default root: ~/clawd/canvasDefault port:
18793 (chosen to avoid the clawd browser CDP port 18792)The server listens on the bridge bind host (LAN or Tailnet) so nodes can reach it. The server:
- serves files under
canvasHost.root - injects a tiny live-reload client into served HTML
- watches the directory and broadcasts reloads over a WebSocket endpoint at
/__clawdbot/ws - auto-creates a starter
index.htmlwhen the directory is empty (so you see something immediately) - also serves A2UI at
/__clawdbot__/a2ui/and is advertised to nodes ascanvasHostUrl(always used by nodes for Canvas/A2UI)
EMFILE:
- config:
canvasHost: { liveReload: false }
canvasHost.* require a gateway restart (config reload will restart).
Disable with:
- config:
canvasHost: { enabled: false } - env:
CLAWDBOT_SKIP_CANVAS_HOST=1
bridge (node bridge server)
The Gateway can expose a simple TCP bridge for nodes (iOS/Android), typically on port 18790.
Defaults:
- enabled:
true - port:
18790 - bind:
lan(binds to0.0.0.0)
lan:0.0.0.0(reachable on any interface, including LAN/Wi‑Fi and Tailscale)tailnet: bind only to the machine’s Tailscale IP (recommended for Vienna ⇄ London)loopback:127.0.0.1(local only)auto: prefer tailnet IP if present, elselan
discovery.wideArea (Wide-Area Bonjour / unicast DNS‑SD)
When enabled, the Gateway writes a unicast DNS-SD zone for _clawdbot-bridge._tcp under ~/.clawdbot/dns/ using the standard discovery domain clawdbot.internal.
To make iOS/Android discover across networks (Vienna ⇄ London), pair this with:
- a DNS server on the gateway host serving
clawdbot.internal.(CoreDNS is recommended) - Tailscale split DNS so clients resolve
clawdbot.internalvia that server
Template variables
Template placeholders are expanded inrouting.transcribeAudio.command (and any future templated command fields).
| Variable | Description | |||||
|---|---|---|---|---|---|---|
{{Body}} | Full inbound message body | |||||
{{BodyStripped}} | Body with group mentions stripped (best default for agents) | |||||
{{From}} | Sender identifier (E.164 for WhatsApp; may differ per provider) | |||||
{{To}} | Destination identifier | |||||
{{MessageSid}} | Provider message id (when available) | |||||
{{SessionId}} | Current session UUID | |||||
{{IsNewSession}} | "true" when a new session was created | |||||
{{MediaUrl}} | Inbound media pseudo-URL (if present) | |||||
{{MediaPath}} | Local media path (if downloaded) | |||||
{{MediaType}} | Media type (image/audio/document/…) | |||||
{{Transcript}} | Audio transcript (when enabled) | |||||
{{ChatType}} | "direct" or "group" | |||||
{{GroupSubject}} | Group subject (best effort) | |||||
{{GroupMembers}} | Group members preview (best effort) | |||||
{{SenderName}} | Sender display name (best effort) | |||||
{{SenderE164}} | Sender phone number (best effort) | |||||
{{Provider}} | Provider hint (whatsapp | telegram | discord | imessage | webchat | …) |
Cron (Gateway scheduler)
Cron is a Gateway-owned scheduler for wakeups and scheduled jobs. See Cron jobs for the feature overview and CLI examples.Next: Agent Runtime 🦞