8.0 KiB
summary, read_when
| summary | read_when | ||
|---|---|---|---|
| Slash commands: text vs native, config, and supported commands |
|
Slash commands
Commands are handled by the Gateway. Most commands must be sent as a standalone message that starts with /.
The host-only bash chat command uses ! <cmd> (with /bash <cmd> as an alias).
There are two related systems:
- Commands: standalone
/...messages. - Directives:
/think,/verbose,/reasoning,/elevated,/model,/queue.- Directives are stripped from the message before the model sees it.
- In normal chat messages (not directive-only), they are treated as “inline hints” and do not persist session settings.
- In directive-only messages (the message contains only directives), they persist to the session and reply with an acknowledgement.
There are also a few inline shortcuts (allowlisted/authorized senders only): /help, /commands, /status (/usage), /whoami (/id).
They run immediately, are stripped before the model sees the message, and the remaining text continues through the normal flow.
Config
{
commands: {
native: "auto",
text: true,
bash: false,
bashForegroundMs: 2000,
config: false,
debug: false,
restart: false,
useAccessGroups: true
}
}
commands.text(defaulttrue) enables parsing/...in chat messages.- On surfaces without native commands (WhatsApp/WebChat/Signal/iMessage/MS Teams), text commands still work even if you set this to
false.
- On surfaces without native commands (WhatsApp/WebChat/Signal/iMessage/MS Teams), text commands still work even if you set this to
commands.native(default"auto") registers native commands.- Auto: on for Discord/Telegram; off for Slack (until you add slash commands); ignored for providers without native support.
- Set
discord.commands.native,telegram.commands.native, orslack.commands.nativeto override per provider (bool or"auto"). falseclears previously registered commands on Discord/Telegram at startup. Slack commands are managed in the Slack app and are not removed automatically.
commands.bash(defaultfalse) enables! <cmd>to run host shell commands (/bash <cmd>is an alias; requirestools.elevatedallowlists).- When
commands.bashisfalse,/bashreplies with a short enablement hint (config keys + allowlist). commands.bashForegroundMs(default2000) controls how long bash waits before switching to background mode (0backgrounds immediately).commands.config(defaultfalse) enables/config(reads/writesclawdbot.json).commands.debug(defaultfalse) enables/debug(runtime-only overrides).commands.useAccessGroups(defaulttrue) enforces allowlists/policies for commands.
Command list
Text + native (when enabled):
/help/commands/status(show current status; includes a short provider usage/quota line when available)/usage(alias:/status)/whoami(show your sender id; alias:/id)/config show|get|set|unset(persist config to disk, owner-only; requirescommands.config: true)/debug show|set|unset|reset(runtime overrides, owner-only; requirescommands.debug: true)/cost on|off(toggle per-response usage line)/stop/restart/activation mention|always(groups only)/send on|off|inherit(owner-only)/resetor/new/think <off|minimal|low|medium|high|xhigh>(GPT-5.2 + Codex models only; aliases:/thinking,/t)/verbose on|off(alias:/v)/reasoning on|off|stream(alias:/reason; when on, sends a separate message prefixedReasoning:;stream= Telegram draft only)/elevated on|off(alias:/elev)/model <name>(alias:/models; or/<alias>fromagents.defaults.models.*.alias)/queue <mode>(plus options likedebounce:2s cap:25 drop:summarize; send/queueto see current settings)/bash <command>(host-only; alias for! <command>; requirescommands.bash: true+tools.elevatedallowlists)
Text-only:
/compact [instructions](see /concepts/compaction)! <command>(host-only; one at a time; use!poll+!stopfor long-running jobs)!poll(check output / status; accepts optionalsessionId;/bash pollalso works)!stop(stop the running bash job; accepts optionalsessionId;/bash stopalso works)
Notes:
- Commands accept an optional
:between the command and args (e.g./think: high,/send: on,/help:). /statusand/usageshow the same status output; for full provider usage breakdown, useclawdbot status --usage./costappends per-response token usage; it only shows dollar cost when the model uses an API key (OAuth hides cost)./restartis disabled by default; setcommands.restart: trueto enable it./verboseis meant for debugging and extra visibility; keep it off in normal use./reasoning(and/verbose) are risky in group settings: they may reveal internal reasoning or tool output you did not intend to expose. Prefer leaving them off, especially in group chats.- Fast path: command-only messages from allowlisted senders are handled immediately (bypass queue + model).
- Inline shortcuts (allowlisted senders only):
/help,/commands,/status(/usage),/whoami(/id) also work when embedded in text. - Unauthorized command-only messages are silently ignored, and inline
/...tokens are treated as plain text.
Security note: ! / /bash
! <cmd> and /bash <cmd> run directly on the gateway host as the gateway user. Keep this disabled unless you fully trust the sender and have locked down allowlists. Treat it like giving someone SSH access to the host.
Usage vs cost (what shows where)
- Provider usage/quota (example: “Claude 80% left”) shows up in
/statuswhen provider usage tracking is enabled. - Per-response tokens/cost is controlled by
/cost on|off(appended to normal replies). /model statusis about models/auth/endpoints, not usage.
Model selection (/model)
/model is implemented as a directive.
Examples:
/model
/model list
/model 3
/model openai/gpt-5.2
/model opus@anthropic:claude-cli
/model status
Notes:
/modeland/model listshow a compact, numbered picker (model family + available providers)./model <#>selects from that picker (and prefers the current provider when possible)./model statusshows the detailed view, including configured provider endpoint (baseUrl) and API mode (api) when available.
Debug overrides
/debug lets you set runtime-only config overrides (memory, not disk). Owner-only. Disabled by default; enable with commands.debug: true.
Examples:
/debug show
/debug set messages.responsePrefix="[clawdbot]"
/debug set whatsapp.allowFrom=["+1555","+4477"]
/debug unset messages.responsePrefix
/debug reset
Notes:
- Overrides apply immediately to new config reads, but do not write to
clawdbot.json. - Use
/debug resetto clear all overrides and return to the on-disk config.
Config updates
/config writes to your on-disk config (clawdbot.json). Owner-only. Disabled by default; enable with commands.config: true.
Examples:
/config show
/config show messages.responsePrefix
/config get messages.responsePrefix
/config set messages.responsePrefix="[clawdbot]"
/config unset messages.responsePrefix
Notes:
- Config is validated before write; invalid changes are rejected.
/configupdates persist across restarts.
Surface notes
- Text commands run in the normal chat session (DMs share
main, groups have their own session). - Native commands use isolated sessions:
- Discord:
agent:<agentId>:discord:slash:<userId> - Slack:
agent:<agentId>:slack:slash:<userId>(prefix configurable viaslack.slashCommand.sessionPrefix) - Telegram:
telegram:slash:<userId>(targets the chat session viaCommandTargetSessionKey)
- Discord:
/stoptargets the active chat session so it can abort the current run.- Slack:
slack.slashCommandis still supported for a single/clawd-style command. If you enablecommands.native, you must create one Slack slash command per built-in command (same names as/help).