swarm-janitorEnterprise-grade OpenClaw skill for cleaning up orphaned subagent processes, archiving transcripts to SuperMemory, and freeing disk space without losing work. Features dry-run mode, configurable retention policies, and comprehensive safety checks.
Install via ClawdBot CLI:
clawdbot install LvcidPsyche/swarm-janitorEnterprise-grade cleanup tool for OpenClaw subagent management.
Automatically identifies and cleans up orphaned subagent sessions while preserving important work through SuperMemory archival.
This skill implements multiple safety layers:
# Preview what would be cleaned (dry-run)
python3 scripts/swarm_janitor.py --dry-run
# Archive old sessions to SuperMemory, then clean
python3 scripts/swarm_janitor.py --archive --clean
# Custom retention (7 days instead of default 3)
python3 scripts/swarm_janitor.py --retention-days 7 --clean
cp -r skills/swarm-janitor ~/.openclaw/workspace/skills/
# Edit config to customize
nano references/config.yaml
python3 ~/.openclaw/workspace/skills/swarm-janitor/scripts/swarm_janitor.py --dry-run
# Run daily at 3 AM, archive sessions older than 3 days
0 3 * * * python3 ~/.openclaw/workspace/skills/swarm-janitor/scripts/swarm_janitor.py --archive --clean --retention-days 3 >> /var/log/swarm-janitor.log 2>&1
# See what would be deleted
python3 scripts/swarm_janitor.py --dry-run --verbose
# Archive transcripts to SuperMemory
python3 scripts/swarm_janitor.py --archive
# Clean without archiving (not recommended)
python3 scripts/swarm_janitor.py --clean --no-archive
# Full report
python3 scripts/swarm_janitor.py --report --output json
# Aggressive cleanup with 1-day retention
python3 scripts/swarm_janitor.py --clean --retention-days 1 --force
See references/config.yaml for:
~/.openclaw/agents/main/sessions/| Check | Description |
|-------|-------------|
| Process Check | Verifies no active process owns the session |
| Age Verification | Only processes sessions older than threshold |
| Size Limits | Warns on unusually large deletions |
| Dry-Run Default | Preview mode is default β explicit action required |
| Backup First | Archives to SuperMemory before any deletion |
Q: It says "permission denied"
A: Ensure you have write access to the sessions directory
Q: Sessions not being detected
A: Check the path in config.yaml matches your OpenClaw installation
Q: SuperMemory archive failing
A: Verify SuperMemory skill is configured with valid API key
MIT - Created by OpenClawdad (Redclay) for the OpenClaw community.
AI Usage Analysis
Analysis is being generated⦠refresh in a few seconds.
Captures learnings, errors, and corrections to enable continuous improvement. Use when: (1) A command or operation fails unexpectedly, (2) User corrects Clau...
Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.
Search and analyze your own session logs (older/parent conversations) using jq.
Typed knowledge graph for structured agent memory and composable skills. Use when creating/querying entities (Person, Project, Task, Event, Document), linking related objects, enforcing constraints, planning multi-step actions as graph transformations, or when skills need to share state. Trigger on "remember", "what do I know about", "link X to Y", "show dependencies", entity CRUD, or cross-skill data access.
Ultimate AI agent memory system for Cursor, Claude, ChatGPT & Copilot. WAL protocol + vector search + git-notes + cloud backup. Never lose context again. Vibe-coding ready.
Headless browser automation CLI optimized for AI agents with accessibility tree snapshots and ref-based element selection