<!-- source: https://deepwiki.com/openclaw/openclaw/3.5-commands-and-auto-reply -->

# Commands & Auto-Reply

- docs/plugins/hooks.md
- src/agents/agent-command.live-model-switch.test.ts
- src/agents/agent-command.ts
- src/agents/agent-scope.test.ts
- src/agents/agent-scope.ts
- src/agents/cli-runner.runtime.ts
- src/agents/openclaw-tools.sessions.test.ts
- src/agents/tools/agent-step.test.ts
- src/agents/tools/agent-step.ts
- src/agents/tools/sessions-send-tool.ts
- src/agents/tools/sessions.test.ts
- src/auto-reply/get-reply-options.types.ts
- src/auto-reply/reply/agent-runner-cli-dispatch.test.ts
- src/auto-reply/reply/agent-runner-cli-dispatch.ts
- src/auto-reply/reply/agent-runner-execution.test.ts
- src/auto-reply/reply/agent-runner-execution.ts
- src/auto-reply/reply/context-text.ts
- src/auto-reply/reply/current-turn-images.ts
- src/auto-reply/reply/dispatch-acp-command-bypass.test.ts
- src/auto-reply/reply/dispatch-acp-command-bypass.ts
- src/auto-reply/reply/dispatch-acp-delivery.test.ts
- src/auto-reply/reply/dispatch-acp-delivery.ts
- src/auto-reply/reply/dispatch-acp.ts
- src/auto-reply/reply/dispatch-from-config.test.ts
- src/auto-reply/reply/dispatch-from-config.ts
- src/auto-reply/reply/effective-reply-route.test.ts
- src/auto-reply/reply/effective-reply-route.ts
- src/auto-reply/reply/followup-runner.test.ts
- src/auto-reply/reply/followup-runner.ts
- src/auto-reply/reply/get-reply-directives.ts
- src/auto-reply/reply/get-reply-run.media-only.test.ts
- src/auto-reply/reply/get-reply-run.ts
- src/auto-reply/reply/get-reply.ts
- src/auto-reply/reply/model-selection.test.ts
- src/auto-reply/reply/model-selection.ts
- src/auto-reply/reply/queue/types.ts
- src/channels/plugins/setup-helpers.test.ts
- src/commands/agent.test.ts
- src/cron/isolated-agent/run.cron-model-override-forwarding.test.ts
- src/plugin-sdk/acp-runtime-backend.ts
- src/plugin-sdk/acp-runtime.test.ts
- src/plugins/contracts/run-context-lifecycle.contract.test.ts
- src/plugins/hook-types.ts
- src/plugins/runtime/runtime-tasks.test.ts
- src/plugins/status.registry-snapshot.test.ts
- src/plugins/web-provider-runtime-shared.test.ts

This page explains OpenClaw's command registry, command detection, handler pipeline, auto-reply logic, and directive processing. The command system enables users to invoke specific functions or query state via standalone messages (e.g., `/status`, `/help`), while the auto-reply system governs how the Gateway detects commands, authorizes senders, processes directives (inline hints or persistent session flags), and orchestrates agent responses.

For detailed information, this page links to child pages:

- See Command System for command definitions, argument parsing, native platform commands, and the menu system.
- See Status & Directives for status message construction, directive parsing, and persistence.

## 3.5.1 Command System Overview

OpenClaw supports a flexible and extensible command system where commands are defined as structured entities and dispatched through a prioritized pipeline.

- Command Registry: Core built-in commands (like /help , /status , /tasks ) are managed through a centralized registry. The system matches incoming text using normalizeCommandBody src/auto-reply/commands-registry.ts 102 resolveTextCommand src/auto-reply/commands-registry.ts 103 and findCommandByNativeName src/auto-reply/commands-registry.ts 101
- Command Detection: The system identifies commands by matching normalized message bodies against aliases. isNativeCommandTurn src/auto-reply/reply/dispatch-from-config.ts 96 and resolveCommandTurnContext src/auto-reply/reply/dispatch-from-config.ts 97 are used during the reply preparation phase to determine if a message should be handled as a command rather than an LLM prompt.
- Authorization: Commands are gated by sender identity. The system checks isAuthorizedSender src/auto-reply/reply/get-reply-run.js 189 and senderIsOwner src/auto-reply/reply/get-reply-run.js 192 before executing privileged operations.
- Plugin Integration: Plugins can register custom commands using registerPluginCommand src/auto-reply/reply/dispatch-from-config.test.ts 17 which are then matched via matchPluginCommand src/auto-reply/reply/dispatch-from-config.ts 71 during message dispatch.

### Command Detection and Handler Dispatch

Title: "Command Detection and Handler Dispatch"

```

```

