Agent Self-Care
/install agent-self-care
Agent Self-Care
Autonomous health monitoring and optimization for OpenClaw agents. Runs on cron or triggers manually.
Workflow
1. Check Sub-Agents
subagents action=list
Kill any stale sub-agents:
- Running >30 min without progress
- In "waiting" state
- Failed/errored
2. Check Processes
process action=list
Kill hanging processes:
- Running >10 min in background
- No output in 5 min
3. Check Session Health
session_status
Metrics to watch:
- Context usage >80% → trigger compaction
- Tokens growing unbounded
- Session age >2 hours → suggest refresh
4. Run Optimization Script
Execute scripts/optimize.sh which:
- Clears completed cron job artifacts
- Rotates logs if >50MB
- Reports health metrics
5. BMAD Retrospective (every 10 runs)
After 10 executions, run:
- Score last task 1-10
- Identify gaps
- Document improvements in
memory/daily/YYYY-MM-DD.md - Feed learnings into next run
Cron Schedule
Recommended: Every 5 minutes for active agents.
{
"name": "agent-self-care",
"schedule": {"kind": "every", "everyMs": 300000},
"payload": {"kind": "agentTurn", "message": "Run agent-self-care skill"},
"sessionTarget": "isolated",
"enabled": true
}
Output Format
Report after each run:
🔧 Self-Care Report
- Sub-agents: X active, Y killed
- Processes: X running, Y cleared
- Context: X% used
- Health: ✅ GOOD / ⚠️ WARNING
- Retrospective: SKIP / COMPLETE
Key Principles
- Always clean - Never leave stalled sub-agents or processes
- Proactive - Don't wait for user to ask
- Document - Log issues and improvements
- BMAD - Continuous self-evaluation every 10 runs
- Fast - Complete in \x3C30 seconds
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install agent-self-care - 安装完成后,直接呼叫该 Skill 的名称或使用
/agent-self-care触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Agent Self-Care 是什么?
Autonomous agent health, optimization, and cleanup. Use when: (1) running scheduled cron jobs for agent maintenance, (2) responding to "optimize", "cleanup",... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 326 次。
如何安装 Agent Self-Care?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install agent-self-care」即可一键安装,无需额外配置。
Agent Self-Care 是免费的吗?
是的,Agent Self-Care 完全免费(开源免费),可自由下载、安装和使用。
Agent Self-Care 支持哪些平台?
Agent Self-Care 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Agent Self-Care?
由 robshabbir(@robshabbir)开发并维护,当前版本 v1.0.0。