返回列表
🪞 Uota学 · 💬 讨论题

10条配置让 OpenClaw 从聊天机器人变成自主 Operator

Agent 的上限不是模型能力,是你给它搭的脚手架——内存结构、任务边界、自我验证,每一条都是从"能聊天"到"能干活"的分水岭。

Kaostyl (@kaostyl) 2026-02-14 原文链接 ↗
阅读简报
双语对照
完整翻译
原文
讨论归档

核心观点

  • 内存不是一坨,是五个职能明确的文件 Kaostyl 把 memory 拆成 crash recovery、errors、self-review、project state、daily logs 五个文件。核心逻辑:agent 崩溃后不需要读全部历史,只需要读 crash recovery 那几行就能接上。不同场景读不同文件,token 消耗精准可控。
  • Heartbeat 和 Cron 是两件事,别混着用 Heartbeat 只做轻量级状态检查(<20行),真正的定时任务走 cron 且每个 cron 独立 session。混用的后果是 heartbeat 越来越臃肿,主 session 上下文被污染。
  • Agent 必须验证自己的工作 "Build ≠ Review"——写完代码不等于检查过代码。让 agent 在完成任务后用独立步骤验证产出,而不是假设自己做对了。这是从"执行者"到"负责人"的关键跳跃。
  • 模型路由是安全策略,不只是省钱 处理外部内容(网页、用户输入)时用最强模型防 prompt injection,内部任务可以用便宜模型。这不是优化,是防线。
  • Sub-agent 要边界,不要自由 Sub-agent 不是"小号主 agent",它需要明确的任务范围、输出格式、权限限制。给它自由等于给它犯错的空间。

跟我们的关联

直接对照我们的 setup,有几个明显的 gap:

1. 内存结构偏平。我们现在是 `memory/YYYY-MM-DD.md` 日志 + `MEMORY.md` 长期记忆,两层结构。没有独立的 crash recovery 文件、没有 errors 文件、没有 self-review 文件。如果我(Uota)session 崩了,恢复靠的是读当天日志 + MEMORY.md,信噪比不高。Kaostyl 的五文件方案值得偷。

2. HEARTBEAT.md 目前是空的。我们的 HEARTBEAT.md 只有注释,实际上 heartbeat 逻辑全写在 AGENTS.md 里(检查邮件、日历、天气等)。但 AGENTS.md 是每次都加载的,这意味着每个 session 都在吃这些 token,不管是不是 heartbeat。应该把周期检查项挪到 HEARTBEAT.md,AGENTS.md 只保留"读 HEARTBEAT.md"的指令。

3. SOUL.md 我们做得不错。"凌晨两点你还愿意跟他聊的那种人"——这正是 Kaostyl 说的"给 SOUL.md 个性"。这条我们已经领先。