**Sources:** [src/auto-reply/reply/dispatch-from-config.ts71-104](https://github.com/openclaw/openclaw/blob/fbdf5937/src/auto-reply/reply/dispatch-from-config.ts#L71-L104) [src/auto-reply/reply/dispatch-from-config.test.ts17](https://github.com/openclaw/openclaw/blob/fbdf5937/src/auto-reply/reply/dispatch-from-config.test.ts#L17-L17) [src/auto-reply/commands-registry.ts101-104](https://github.com/openclaw/openclaw/blob/fbdf5937/src/auto-reply/commands-registry.ts#L101-L104) [src/auto-reply/reply/get-reply-run.js186-196](https://github.com/openclaw/openclaw/blob/fbdf5937/src/auto-reply/reply/get-reply-run.js#L186-L196)

## 3.5.2 Status & Directives

Status messages and directives provide feedback on the current session state and allow fine-grained control over agent behavior without full command syntax.

- Inline Directives: Directives like /think , /verbose , and /reasoning act as inline hints. These are handled via InlineDirectives src/auto-reply/reply/get-reply-run.js 66 and parsed during the reply preparation stage src/auto-reply/reply/get-reply-run.js 198-201
- Thinking Levels: Thinking levels (e.g., minimal , low , high ) are normalized to ensure compatibility across different providers using normalizeThinkLevel src/auto-reply/reply/get-reply-run.js 54 and resolveSupportedThinkingLevel src/auto-reply/reply/get-reply-run.js 56
- Persistence: Directives can be persisted in the session state. The system uses normalizeVerboseLevel src/auto-reply/reply/dispatch-from-config.ts 114 to apply these settings to the agent runtime.
- Status Construction: Detailed status text is built by aggregating session info and active configurations, often triggered by commands that call resolveCommandTurnContext src/auto-reply/reply/dispatch-from-config.ts 97

### Directive Processing and Session State

Title: "Directive Processing and Session State"

```

```

- Source Reply Delivery: The system determines if a reply should be visible in the source channel or restricted via resolveSourceReplyVisibilityPolicy src/auto-reply/reply/dispatch-from-config.ts 144-145

**Sources:** [src/auto-reply/reply/dispatch-from-config.ts114-145](https://github.com/openclaw/openclaw/blob/fbdf5937/src/auto-reply/reply/dispatch-from-config.ts#L114-L145) [src/auto-reply/reply/get-reply-run.js50-66](https://github.com/openclaw/openclaw/blob/fbdf5937/src/auto-reply/reply/get-reply-run.js#L50-L66) [src/agents/agent-command.ts5-12](https://github.com/openclaw/openclaw/blob/fbdf5937/src/agents/agent-command.ts#L5-L12)

## Auto-Reply Logic & Media Handling

The auto-reply system manages the end-to-end execution of an agent turn, including routing, media processing, and delivery policy.

1. Dispatch Pipeline: createReplyDispatcher src/auto-reply/reply/dispatch-from-config.test.ts 34 initializes the coordinator that handles inbound message claims and routing decisions.
2. Streaming & Coalescing: The system manages message delivery through the BlockReplyPipeline src/auto-reply/reply/agent-runner-execution.ts 103 and createBlockReplyDeliveryHandler src/auto-reply/reply/agent-runner-execution.ts 111
3. Media Handling: Inbound media is resolved via resolveCurrentTurnImages src/auto-reply/reply/agent-runner-execution.ts 104 Outbound media is processed through ReplyMediaContext src/auto-reply/reply/agent-runner-execution.ts 112-113
4. Typing Signaling: The system manages typing indicators via createTypingSignaler src/auto-reply/reply/followup-runner.ts 64 to provide user feedback during generation.
5. Deduplication: Inbound messages are deduplicated via claimInboundDedupe src/auto-reply/reply/dispatch-from-config.ts 132 to prevent race conditions.

### Auto-Reply Execution Flow

Title: "Auto-Reply Execution Flow"

```

```

- Session Persistence: After a run, the session transcript is updated via appendAssistantMessageToSessionTranscript src/auto-reply/reply/dispatch-from-config.ts 46

**Sources:** [src/auto-reply/reply/dispatch-from-config.ts1-147](https://github.com/openclaw/openclaw/blob/fbdf5937/src/auto-reply/reply/dispatch-from-config.ts#L1-L147) [src/auto-reply/reply/agent-runner-execution.ts1-122](https://github.com/openclaw/openclaw/blob/fbdf5937/src/auto-reply/reply/agent-runner-execution.ts#L1-L122) [src/auto-reply/reply/followup-runner.ts1-65](https://github.com/openclaw/openclaw/blob/fbdf5937/src/auto-reply/reply/followup-runner.ts#L1-L65) [src/auto-reply/reply/dispatch-from-config.test.ts34-37](https://github.com/openclaw/openclaw/blob/fbdf5937/src/auto-reply/reply/dispatch-from-config.test.ts#L34-L37)

## Summary

The Commands & Auto-Reply system provides the primary interface for controlling OpenClaw agents. It ensures that commands are authorized, context-aware, and provide rich feedback through the status and directive subsystems.

For deeper technical details, please consult these child pages:

- Command System
- Status & Directives
