Install
openclaw skills install memory-maintenanceIntelligent memory management for OpenClaw agents. Reviews daily notes, suggests MEMORY.md updates, maintains directory health, and auto-cleans old files. Recommended for agents with growing memory footprints.
openclaw skills install memory-maintenanceIntelligent memory management for OpenClaw agents. Reviews daily notes, suggests MEMORY.md updates, maintains directory health, and auto-cleans old files.
Agents wake up fresh every session. Without maintenance:
This skill automates the tedious work of keeping your agent's memory organized and actionable.
This skill works well with lightweight models. We recommend:
gemini-2.5-flash (fast, cost-effective)gemini-2.5-flash-lite (if rate limits hit)Both handle the structured output and analysis tasks efficiently.
# Install the skill
clawhub install memory-maintenance
# Configure (optional)
# Edit config/settings.json to customize schedule, retention, etc.
# Run manually
openclaw skill memory-maintenance run
# Or let it run automatically via cron (configured during install)
Daily Session Notes (memory/YYYY-MM-DD.md)
↓
Review Agent (scheduled daily)
↓
Structured Suggestions (JSON)
↓
Human Review (markdown report)
↓
Approved Updates → MEMORY.md
↓
Auto-Cleanup (archive old files)
Daily Review (23:00 by default)
Human Review
agents/memory/review-v2-YYYY-MM-DD.mdApply Changes
# Dry run (preview)
openclaw skill memory-maintenance apply --dry-run 2026-02-05
# Apply safe changes (archiving, cleanup)
openclaw skill memory-maintenance apply --safe 2026-02-05
# Apply all (requires confirmation)
openclaw skill memory-maintenance apply --all 2026-02-05
Auto-Cleanup (runs after successful review)
Edit config/settings.json:
{
"schedule": {
"enabled": true,
"time": "23:00",
"timezone": "Europe/London"
},
"review": {
"lookback_days": 7,
"model": "gemini-2.5-flash",
"max_suggestions": 10
},
"maintenance": {
"archive_after_days": 7,
"retention_days": 30,
"consolidate_fragments": true,
"auto_archive_safe": true
},
"safety": {
"require_approval_for_content": true,
"require_approval_for_delete": true,
"trash_instead_of_delete": true
}
}
--safe--all + confirmationagents/memory/.trash/ (recoverable for retention period)# Run review manually
openclaw skill memory-maintenance review
# Apply changes
openclaw skill memory-maintenance apply [--dry-run|--safe|--all] DATE
# Run cleanup
openclaw skill memory-maintenance cleanup
# Check status
openclaw skill memory-maintenance status
# View stats
openclaw skill memory-maintenance stats
The skill suggests updates to standard MEMORY.md sections:
agents/memory/review-v2-YYYY-MM-DD.json — Structured suggestionsagents/memory/review-v2-YYYY-MM-DD.md — Human-readable reportagents/memory/stats.json — Aggregate statisticsagents/memory/archive/YYYY-MM/ — Monthly bucketsagents/memory/.trash/ — Recoverable deletionsbrew install gemini-cli)brew install jq)"Gemini failed"
→ Check GEMINI_API_KEY is set in .env or environment
"No suggestions generated"
→ Check daily notes exist in memory/YYYY-MM-DD.md
→ Review error logs in agents/memory/error-*.txt
"Too many maintenance tasks"
→ Run openclaw skill memory-maintenance apply --safe to archive old files
→ Adjust archive_after_days in config
Built by Max Hutchinson as part of an AI agent infrastructure exploration.
MIT — Free to use, modify, distribute.
Part of the Hybrid Agent Architecture. Built for agents that improve over time.