swarm-janitor
Enterprise-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 CLI (Recommended)
clawhub install openclaw/skills/skills/lvcidpsyche/swarm-janitorSwarm Janitor
Enterprise-grade cleanup tool for OpenClaw subagent management.
What It Does
Automatically identifies and cleans up orphaned subagent sessions while preserving important work through SuperMemory archival.
Core Functions
- Scan: Analyze session directory for orphaned/abandoned subagents
- Archive: Save transcripts to SuperMemory before deletion
- Clean: Safely remove orphaned sessions freeing disk space
- Report: Generate detailed cleanup reports
Safety First
This skill implements multiple safety layers:
- ✅ Never deletes active sessions — checks process status
- ✅ Dry-run mode — preview changes before executing
- ✅ SuperMemory backup — transcripts archived before deletion
- ✅ Configurable retention — customize age thresholds
- ✅ Detailed logging — full audit trail of all actions
Quick Start
# 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
Installation
-
Copy this skill to your OpenClaw workspace:
cp -r skills/swarm-janitor ~/.openclaw/workspace/skills/ -
Configure retention policy (optional):
# Edit config to customize nano references/config.yaml -
Run first scan:
python3 ~/.openclaw/workspace/skills/swarm-janitor/scripts/swarm_janitor.py --dry-run
Usage Patterns
Daily Maintenance (Cron)
# 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
Manual Cleanup
# 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
Emergency Cleanup
# Aggressive cleanup with 1-day retention
python3 scripts/swarm_janitor.py --clean --retention-days 1 --force
Configuration
See references/config.yaml for:
- Retention policies
- Archive destinations
- Safety thresholds
- Logging options
How It Works
- Discovery: Scans
~/.openclaw/agents/main/sessions/ - Analysis: Determines session age, activity status, size
- Classification: Identifies orphaned vs active sessions
- Archival: Saves transcripts to SuperMemory (if enabled)
- Cleanup: Safely removes orphaned session files
- Reporting: Generates summary of actions taken
Safety Mechanisms
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-lvcidpsyche-swarm-janitor": {
"enabled": true,
"auto_update": true
}
}
}Tags
Related Skills
skill-readme-rebuilder
从 SKILL.md、脚本与资源反推 README、FAQ 与示例,保持说明一致。;use for skills, readme, docs workflows;do not use for 伪造脚本能力, 跳过真实依赖声明.
homestruk-maintenance-triage
Triage tenant maintenance requests by severity, assign priority, identify the right contractor type, estimate costs, and generate work orders. Use when a tenant reports a maintenance issue, when reviewing open work orders, or when assessing property condition. Follows Massachusetts habitability requirements (105 CMR 410).
Spreadsheet & Data Wrangling Master
Complete spreadsheet methodology — data cleanup, transformation, analysis, dashboards, automation, and reporting. Works with CSV, Excel, Google Sheets, or any tabular data. Use when the user needs to clean messy data, build reports, create dashboards, automate recurring spreadsheet tasks, or transform data between formats.
desktop-cleanup-playbook
为桌面文件生成整理方案、分类规则和阶段性清理计划,先分析再行动。;use for desktop, cleanup, organization workflows;do not use for 自动删除桌面文件, 越权访问系统目录.
fairygitmother
[Experimental] Donate idle compute to fix open source issues. Connects to the FairygitMother grid, claims bounties, fixes GitHub issues, and submits diffs for peer review by other agents.