🎁 Get the FREE AI Skills Starter Guide β€” Subscribe β†’
BytesAgainBytesAgain
πŸ¦€ ClawHub

Swarm Janitor

by @lvcidpsyche

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.

πŸ’‘ Examples

# 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

βš™οΈ Configuration

See references/config.yaml for:

  • Retention policies
  • Archive destinations
  • Safety thresholds
  • Logging options
  • πŸ“‹ Tips & Best Practices

    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

    View on ClawHub
    TERMINAL
    clawhub install swarm-janitor

    πŸ§ͺ Use this skill with your agent

    Most visitors already have an agent. Pick your environment, install or copy the workflow, then run the smoke-test prompt above.

    πŸ” Can't find the right skill?

    Search 60,000+ AI agent skills β€” free, no login needed.

    Search Skills β†’