#
As AI Agent technology becomes more integral to automated workflows, efficiently managing and configuring these intelligent entities is a key focus for developers and power users. OpenClaw, an AI agent framework, provides a suite of command-line tools that allow users to exert fine-grained control via instant messaging (IM) platforms (like Lark) or server terminals. This article categorizes and analyzes its core commands.
Session and Context Management
In interactions with an AI agent, “session” and “context” are core concepts. The size of the context window directly impacts the model’s memory and the cost per interaction. Effective session management ensures clear task separation and optimized resource usage.
- Query Current Status (
/status): This command retrieves detailed information about the current session. The returned data includes the OpenClaw version, the currently enabled AI Large Language Model (LLM) configuration, context capacity usage (Token count), and the session ID. Running this command before and after complex tasks or model switches can quickly verify the agent’s operational state, preventing interaction errors caused by an unclear state.
- Start a New Session (
/new): Use this command when you need to start a completely new task and want to avoid interference from previous conversation history. It creates a brand-new session, clearing both the short-term and long-term memory of the current session, which is equivalent to communicating with an “initialized” agent.
- Reset Current Session (
/reset): Unlike /new, the /reset command only clears the short-term memory of the current session (i.e., information within the context window) but retains the agent’s long-term memory, learned Skills, and user persona settings. This command is useful for switching between different but unrelated topics under the same agent persona—for example, switching from a code writing task to a content creation task. It effectively prevents context contamination.
Dynamic LLM Configuration
The OpenClaw framework supports integrating and dynamically switching between multiple AI models from different providers, allowing users to choose the most suitable model based on task requirements (such as cost, performance, or specific capabilities).
- List Available Models (
/models): This command lists all AI models configured in the system. You can use /models directly to see all model providers (e.g., Alibaba Bailian, OpenRouter), or specify a provider name (e.g., /models openrouter) to query the list of available models from that provider (e.g., gpt-5.4).
- Switch and Query the Current Model (
/model): To switch models, use the format /model [model_name]. After successful execution, subsequent conversations will be processed by the newly specified model. To verify a successful switch, you can run the /status command again or simply input /model without any parameters, which will directly return the name of the model currently in use.
System-Level Monitoring & Advanced Management
In addition to the slash commands used in the chat interface, OpenClaw also provides a set of tools executed in the deployment environment’s command-line terminal for more low-level system monitoring and management.
- Gateway and Session Status Queries: The
openclaw gateway status command is used to check the agent service’s network gateway information, which is fundamental for diagnosing network connection issues. Meanwhile, openclaw sessions list can list all active sessions on the server and their status, including each session’s token usage and the model being used, providing system administrators with a global monitoring perspective.
- Multi-Agent and Channel Management: In complex applications, a single OpenClaw instance might run multiple sub-agents with different roles and personas. The
openclaw agents list command can display detailed information for all configured sub-agents, including their names, persona descriptions, and workspace configurations. Concurrently, openclaw channels list is used to query and manage all instant messaging (IM) channels connected to the agent, facilitating unified management in multi-channel deployments.
- Querying the Skills List: An agent’s capabilities can be expanded by installing “skills”. The
openclaw skills list command can list all the skills the current agent has mastered, along with their functional descriptions, helping users understand the agent’s capability boundaries.