Chapter 11: All Chat Commands
OpenClaw users interact with the gateway through chat commands โ special messages that start with / and control the session, agent behavior, and gateway status. These commands work across every connected channel: WhatsApp, Telegram, Slack, Discord, Teams, and all others.
This chapter documents every built-in chat command with full examples.
How Chat Commands Work
When a user sends a message starting with /, the OpenClaw gateway intercepts it before passing it to the AI agent. The gateway processes the command directly and returns a system response. Commands are not sent to the AI model โ they control the framework around the model.
User sends: /reset
โ
Gateway intercepts (does NOT call AI)
โ
Gateway clears session for this user
โ
Gateway replies: "Session cleared. Starting fresh."
The Complete Command Reference
/status
Purpose: Check the gateway's current status โ which channels are online, how many sessions are active, and what model is assigned to your workspace.
Usage:
/status
Response:
OpenClaw Gateway Status
โโโโโโโโโโโโโโโโโโโโโโ
Version: 1.4.2
Uptime: 3h 47m
Channels:
โ
telegram โ connected
โ
slack โ connected
โ whatsapp โ disconnected (reconnecting...)
Your Session:
Workspace: dev-team
Agent: claude-sonnet
Messages in session: 12
Session age: 23 minutes
Tip: Use /status first when something feels wrong โ disconnected channels and wrong agents are the most common issues.
/new
Purpose: Start a completely new conversation session. Clears all previous context. The agent will have no memory of your previous messages in this session.
Usage:
/new
Response:
New session started. All previous context cleared.
How can I help you?
When to use: When switching to a completely different task and you do not want previous context to influence the agent's answers.
Alias: /reset does the same thing.
/reset
Purpose: Identical to /new โ resets the current session, clearing all conversation history.
Usage:
/reset
Response:
Session reset. Starting fresh.
/compact
Purpose: Compresses the current session's conversation history. Instead of sending all previous messages to the AI (which costs tokens), the gateway summarizes the conversation so far and replaces the full history with a condensed version.
Usage:
/compact
Response:
Session compacted.
Conversation summarized from 47 messages โ 1 summary.
Token usage reduced by ~73%.
Summary: "Working on a React authentication system. Implemented JWT login flow. Currently debugging token refresh logic in AuthService.ts."
When to use:
- When your session is getting very long and responses are slowing down
- When you have finished one task and want to preserve context but reduce cost before moving to the next
/think
Purpose: Switches the agent to extended thinking mode. In this mode, the AI takes more time before responding, showing its reasoning process. Produces better results for complex problems at the cost of higher token usage.
Usage:
/think
Or combine with a question:
/think what is the most efficient algorithm for finding duplicates in a list of 10 million items?
Response:
[Thinking mode enabled]
Let me reason through this step by step...
[Extended reasoning shown]
Answer: For 10 million items, a hash set approach gives O(n) time and O(n) space...
Disable thinking mode:
/think off
/verbose
Purpose: Enables verbose mode โ the agent shows more details in its responses, including intermediate steps, tool calls made, and reasoning explanations.
Usage:
/verbose
Example response in verbose mode:
[Verbose mode ON]
You asked: "List all TypeScript files modified this week"
I'll run a bash command to find recently modified files.
Running: find . -name "*.ts" -newer $(date -d "7 days ago" +%Y-%m-%d) -type f
Output: [list of files...]
Result: Found 14 TypeScript files modified in the last 7 days.
[List follows...]
Disable:
/verbose off
/trace
Purpose: Enables full trace logging for your session. Every API call, tool execution, token count, and latency measurement is logged. Primarily used for debugging.
Usage:
/trace
What it enables:
- Logs every message sent to and received from the AI model API
- Shows exact tool call inputs and outputs
- Shows token usage per message
- Shows latency for each step
Disable:
/trace off
Note: Trace output is in the gateway's log file (~/.openclaw/logs/openclaw.log), not in the chat. This command is for developers debugging agent behavior โ not for regular users.
/usage
Purpose: Shows your token usage and estimated API cost for the current session.
Usage:
/usage
Response:
Session Usage
โโโโโโโโโโโโ
Messages: 23
Input tokens: 18,432
Output tokens: 4,891
Total tokens: 23,323
Estimated cost (claude-sonnet):
Input: $0.0553
Output: $0.0734
Total: $0.1287
Session started: 2h 14m ago
Note: Costs are estimates based on current Anthropic pricing. Actual billing is from your API provider.
/restart
Purpose: Restarts the OpenClaw gateway daemon. Use when configuration changes have been made or when channels are behaving unexpectedly.
Usage:
/restart
Response:
Restarting gateway...
[Gateway goes offline briefly]
Gateway restarted. All channels reconnecting.
Important: This restarts the entire gateway, disconnecting all active sessions briefly. All users will see a brief outage. Use during low-traffic periods.
Permission: By default, only users in workspaces with adminCommands: true can run /restart.
Admin-Only Commands
Some commands are restricted to admin users. Configure admin access in openclaw.json:
{
"workspaces": [
{
"id": "admin",
"adminCommands": true,
"allowlist": ["987654321"]
}
]
}
Admin commands:
| Command | Description |
|---|---|
/restart | Restart the gateway daemon |
/reload | Reload config without full restart |
/ban [user-id] | Remove a user from all allowlists |
/sessions | List all active sessions across all workspaces |
/logs [n] | Show last n lines of the gateway log |
Workspace-Specific Commands
Some commands behave differently per workspace:
{
"workspaces": [
{
"id": "dev",
"disabledCommands": ["/restart", "/trace"],
"enabledCommands": ["/status", "/new", "/reset", "/compact", "/usage"]
}
]
}
Use disabledCommands to prevent regular users from running sensitive commands.
Command Reference Table
| Command | Category | Description | Token Cost |
|---|---|---|---|
/status | System | Show gateway and session status | None |
/new | Session | Start a new session | None |
/reset | Session | Reset current session | None |
/compact | Session | Compress session history | Small (summarization) |
/think | Agent | Enable extended reasoning | High |
/think off | Agent | Disable extended reasoning | None |
/verbose | Agent | Show detailed step-by-step output | Low |
/verbose off | Agent | Disable verbose output | None |
/trace | Debug | Enable full trace logging | None |
/trace off | Debug | Disable trace logging | None |
/usage | Billing | Show token and cost usage | None |
/restart | Admin | Restart the gateway | None |
/reload | Admin | Reload config without restart | None |
/sessions | Admin | List all active sessions | None |
/logs [n] | Admin | Show last n log lines | None |
Channel-Specific Notes
WhatsApp: Commands work exactly the same. Type /status and send it just like any other message.
Telegram: Commands appear in Telegram's built-in command autocomplete if you configure them via BotFather (/setcommands).
Slack: Commands appear as slash commands. The first time, Slack may ask you to approve the /status, /new, etc. commands for your workspace.
Discord: Native slash commands are registered via openclaw discord register-commands. They appear in Discord's autocomplete menu.
Next: Chapter 12 โ Configuration File Deep Dive โ Every field in openclaw.json explained with real-world examples.