agent-self-care for Openclaw

A specialized maintenance skill that automates health monitoring, process cleanup, and performance optimization for autonomous agents.

robshabbir
v1.0.0
Mar 8, 2026
0
893
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install agent-self-care

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install agent-self-care using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is agent-self-care?

Agent Self-Care is a dedicated utility designed to maintain the operational integrity of autonomous agents. By monitoring sub-agent status, process lifecycles, and context usage, this skill ensures that agents do not suffer from performance degradation due to stale sessions or resource leaks. It is a core component for anyone building resilient Openclaw Skills that need to run continuously without manual intervention.

The skill functions as a digital janitor, proactively cleaning up artifacts and rotating logs to prevent disk bloat. Its most powerful feature is the integration of BMAD-style retrospectives, which allow the agent to evaluate its own performance and document improvements in daily memory files, fostering a loop of continuous self-optimization.

agent-self-care Use Cases

  • Running scheduled maintenance via cron to ensure long-term agent stability.
  • Automatically killing sub-agents that have been unresponsive for more than 30 minutes.
  • Managing context windows by triggering compaction when usage exceeds 80%.
  • Rotating large log files and clearing temporary job artifacts to save space.
  • Documenting daily performance gaps and improvements through automated retrospectives.

How agent-self-care Works

  1. The skill lists all active sub-agents and identifies stale sessions that have failed or exceeded the 30-minute progress threshold.
  2. It audits background processes, terminating any hanging tasks that haven't produced output in 5 minutes.
  3. Session health metrics are evaluated, specifically looking for context usage peaks or sessions older than 2 hours.
  4. An optimization shell script is executed to handle file-system level maintenance like log rotation.
  5. Every 10 runs, a retrospective is triggered to score the agent's effectiveness and update the memory directory.

agent-self-care Setup

Configure the agent to run the maintenance routine every 5 minutes by adding the following payload to your configuration for Openclaw Skills:

{
  "name": "agent-self-care",
  "schedule": {"kind": "every", "everyMs": 300000},
  "payload": {"kind": "agentTurn", "message": "Run agent-self-care skill"},
  "sessionTarget": "isolated",
  "enabled": true
}

Ensure that the environment has the necessary permissions to execute the optimization script located at scripts/optimize.sh.

agent-self-care Data Schema & Taxonomy

The skill organizes its maintenance data and performance history into structured reports and markdown files.

Component Description
Self-Care Report Console output detailing killed processes and health status.
Memory MD Retrospective insights saved in memory/daily/YYYY-MM-DD.md.
Optimization Logs System logs rotated and compressed once they exceed 50MB.
Health Metrics Real-time tracking of context usage and token growth.

agent-self-care Advanced Features

  • Automated session status auditing with proactive compaction triggers.
  • BMAD retrospective logic for continuous autonomous self-improvement.
  • Integrated log rotation management for high-volume Openclaw Skills.
  • Intelligent cleanup of completed cron job artifacts and temporary files.
  • Performance scoring system to track agent efficiency over time.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*