OpenClaw Advanced Configuration Complete Tutorial (2026): AGENTS.md, Memory System, Sub-Agents, Cron Tasks, Skill Development & Multi-Channel Integratio
-
How to write
AGENTS.mdfor OpenClaw? Is there a ready-to-use template? -
Why does the AI "forget" during long chats, and how to configure
memoryFlush? - How to let the AI automatically maintain memory and prevent memory decay?
- How to use Sub-Agents for parallel task processing?
- How to set up daily news summaries or automated weekly reports via Cron?
-
Step-by-step Discord integration guide (how to enable
MESSAGE CONTENT INTENT?) - How to configure a Telegram Bot for OpenClaw?
- How to develop custom Skills?
-
How to configure
memorySearchusing a free embedding API (SiliconFlowbge-m3)?
-
AGENTS.mdConfiguration — Writing a Behavioral Constitution for AI -
Memory System in Practice — Solving AI amnesia with
memoryFlush& auto-maintenance - Sub-Agent Parallel Tasks — Turning one AI into a team
- Cron Task Configuration — Minute-precise AI automation
- Skill Development Basics — Teaching AI new capabilities
- Multi-Channel Integration (Discord/Telegram) — Access your AI anywhere
-
openclaw.jsonConfiguration Cheat Sheet — Optimizing every parameter
Prerequisites: This tutorial assumes you have already installed OpenClaw and can chat normally, writtenSOUL.md/USER.md/IDENTITY.md, and understand whatMEMORY.mdandmemorySearchare.
Quick Comparison: Before vs. After This Tutorial
|
Aspect
|
Basic Setup
|
After This Tutorial
|
|---|---|---|
|
Behavior Guidelines
|
A few lines in
SOUL.md
|
Complete behavioral constitution; AI knows exactly what to do and what to avoid
|
|
Memory
|
Basic hierarchical structure
|
Auto-maintained, auto-compressed, semantic search with instant recall
|
|
Task Capability
|
Single-threaded main brain
|
One AI becomes a team; parallel task delegation
|
|
Automation
|
Basic heartbeat checks
|
Precise scheduled tasks; automated morning/evening briefings
|
|
Extensibility
|
Installed a few skills
|
Can write custom Skills; add any capability on demand
|
|
Channels
|
Connected to one platform
|
Multi-platform online simultaneously; intelligent message routing
|
|
Configuration
|
"It runs, so it's fine"
|
Every parameter fine-tuned for optimal performance
|
1. OpenClaw AGENTS.md Configuration — Writing a Behavioral Constitution for AI
What is AGENTS.md? How does it differ from SOUL.md?
AGENTS.md". Let's clarify its relationship with other config files:
-
SOUL.md= Personality ("You are a relaxed, practical assistant") -
USER.md= User Info ("Who are you helping?") -
AGENTS.md= Operations Manual ("Check emails first every morning, test after coding, ask before deleting files")
SOUL.md, USER.md, and IDENTITY.md, but the AI still didn't know how to work: which files to read first in a new session, where to write memories, which actions to take independently, and which require approval. That's the purpose of AGENTS.md — it's the AI's official operations manual.
AGENTS.md in the workspace root directory (same level as SOUL.md). OpenClaw automatically loads it at the start of every new session.
OpenClaw Session Startup Flow: What should the AI do first?
Before doing anything else:
1. Read `SOUL.md` — this is who you are
2. Read `USER.md` — this is who you're helping
3. Read `memory/YYYY-MM-DD.md` (today + yesterday) for recent context
4. If in MAIN SESSION (direct chat with your human): Also read `MEMORY.md`
Don't ask permission. Just do it.
-
Steps 1–2: Reads
SOUL.mdandUSER.md. These are small (<1KB) and instantly tell the AI its identity and user. - Step 3: Reads today's and yesterday's logs. Logs record recent events. Reading yesterday's ensures continuity even at 1 AM when today's log might be empty.
-
Step 4: Reads
MEMORY.mdonly in the MAIN SESSION.
|
Session Type
|
Description
|
|---|---|
|
Main Session
|
Direct chat with you (Discord DM, WebChat)
|
|
Group Chat Session
|
Conversations inside a Discord server
|
|
Sub-Agent Session
|
Child processes dispatched by the main AI to execute tasks
|
|
Cron Session
|
Sessions triggered by scheduled tasks
|
MEMORY.md may contain personal information. Restricting it to the main session prevents accidental leaks in group chats. You don't need to manually detect the session type; OpenClaw's system prompt already informs the AI.
OpenClaw Memory Writing Rules: Teaching the AI How to Take Notes
MEMORY.md (creating a messy diary) or write nothing (forgetting everything). Add these writing rules to AGENTS.md:
## Memory
You wake up fresh each session. These files are your continuity.
### Memory Layers
| Layer | File | Purpose |
|:---|:---|:---|
| Index Layer | `MEMORY.md` | User info, capability overview, memory index. Keep concise (<40 lines) |
| Project Layer | `memory/projects.md` | Current status & todos for each project |
| Infrastructure Layer | `memory/infra.md` | Quick reference for servers, APIs, deployments |
| Lessons Layer | `memory/lessons.md` | Pitfalls encountered, graded by severity |
| Log Layer | `memory/YYYY-MM-DD.md` | Daily raw records |
### Writing Rules
- Logs go to `memory/YYYY-MM-DD.md` (format below)
- Project status: Update `memory/projects.md` when progress is made
- Lessons: Write to `memory/lessons.md` after encountering pitfalls
- `MEMORY.md`: Update only when the index changes. Keep it concise.
### Log Format
### [PROJECT:Name] Title
- **Conclusion**: One-sentence summary
- **File Changes**: Files involved
- **Lessons**: Pitfalls encountered (if any)
- **Tags**: `#tag1` `#tag2`
### Iron Rules
- Record conclusions, not processes.
- Tags enable precise `memorySearch` retrieval.
- "Mental notes" don't survive session restarts. Files do.
Core Principle: Record conclusions, not processes.
Bad Log: "Today I deployed the project. Tried running it directly, got an error. Spent hours checking, found the port was occupied... (3 pages of rambling)"
Good Log:
### [PROJECT:MyApp] Deployment Complete
- **Conclusion**: Successfully deployed using Nginx reverse proxy on port 80
- **File Changes**: `/etc/nginx/sites-available/myapp`
- **Lessons**: Direct port exposure is unfeasible; must use Nginx reverse proxy
- **Tags**: `#myapp` `#deploy` `#nginx`
OpenClaw Safety Boundaries: What can the AI do alone vs. what needs approval?
AGENTS.md:
## Safety
- Don't exfiltrate private data. Ever.
- Don't run destructive commands without asking.
- `trash` > `rm` (recoverable beats gone forever)
- When in doubt, ask.
## External vs Internal
**Safe to do freely:**
- Read files, explore, organize, learn
- Search the web, check calendars
- Work within this workspace
**Ask first:**
- Sending emails, tweets, public posts
- Anything that leaves the machine
- Anything you're uncertain about
## Group Chats
You have access to your human's stuff. That doesn't mean you share it.
In groups, you're a participant — not their voice, not their proxy.
Complete AGENTS.md Template (Ready to Copy)
# AGENTS.md - Your Workspace
This folder is home. Treat it that way.
## Every Session
Before doing anything else:
1. Read `SOUL.md` — this is who you are
2. Read `USER.md` — this is who you're helping
3. Read `memory/YYYY-MM-DD.md` (today + yesterday) for recent context
4. If in MAIN SESSION: Also read `MEMORY.md`
Don't ask permission. Just do it.
## Memory
You wake up fresh each session. These files are your continuity:
| Layer | File | Purpose |
|:---|:---|:---|
| Index Layer | `MEMORY.md` | Core info & memory index. Keep concise |
| Project Layer | `memory/projects.md` | Current status & todos for each project |
| Lessons Layer | `memory/lessons.md` | Pitfalls encountered, graded by severity |
| Log Layer | `memory/YYYY-MM-DD.md` | Daily records |
### Writing Rules
- Logs go to `memory/YYYY-MM-DD.md`. Record conclusions, not processes.
- Update `memory/projects.md` when project progress is made.
- Write to `memory/lessons.md` after encountering pitfalls.
- Update `MEMORY.md` only when the index changes.
- If you want to remember something, write it to a file. Do not rely on "keeping it in mind".
### Log Format
### [PROJECT:Name] Title
- **Conclusion**: One-sentence summary
- **File Changes**: Files involved
- **Lessons**: Pitfalls encountered (if any)
- **Tags**: `#tag1` `#tag2`
## Safety
- Don't exfiltrate private data. Ever.
- Don't run destructive commands without asking.
- `trash` > `rm`
- When in doubt, ask.
**Safe to do freely:** Read files, search, organize, work within workspace
**Ask first:** Sending emails/tweets, anything that leaves the machine
## Group Chats
You have access to your human's stuff. That doesn't mean you share it.
In groups, you're a participant — not their voice, not their proxy.
## Tools
Skills provide your tools. When you need one, check its `SKILL.md`.
AGENTS.md now exceeds 200 lines, all accumulated incrementally.
2. OpenClaw Memory System in Practice — Solving AI Amnesia with memoryFlush
Why does OpenClaw AI "forget" during long chats?
OpenClaw memoryFlush Configuration: Auto-save before compaction
memoryFlush to force the AI to write critical information to files before compaction triggers. Add this to openclaw.json:{"agents": {
"defaults": {
"compaction": {
"reserveTokensFloor": 20000,
"memoryFlush": {
"enabled": true,
"softThresholdTokens": 4000
}
}
}
}
}
|
Parameter
|
Meaning
|
Recommended Value
|
|---|---|---|
reserveTokensFloor |
Minimum tokens to keep for recent conversation after compaction
|
20000 |
memoryFlush.enabled |
Whether to enable auto-save before compaction
|
true |
memoryFlush.softThresholdTokens |
How many tokens before compaction triggers the save
|
4000 |
memoryFlush runs silently without interrupting the chat. If you enable verbose mode (/verbose), you'll see Auto-compaction complete prompts.
OpenClaw memorySearch Precision Optimization
memorySearch relies on vector semantic retrieval. Structured logs dramatically improve hit rates:
"nginx deployment issue"
- Unstructured Log (Low Hit Rate): "Struggled all day, first did DB migration, then deployed new version, tweaked nginx config..."
-
Structured Log (High Hit Rate):
markdown### [PROJECT:MyApp] Nginx Reverse Proxy Configuration
- **Conclusion**: Successfully deployed using Nginx reverse proxy
- **Lesson**: Use `127.0.0.1` instead of `localhost` for upstream (IPv6 issue)
- **Tags**: `#nginx` `#deploy` `#myapp`
Configure
memorySearchwith Free SiliconFlowbge-m3The fastest solution for domestic (China) users: SiliconFlow'sbge-m3vector model is completely free.json{
"memorySearch": {
"enabled": true,
"provider": "openai",
"remote": {
"baseUrl": "https://api.siliconflow.cn/v1",
"apiKey": "Your_SiliconFlow_API_Key"
},
"model": "BAAI/bge-m3"
}
}
Whybge-m3? Completely free, excellent bilingual (CN/EN) support, 1024-dimensional vectors offer an optimal balance of precision and performance.
How to get it: Register atsiliconflow.cn→ Console → Create API Key.OpenClaw Auto-Memory Maintenance: Preventing Expired Logs from Interfering
Add this weekly maintenance task toHEARTBEAT.md:markdown## Memory Maintenance (Weekly)
Read `memory/heartbeat-state.json` and check the `lastMemoryMaintenance` field.
If >= 7 days have passed:
1. Read logs from `memory/YYYY-MM-DD.md` for the last 7 days
2. Extract valuable information into corresponding files (`projects.md`/`lessons.md`)
3. Compress logs for completed one-time tasks into a single-line conclusion
4. Delete outdated information
5. Update `lastMemoryMaintenance` in `memory/heartbeat-state.json` to todayCreatememory/heartbeat-state.json:{
"lastMemoryMaintenance": "2026-01-01"
}3. OpenClaw Sub-Agent Tutorial — Parallel Task Processing
What are Sub-Agents? What problem do they solve?
By default, AI operates "single-threaded", finishing one task before starting the next. Sub-agents allow the main AI (main brain) to dispatch independent child processes to handle tasks in parallel. Each sub-agent has its own session and automatically reports results upon completion.Configuration (
openclaw.json+AGENTS.md)Step 1: Declare usage rules inAGENTS.mdmarkdown## Sub-Agents
If a task is complex or time-consuming, dispatch a sub-agent to execute it.### Model Selection Strategy
| Tier | Model Alias | Use Case |
|:---|:---|:---|
| High | `opus` | Complex architecture design, multi-file refactoring, deep reasoning |
| Medium | `sonnet` | Writing code, scripts, information organization (Default) |
| Low | `haiku` | Simple file operations, format conversion, search & summarization |Step 2: Configure model aliases in
openclaw.json{
"models": {
"your-provider/claude-opus-4": {"alias": "opus"},
"your-provider/claude-sonnet-4": {"alias": "sonnet"},
"your-provider/claude-haiku-4": {"alias": "haiku"}
}
}How much can Sub-Agents save?
实测 (Real-world test): Token consumption drops by 60–70%. Most daily operations (searching, summarizing, file ops) don't require the strongest model.Haikuis 10x+ cheaper thanOpusand performs identically for web searches or file renames.How to Write Sub-Agent Task Descriptions
Sub-agents are "zero-context"; they only see the task description you provide. Quality dictates output quality.❌ Bad: "Review my code"
✅ Good:markdown
## Task: Code Security Review
### Objective
Review all `.js` files in `/root/project/src/`, focusing on API security.
### Focus Areas
1. SQL injection risks
2. Unvalidated user input
3. Hardcoded secrets or tokens
4. API endpoints missing permission checks
### Constraints
- Read-only. Do not modify any files.
- Ignore `node_modules/` and `test/` directories.
### Output Format
Grade by severity (Critical/Important/Suggestion). For each issue, provide: file path, line number, issue description, fix suggestion.
### Result
Write to `/root/project/SECURITY-REVIEW.md`Concurrency Limit: Run a maximum of 2 sub-agents simultaneously. 4 will likely trigger API 429 rate limits. Tasks with dependencies (B depends on A's output) must run serially; remind the main AI of dependencies inAGENTS.md.4. OpenClaw Cron Task Configuration — Automated Daily News/Weekly Reports/Service Checks
Heartbeat vs. Cron: When to use which?
FeatureHeartbeatCronPrecision~Every 30 minutes (may drift)Minute-precise (cron expression)Execution EnvRuns in main sessionCan open independent sessionModelUses main brain's modelCan specify a different modelBest ForLightweight batch checksPrecise timing, independent tasksChoose Heartbeat: Lightweight checks that don't mind drift, require recent chat context.
Choose Cron: Exact timing required, shouldn't interrupt main chat, want to save costs with a cheaper model, or one-off reminders.Three Schedule Types
-
at— One-time scheduled (auto-deletes after execution):
json
"schedule": {"kind": "at", "at": "2026-02-23T16:00:00+08:00"}
2.every— Fixed interval loop:json"schedule": {"kind": "every", "everyMs": 3600000}
Conversions: 5 min = 300000, 30 min = 1800000, 1 hour = 3600000
3.cron— Cron expression (most flexible, format:min hour day month weekday):json"schedule": {"kind": "cron", "expr": "0 9 * * 1", "tz": "Asia/Shanghai"}Common Cron Expressions:-
0 9 * * *→ Every day at 9:00 AM -
0 9 * * 1→ Every Monday at 9:00 AM -
0 9,18 * * *→ Every day at 9:00 AM & 6:00 PM -
*/30 * * * *→ Every 30 minutes -
0 0 1 * *→ 1st of every month at midnight
⚠️ Most Common Pitfall: Always set thetzfield! Without it, it defaults to UTC, so "9 AM" becomes 5 PM Beijing time.Two Execution Modes
systemEvent(Injects message into main session, ideal for reminders):json"payload": {"kind": "systemEvent", "text": "Reminder: Meeting in 10 minutes"},
"sessionTarget": "main"agentTurn(Opens independent session, ideal for operations)"payload": {"kind": "agentTurn", "message": "...", "model": "haiku"},
"sessionTarget": "isolated",
"delivery": {"mode": "announce"}sessionTarget: "main"only pairs withsystemEvent.sessionTarget: "isolated"only pairs withagentTurn. Mixing them causes errors.Practical Cron Scenarios (Copy-Paste Ready)
Scenario 1: Daily Tech News Briefing{
"name": "Daily Briefing",
"schedule": {"kind": "cron", "expr": "0 9 * * *", "tz": "Asia/Shanghai"},
"payload": {
"kind": "agentTurn",
"message": "Search today's top tech and AI news. Summarize into 5 bullet points. Each must include: Title, one-sentence summary, source link.",
"model": "haiku"
},
"sessionTarget": "isolated",
"delivery": {"mode": "announce"}
}Scenario 2: Hourly Server Health Check (Notify only on failure)
{
"name": "Service Check",
"schedule": {"kind": "every", "everyMs": 3600000},
"payload": {
"kind": "agentTurn",
"message": "Use curl to check if these services are online:\n1. http://localhost:8080\n2. http://localhost:3000\n\nIf all are healthy, DO NOT notify me. Only notify if one is down, stating which service failed and the returned error code.",
"model": "haiku"
},
"sessionTarget": "isolated",
"delivery": {"mode": "announce"}
}Scenario 3: Weekly Project Report (Every Monday)
{
"name": "Weekly Project Report",
"schedule": {"kind": "cron", "expr": "0 10 * * 1", "tz": "Asia/Shanghai"},
"payload": {
"kind": "agentTurn",
"message": "Read log files in `memory/` from the last 7 days. Generate a weekly report including: Completed tasks, ongoing projects, encountered issues, next week's plan. Keep it concise using bullet points.",
"model": "sonnet"
},
"sessionTarget": "isolated",
"delivery": {"mode": "announce"}
}Scenario 4: One-off Reminder (N minutes later) Tell the AI directly: "Set a reminder for 20 minutes from now." It will auto-create the task. Manual example:
{
"name": "Water Reminder",
"schedule": {"kind": "at", "at": "2026-02-23T04:20:00Z"},
"payload": {"kind": "systemEvent", "text": "Reminder: Time to drink water!"},
"sessionTarget": "main"
}Cron Management Commands
bashopenclaw cron list # View all tasks
openclaw cron runs --id <TaskID> # View execution history
openclaw cron edit <TaskID> --disable # Disable (recommended over deleting)5. OpenClaw Skill Development Basics — Teaching AI New Capabilities
What is a Skill? How does it differ from plugins?
A Skill is simply a Markdown file that uses natural language to describe "under what conditions, execute these steps." Once the AI reads it, it "learns" the capability. No coding required. Anyone can write one.Directory Structure & Load Priority
<workspace>/skills/ ← User-created (Highest priority)
~/.openclaw/skills/ ← Globally installed
Built-in skills ← OpenClaw defaults (Lowest priority)Each skill is a directory containing a mandatory
SKILL.md:skills/
my-skill/
SKILL.md
scripts/ ← Optional, for running scriptsSKILL.mdStructure:descriptionDictates Trigger RateSKILL.mdconsists of a YAML frontmatter block and the main content:yaml---
name: weather
description: >
Fetch weather information. Triggers when: user asks about weather, temperature,
rain, clothing advice, umbrella need, travel plans today, etc.
---Thedescriptiondirectly controls trigger probability. Avoid vague terms like "weather-related". List all possible trigger phrases — the more specific, the better. The main content should include: execution steps, output format templates, and error handling.Step-by-Step: Building an IP Lookup Skill
Step 1: Create directorybashmkdir -p ~/.openclaw/workspace/skills/ip-lookupStep 2: WriteSKILL.mdmarkdown---
name: ip-lookup
description: >
IP address lookup. Triggers when: user requests IP query, IP geolocation,
"Where is this IP from?", "Check XX.XX.XX.XX for me", etc.
---# IP Address Lookup
## Steps
1. Extract the IP address from the user's message.
2. Call `web_fetch` to access: `http://ip-api.com/json/{IP_ADDRESS}?lang=zh-CN`
3. Parse the returned JSON data.
4. Reply using the format below:## Output Format
IP Lookup Result: {IP}
Location: {country} {regionName} {city}
ISP: {isp}
Timezone: {timezone}## Error Handling
- API returns `"status": "fail"` → Tell user "Likely an internal/private IP or invalid address."
- Network timeout → Tell user "Request timed out. Please try again later."Step 3: Test
Ask the AI: "Where is 8.8.8.8 from?" If it doesn't trigger, add more trigger phrases to thedescription.Skills with Scripts (e.g.,
yt-dlp)skills/video-downloader/
SKILL.md
scripts/
download.sh
Reference the script inSKILL.md(use workspace-relative paths):
## Steps
1. Extract video URL from user message.
2. Execute: `bash skills/video-downloader/scripts/download.sh "{VIDEO_URL}"`
3. Inform user of the saved file location.
Best Practices
- Test manually first: Run through the workflow with the AI manually. Confirm it works before packaging as a Skill.
-
Be specific in steps:
Call API to fetch data → Use web_fetch to access https://... → Parse JSON results field - Always include error handling: Without it, the AI will hallucinate when exceptions occur.
-
Test multiple phrasings: Cover all possible user inputs in
description, including CN/EN. -
Use ClawHub to save time:
clawhub install <skill-slug>installs community-made Skills instantly.
6. Multi-Channel Integration — Discord & Telegram Simultaneously
Supported Channels
ChannelFeaturesRecommendationDiscordFull-featured, supports servers + DMs, emoji reactions, markdown tables⭐⭐⭐⭐⭐TelegramLightweight, fast, inline buttons, voice messages, file transfer⭐⭐⭐⭐⭐WhatsAppLarge user base, limited formatting support⭐⭐⭐SignalEnd-to-end encrypted, strongest privacy⭐⭐⭐⭐SlackIdeal for team scenarios⭐⭐⭐WebChatBuilt-in web chat, zero config⭐⭐⭐⭐MatrixDecentralized, self-hosted⭐⭐⭐⭐You can connect multiple channels simultaneously. Message routing is automatic — Discord messages reply to Discord, Telegram to Telegram. No cross-talk.Discord Integration Guide (Fixing
MESSAGE CONTENT INTENT)- Create Bot: Discord Developer Portal → "New Application" → Name → Create. Left menu "Bot" → "Reset Token" → Copy Token (shown once!).
-
Enable Privileged Gateway Intents: 90% of beginners miss this. Without it, the bot won't receive message content. Scroll to "Privileged Gateway Intents" and enable:
PRESENCE INTENTSERVER MEMBERS INTENT-
MESSAGE CONTENT INTENT← CRITICAL Click Save Changes.
-
Invite Bot: Left menu "OAuth2" → "OAuth2 URL Generator". Scopes:
bot. Bot Permissions:Send Messages,Read Message History,Add Reactions,Use Slash Commands. Copy URL → Open in browser → Select server → Authorize. - Get Server ID: Discord Client → Settings → Advanced → Enable Developer Mode → Right-click server name → "Copy Server ID".
-
Configure
openclaw.json:json
{
"channels": {
"discord": {
"token": "YOUR_BOT_TOKEN",
"allowFrom": ["server:YOUR_SERVER_ID"],
"ackReaction": "🫐"
}
}
}
-
allowFromsupports:"server:ID","user:ID","channel:ID".ackReaction: Emoji added immediately upon receiving a message ("Received, processing..."). Use a rare emoji for easy visibility. -
Restart & Test:
openclaw gateway restart
Troubleshooting:SymptomCauseFixBot online but unresponsiveMESSAGE CONTENT INTENTnot enabledEnable in Dev Portal & SaveBot offlineInvalid token or not startedVerify token, check logs viaopenclaw statusOnly replies in some channelsInsufficient bot permissionsEnsureSend Messagespermission in target channelTelegram Bot Configuration
-
Search
@BotFatheron Telegram →/newbot→ Follow prompts → Copy Token. -
Search
@userinfobot→ Send any message → Get your User ID. -
Configure
openclaw.json:json
{
"channels": {
"telegram": {
"token": "YOUR_TELEGRAM_BOT_TOKEN",
"allowFrom": ["YOUR_USER_ID"]
}
}
}Running Discord + Telegram Simultaneously
{
"channels": {
"discord": {
"token": "DISCORD_TOKEN",
"allowFrom": ["server:123456789"],
"ackReaction": "🫐"
},
"telegram": {
"token": "TELEGRAM_TOKEN",
"allowFrom": ["YOUR_USER_ID"]
}
}
}Cross-Platform Format Adaptation
FormatDiscordTelegramWhatsAppMarkdown Tables✅ Supported❌ Not supported❌ Not supportedCode Blocks✅ Supported✅ Supported⚠️ LimitedBold/Italic✅ Supported✅ Supported✅ SupportedEmoji Reaction✅ Supported❌ Not supported❌ Not supportedAdd this toAGENTS.mdfor auto-adaptation:markdown## Platform Formatting
- **Discord/Telegram**: Markdown supported. Code blocks use ``` wrapping.
- **WhatsApp**: Tables unsupported. Replace with bullet lists.
- **Discord**: Wrap multiple URLs in <> to prevent link preview spam.7.
openclaw.jsonConfiguration Cheat SheetAll configurations go in~/.openclaw/openclaw.json. Restart gateway after changes:openclaw gateway restart.blockStreaming— Fix Long Response Wait Timesjson{
"agents": {
"defaults": {
"blockStreamingDefault": "on",
"blockStreamingBreak": "text_end",
"blockStreamingChunk": {"minChars": 200, "maxChars": 1500}
}
}
}ackReaction— Instant "Message Received" Feedbackjson
{
"channels": {
"discord": {"ackReaction": "🫐"},
"telegram": {"ackReaction": "✅"}
}
}compaction— Prevent Long-Chat Amnesia{
"agents": {
"defaults": {
"compaction": {
"reserveTokensFloor": 20000,
"memoryFlush": {"enabled": true, "softThresholdTokens": 4000}
}
}
}
}Related commands:/compact(preserve key info),/new(start new session),/status(check token usage).Heartbeat Tuning — Prevent Off-Hours Spam
json{
"agents": {
"defaults": {
"heartbeat": {
"every": "30m",
"target": "last",
"activeHours": {"start": "08:00", "end": "23:00"}
}
}
}
}Other Common Configurations
Config PathPurposeRecommended Valuetools.exec.enabledAllow shell executiontruetools.web.search.enabledAllow web searchtruetools.web.search.apiKeyBrave Search API Key (Free)Get atbrave.com/search/apitools.media.image.enabledAllow AI image recognitiontrue(requires vision model)agents.defaults.workspaceWorkspace path"~/.openclaw/workspace"channels.discord.maxLinesPerMessageMax lines per Discord message17OpenClaw Advanced Setup Checklist
Complete the top 5 in under 1 hour for immediate, noticeable improvements:-
✅
AGENTS.md: Session startup flow + memory rules + safety boundaries (30 min) -
✅
memoryFlush: Enable pre-compaction auto-save to fix amnesia (5 min) -
✅
ackReaction: Configure message-received emoji (1 min) -
✅
blockStreaming: Enable streaming responses (5 min) -
✅ Heartbeat Tuning: Set
activeHoursto prevent midnight spam (5 min) -
⏱️
memorySearch(bge-m3): Configure SiliconFlow free embedding API (10 min) -
⏱️ Memory Maintenance: Add weekly auto-maintenance to
HEARTBEAT.md(10 min) - ⏱️ Model Tiering: Configure aliases + allocation strategy, save 60–70% tokens (15 min)
- ⏱️ Cron Tasks: Set up daily briefing / service checks (15 min)
- ⏱️ Skill Development: Write your first custom Skill (30 min)
- ⏱️ Multi-Channel: Connect Discord or Telegram (30 min)
FAQ
Q: Where should I placeAGENTS.md?
A: Workspace root directory, same level asSOUL.mdandUSER.md. Usually:~/.openclaw/workspace/AGENTS.md.Q: I enabledmemoryFlushbut AI still forgets. What now?
A: VerifysoftThresholdTokensis high enough (recommend4000). For critical conversations, manually run/compact preserve: technical decisions, user preferencesto force retention.Q: My Cron task isn't triggering. Why?
A: 99% of the time, it's a timezone issue — missing thetzfield causes UTC execution. Also verifydelivery.modeis set to"announce", otherwise tasks run silently.Q: My Skill is written but the AI won't trigger it.
A: Check if thedescriptioncovers your exact trigger phrases. Include both CN and EN variants (e.g., "查IP" and "IP lookup").Q: Discord Bot is online but receives no messages.
A: Almost certainlyMESSAGE CONTENT INTENTis disabled. Return to Discord Developer Portal → Bot → Privileged Gateway Intents → EnableMESSAGE CONTENT INTENT→ Save Changes.Q: Will messages cross-talk if I run multiple channels?
A: No. OpenClaw logs the source channel for each message. Discord replies stay on Discord, Telegram on Telegram.Q: How do Sub-Agents save money?
A: Define model tiers inAGENTS.md: Haiku for search/summary, Sonnet for coding, Opus only for complex reasoning. Most tasks fall into the Haiku tier, reducing token usage by 60–70% in practice. -