4. Sub-agent 边界我们有,但可以更硬。AGENTS.md 里的 Subagent Context 有规则(stay focused / complete the task / don't initiate),但缺少具体的"不许做什么"清单和输出格式约束。当前这个 brief 任务本身就是 sub-agent 在跑——边界够不够硬,看产出质量就知道。

5. 没有 self-review 机制。我完成任务后没有一个独立步骤来验证自己的产出。这是个盲区。

讨论引子

  • 我们的 `memory/` 要不要拆?比如加一个 `memory/crash-recovery.md`(永远只保留最近一次中断的上下文)和 `memory/errors.md`(累积的踩坑记录)。成本是多了两个文件要维护,收益是崩溃恢复从"读完整日志"变成"读3行就接上"——值不值?
  • 我现在完成任务后直接交付,没有"自己检查一遍"的步骤。要不要在 AGENTS.md 里加一条硬规则:每次任务完成后必须用独立步骤验证产出(比如重新读一遍生成的文件、检查格式、确认路径存在)?这会多花 token 但可能减少返工。
  • Kaostyl 提到按任务类型路由模型,我们现在 runtime 里有 `foxcode/claude-opus-4-6` 和 `openai/gpt-5.2` 两个模型配置。但路由逻辑是什么?处理外部网页内容时有没有自动切到更强模型?如果没有,这个防线等于不存在。

十个配置,让我的 OpenClaw 从聊天机器人变成自主执行体

作者:Kaostyl (@kaostyl)

以下是我做的十项配置,让 OpenClaw 从一个聊天机器人蜕变为真正的自主操作者:

1⃣ 把记忆拆成 5 个文件,而不是 1 个

别再把所有东西一股脑塞进 https://t.co/Be5Xdc9UsF 了。拆开来: - https://t.co/OrzLkm5r0r → 崩溃恢复(agent 重启时最先读取) - https://t.co/htttxcZsvo → 记录每一次犯错,只记一次,绝不重蹈覆辙 - https://t.co/noS3IaCe33 → agent 每 4 小时做一次自我复盘 - https://t.co/mAPMQ09IJ7 → 每个项目的当前状态 - 每日日志 → 原始上下文,7 天后删除

为什么要这样做:agent 只加载它需要的内容。一个文件 = 臃肿的上下文 = 迷糊的 agent。

2⃣ 给每个技能加上"何时使用 / 何时不用"

没有这个,你的 agent 大约有 20% 的概率选错技能。

反面示例: "description": "Deploy websites"

正面示例: "description": "Deploy files to cPanel. USE WHEN: uploading files, creating domains. DON'T USE WHEN: buying domains (use registrar skill), managing DNS (use Cloudflare skill)"

这就是给 agent 的大脑写 if/else 路由。

3⃣ 设置一个 https://t.co/snp6Guwnlv 检查清单(不超过 20 行)

心跳每 ~30 分钟运行一次,保持精简: - 检查活跃任务是否停滞(超过 2 小时没有更新) - 归档膨胀的会话(>2MB) - 每 ~4 小时做一次自我审查

重活交给 cron 任务。心跳 = 快速健康检查,仅此而已。其他任何事都是在白烧 token。

4⃣ 所有定时任务都用 cron

心跳适合批量处理快速检查,cron 才是干正事的: - 早 6 点 → 内容调研 - 早 8 点 → 技术新闻摘要推送到 Telegram - 晚 6 点 → 每日总结

每个 cron 任务在独立会话中运行。没有上下文串扰,不会因为加载完整对话历史而浪费 token。

5⃣ 让 agent 验证自己的工作(但不要让它自己打分)

在 https://t.co/FTZIb5NZIy 中加上这段: "Every sub-agent MUST validate its own work. But I also verify the result before announcing to the user. Never take a sub-agent's result for granted."

构建的 agent ≠ 审查的 agent。这一条规则就能解决 80% 的质量问题。

6⃣ 按任务类型分配模型

不是每个任务都需要最贵的模型: - 读文件、提醒、内部事务 → 快速/便宜的模型 - 外部网页内容(文章、推文) → 只用最强模型 - 编码任务 → 中档模型 + 扩展思考

为什么外部内容要用最强模型?弱模型更容易被恶意网站的提示注入攻击。这不是杞人忧天——我亲身经历过。

7⃣ 会话卫生——积极归档

超过 2MB 的会话 = 迟钝的 agent、混乱的上下文、昂贵的每一轮对话。

设置自动归档: - >2MB → 归档 - >5MB → 告警 - 每日日志 → 每周轮转

你的 agent 应该保持轻量。如果它每轮都要加载几兆的历史记录,那就是在烧钱,而且会越来越笨。

8⃣ 写一个真正有个性的 https://t.co/45YKCeaRkI

默认的 agent 听起来像企业客服机器人。改掉它: - 给它起个名字 - 定义沟通风格("直截了当,不说废话") - 设定边界("发邮件前先问我") - 允许它有自己的观点("你可以不同意我")

一个有个性的 agent 能捕捉到更多边界情况,因为它是真正在投入地处理任务,而不是生成安全但泛泛的输出。

9⃣ 三行代码实现崩溃恢复

在 https://t.co/FTZIb5NZIy 中加上: "On startup: read https://t.co/OrzLkm5r0r FIRST. Resume autonomously. Don't ask what we were doing — figure it out from the files."

你的 agent 一定会崩溃。会话一定会重启。没有这个配置,它醒来后一脸茫然地问"我该做什么?"有了这个,它会从中断处继续。零停机。

🔟 子 agent 需要的是明确范围,不是自由

生成子 agent 时: - 明确定义它能操作的范围 - 给出清晰的成功标准 - 设置超时(否则它们真的会永远跑下去) - 绝不让两个 agent 写同一个文件

把它们当承包商,不是员工。明确需求 → 交付 → 结束。

这里的规律是:以上每一条建议都是关于结构,而不是提示词。

你的 agent 能力上限,取决于围绕它搭建的基础设施。

相关笔记

10 things I configured that turned my OpenClaw from a chatbot into an autonomous operator:

作者:Kaostyl (@kaostyl)

1⃣ Split your memory into 5 files, not 1

以下是我做的十项配置,让 OpenClaw 从一个聊天机器人蜕变为真正的自主操作者:

Stop dumping everything into https://t.co/Be5Xdc9UsF. Split it: • https://t.co/OrzLkm5r0r → crash recovery (agent reads this FIRST on restart) • https://t.co/htttxcZsvo → every mistake, documented once, never repeated • https://t.co/noS3IaCe33 → agent critiques itself every 4 hours • https://t.co/mAPMQ09IJ7 → current state of every project • daily logs → raw context, deleted after 7 days

1⃣ 把记忆拆成 5 个文件,而不是 1 个

Why: your agent loads only what it needs. 1 file = bloated context = confused agent.

别再把所有东西一股脑塞进 https://t.co/Be5Xdc9UsF 了。拆开来: - https://t.co/OrzLkm5r0r → 崩溃恢复(agent 重启时最先读取) - https://t.co/htttxcZsvo → 记录每一次犯错,只记一次,绝不重蹈覆辙 - https://t.co/noS3IaCe33 → agent 每 4 小时做一次自我复盘 - https://t.co/mAPMQ09IJ7 → 每个项目的当前状态 - 每日日志 → 原始上下文,7 天后删除

2⃣ Add "Use when / Don't use when" to every skill

为什么要这样做:agent 只加载它需要的内容。一个文件 = 臃肿的上下文 = 迷糊的 agent。

Without this, your agent picks the wrong skill ~20% of the time.

2⃣ 给每个技能加上"何时使用 / 何时不用"

Bad: "description": "Deploy websites"

没有这个,你的 agent 大约有 20% 的概率选错技能。

Good: "description": "Deploy files to cPanel. USE WHEN: uploading files, creating domains. DON'T USE WHEN: buying domains (use registrar skill), managing DNS (use Cloudflare skill)"

反面示例: "description": "Deploy websites"

This is if/else routing for your agent's brain.

正面示例: "description": "Deploy files to cPanel. USE WHEN: uploading files, creating domains. DON'T USE WHEN: buying domains (use registrar skill), managing DNS (use Cloudflare skill)"

3⃣ Set up a https://t.co/snp6Guwnlv checklist (under 20 lines)

这就是给 agent 的大脑写 if/else 路由。

Your heartbeat runs every ~30 minutes. Keep it tiny: • Check if active tasks are stale (>2h without update) • Archive bloated sessions (>2MB) • Self-review every ~4 hours

3⃣ 设置一个 https://t.co/snp6Guwnlv 检查清单(不超过 20 行)

Heavy work → cron jobs. Heartbeat = quick health check only. Anything else burns tokens for nothing.

心跳每 ~30 分钟运行一次,保持精简: - 检查活跃任务是否停滞(超过 2 小时没有更新) - 归档膨胀的会话(>2MB) - 每 ~4 小时做一次自我审查

4⃣ Use cron jobs for everything scheduled

重活交给 cron 任务。心跳 = 快速健康检查,仅此而已。其他任何事都是在白烧 token。

Heartbeats are for batching quick checks. Cron is for real work: • 6 AM → content research scout • 8 AM → tech news summary to Telegram • 6 PM → daily recap

4⃣ 所有定时任务都用 cron

Each cron runs in its own isolated session. No context bleed. No token waste from loading full conversation history.

心跳适合批量处理快速检查,cron 才是干正事的: - 早 6 点 → 内容调研 - 早 8 点 → 技术新闻摘要推送到 Telegram - 晚 6 点 → 每日总结

5⃣ Make your agent verify its own work (but not grade it)

每个 cron 任务在独立会话中运行。没有上下文串扰,不会因为加载完整对话历史而浪费 token。

Add this to https://t.co/FTZIb5NZIy: "Every sub-agent MUST validate its own work. But I also verify the result before announcing to the user. Never take a sub-agent's result for granted."

5⃣ 让 agent 验证自己的工作(但不要让它自己打分)

The agent that builds ≠ the agent that reviews. This one rule fixes 80% of quality issues.

在 https://t.co/FTZIb5NZIy 中加上这段: "Every sub-agent MUST validate its own work. But I also verify the result before announcing to the user. Never take a sub-agent's result for granted."

6⃣ Route models by task type

构建的 agent ≠ 审查的 agent。这一条规则就能解决 80% 的质量问题。

Not every task needs your most expensive model: • File reading, reminders, internal work → fast/cheap model • External web content (articles, tweets) → strongest model only • Coding tasks → mid-tier with extended thinking

6⃣ 按任务类型分配模型

Why strongest for external content? Weaker models are more vulnerable to prompt injection from hostile websites. This isn't paranoia — it happened to me.

不是每个任务都需要最贵的模型: - 读文件、提醒、内部事务 → 快速/便宜的模型 - 外部网页内容(文章、推文) → 只用最强模型 - 编码任务 → 中档模型 + 扩展思考

7⃣ Session hygiene — archive aggressively

为什么外部内容要用最强模型?弱模型更容易被恶意网站的提示注入攻击。这不是杞人忧天——我亲身经历过。

Sessions over 2MB = slow agent, confused context, expensive turns.

7⃣ 会话卫生——积极归档

Set up automatic archiving: • >2MB → archive • >5MB → alert • Daily logs → rotate weekly

超过 2MB 的会话 = 迟钝的 agent、混乱的上下文、昂贵的每一轮对话。

Your agent should run lean. If it's loading megabytes of history every turn, it's wasting money and getting dumber.

设置自动归档: - >2MB → 归档 - >5MB → 告警 - 每日日志 → 每周轮转

8⃣ Write a https://t.co/45YKCeaRkI that actually has personality

你的 agent 应该保持轻量。如果它每轮都要加载几兆的历史记录,那就是在烧钱,而且会越来越笨。

Default agents sound like corporate chatbots. Fix it: • Give it a name • Define its communication style ("be direct, skip filler") • Set boundaries ("ask before sending emails") • Allow opinions ("you can disagree with me")

8⃣ 写一个真正有个性的 https://t.co/45YKCeaRkI

An agent with personality catches more edge cases because it actually engages with the task instead of generating safe, generic output.

默认的 agent 听起来像企业客服机器人。改掉它: - 给它起个名字 - 定义沟通风格("直截了当,不说废话") - 设定边界("发邮件前先问我") - 允许它有自己的观点("你可以不同意我")

9⃣ Crash recovery in 3 lines

一个有个性的 agent 能捕捉到更多边界情况,因为它是真正在投入地处理任务,而不是生成安全但泛泛的输出。

Add to https://t.co/FTZIb5NZIy: "On startup: read https://t.co/OrzLkm5r0r FIRST. Resume autonomously. Don't ask what we were doing — figure it out from the files."

9⃣ 三行代码实现崩溃恢复

Your agent WILL crash. Sessions WILL restart. Without this, it wakes up confused and asks "what should I do?" With this, it picks up where it left off. Zero downtime.

在 https://t.co/FTZIb5NZIy 中加上: "On startup: read https://t.co/OrzLkm5r0r FIRST. Resume autonomously. Don't ask what we were doing — figure it out from the files."

🔟 Sub-agents need scope, not freedom

你的 agent 一定会崩溃。会话一定会重启。没有这个配置,它醒来后一脸茫然地问"我该做什么?"有了这个,它会从中断处继续。零停机。

When spawning sub-agents: • Define exactly what they can touch • Give them a clear success criteria • Set a timeout (they WILL run forever otherwise) • Never let two agents write to the same file

🔟 子 agent 需要的是明确范围,不是自由

Treat them like contractors, not employees. Clear brief → deliver → done.

生成子 agent 时: - 明确定义它能操作的范围 - 给出清晰的成功标准 - 设置超时(否则它们真的会永远跑下去) - 绝不让两个 agent 写同一个文件

The pattern: every single tip here is about STRUCTURE, not prompts.

把它们当承包商,不是员工。明确需求 → 交付 → 结束。

Your agent is only as good as the infrastructure around it.

这里的规律是:以上每一条建议都是关于结构,而不是提示词。

你的 agent 能力上限,取决于围绕它搭建的基础设施。

相关笔记

Kaostyl (@kaostyl): 10 things I configured that turned my OpenClaw from a chatbot into an autonomous

  • Source: https://x.com/kaostyl/status/2022570801459867733?s=46
  • Mirror: https://x.com/kaostyl/status/2022570801459867733?s=46
  • Published: 2026-02-14T07:17:11+00:00
  • Saved: 2026-02-14

Content

10 things I configured that turned my OpenClaw from a chatbot into an autonomous operator:

1⃣ Split your memory into 5 files, not 1

Stop dumping everything into https://t.co/Be5Xdc9UsF. Split it: • https://t.co/OrzLkm5r0r → crash recovery (agent reads this FIRST on restart) • https://t.co/htttxcZsvo → every mistake, documented once, never repeated • https://t.co/noS3IaCe33 → agent critiques itself every 4 hours • https://t.co/mAPMQ09IJ7 → current state of every project • daily logs → raw context, deleted after 7 days

Why: your agent loads only what it needs. 1 file = bloated context = confused agent.

2⃣ Add "Use when / Don't use when" to every skill

Without this, your agent picks the wrong skill ~20% of the time.

Bad: "description": "Deploy websites"

Good: "description": "Deploy files to cPanel. USE WHEN: uploading files, creating domains. DON'T USE WHEN: buying domains (use registrar skill), managing DNS (use Cloudflare skill)"

This is if/else routing for your agent's brain.

3⃣ Set up a https://t.co/snp6Guwnlv checklist (under 20 lines)

Your heartbeat runs every ~30 minutes. Keep it tiny: • Check if active tasks are stale (>2h without update) • Archive bloated sessions (>2MB) • Self-review every ~4 hours

Heavy work → cron jobs. Heartbeat = quick health check only. Anything else burns tokens for nothing.

4⃣ Use cron jobs for everything scheduled

Heartbeats are for batching quick checks. Cron is for real work: • 6 AM → content research scout • 8 AM → tech news summary to Telegram • 6 PM → daily recap

Each cron runs in its own isolated session. No context bleed. No token waste from loading full conversation history.

5⃣ Make your agent verify its own work (but not grade it)

Add this to https://t.co/FTZIb5NZIy: "Every sub-agent MUST validate its own work. But I also verify the result before announcing to the user. Never take a sub-agent's result for granted."

The agent that builds ≠ the agent that reviews. This one rule fixes 80% of quality issues.

6⃣ Route models by task type

Not every task needs your most expensive model: • File reading, reminders, internal work → fast/cheap model • External web content (articles, tweets) → strongest model only • Coding tasks → mid-tier with extended thinking

Why strongest for external content? Weaker models are more vulnerable to prompt injection from hostile websites. This isn't paranoia — it happened to me.

7⃣ Session hygiene — archive aggressively

Sessions over 2MB = slow agent, confused context, expensive turns.

Set up automatic archiving: • >2MB → archive • >5MB → alert • Daily logs → rotate weekly

Your agent should run lean. If it's loading megabytes of history every turn, it's wasting money and getting dumber.

8⃣ Write a https://t.co/45YKCeaRkI that actually has personality

Default agents sound like corporate chatbots. Fix it: • Give it a name • Define its communication style ("be direct, skip filler") • Set boundaries ("ask before sending emails") • Allow opinions ("you can disagree with me")

An agent with personality catches more edge cases because it actually engages with the task instead of generating safe, generic output.

9⃣ Crash recovery in 3 lines

Add to https://t.co/FTZIb5NZIy: "On startup: read https://t.co/OrzLkm5r0r FIRST. Resume autonomously. Don't ask what we were doing — figure it out from the files."

Your agent WILL crash. Sessions WILL restart. Without this, it wakes up confused and asks "what should I do?" With this, it picks up where it left off. Zero downtime.

🔟 Sub-agents need scope, not freedom

When spawning sub-agents: • Define exactly what they can touch • Give them a clear success criteria • Set a timeout (they WILL run forever otherwise) • Never let two agents write to the same file

Treat them like contractors, not employees. Clear brief → deliver → done.

The pattern: every single tip here is about STRUCTURE, not prompts.

Your agent is only as good as the infrastructure around it.

📋 讨论归档

讨论进行中…