1052326311/session-guardian/SKILL.md
Never lose a conversation again. Auto-backup, smart recovery, and health monitoring for OpenClaw sessions. Protects against gateway crashes, model disconnections, and token overflow. Use this skill when: - User worries about losing conversations after gateway restart or model crash - User mentions session backup, conversation recovery, session protection, or data loss - User's agent is slow or timing out (likely token overflow from large sessions) - User runs multiple agents and needs to track collaboration across sessions - User asks about session health, backup strategy, or disaster recovery - User mentions "对话丢失", "会话备份", "上下文溢出", "token超限", "Gateway重启后记忆丢失" - Even if user just says "my agent lost everything after a restart" — this is the skill
npx skillsauth add openclaw/skills session-guardianInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Never lose a conversation again.
Without Guardian With Guardian
┌──────────────────┐ ┌──────────────────────────┐
│ Gateway crashes │ │ Auto-backup every 5 min │
│ → conversation │ │ Hourly snapshots │
│ gone forever │ │ Health monitoring │
│ │ │ One-command recovery │
│ Token overflow │ │ │
│ → agent frozen │ │ Gateway crash? │
│ │ │ → Restore in seconds │
│ No way back. 😱 │ │ │
└──────────────────┘ │ Token overflow? │
│ → Auto-detected + alert │
│ │
│ Always protected. 🛡️ │
└──────────────────────────┘
Your OpenClaw conversations live in session files. When things go wrong — and they will — you lose everything:
No built-in backup. No recovery. No warning before it's too late.
clawhub install session-guardian
bash ~/.openclaw/workspace/skills/session-guardian/scripts/install.sh
That's it. Five layers of protection, running automatically.
Layer 1: Incremental Backup → Every 5 min → New conversations saved
Layer 2: Hourly Snapshot → Every hour → Full session snapshots
Layer 3: Health Check → Every 6 hours → Detect problems early
Layer 4: Smart Summary → Daily → Key info extracted
Layer 5: Knowledge Extraction → Daily → Best practices saved
All automatic. All in the background. Zero manual work.
# Install
clawhub install session-guardian
# Deploy (sets up all cron jobs automatically)
cd ~/.openclaw/workspace/skills/session-guardian
bash scripts/install.sh
# Check status
bash scripts/status.sh
bash ~/.openclaw/workspace/skills/session-guardian/scripts/status.sh
Shows: backup count, last backup time, snapshot count, cron jobs, disk usage.
bash ~/.openclaw/workspace/skills/session-guardian/scripts/health-check.sh
Detects: oversized sessions, missing configs, disk space issues, gateway problems.
# List available backups
bash ~/.openclaw/workspace/skills/session-guardian/scripts/restore.sh list
# Restore specific agent
bash ~/.openclaw/workspace/skills/session-guardian/scripts/restore.sh restore --agent main
bash ~/.openclaw/workspace/skills/session-guardian/scripts/collaboration-health.sh report
bash ~/.openclaw/workspace/skills/session-guardian/scripts/collaboration-tracker.sh trace "task name"
After install.sh, these run automatically:
| Schedule | Task | What it does | |----------|------|-------------| | Every 5 min | Incremental backup | Save new conversations | | Every hour | Snapshot | Full session archive | | Every 6 hours | Health check | Detect problems | | Daily 2am | Smart summary | Extract key info |
Assets/SessionBackups/
├── incremental/ # Every-5-min backups
├── hourly/ # Hourly snapshots
├── collaboration/ # Task flow records
└── Knowledge/ # Extracted best practices
All backups stay local. Nothing leaves your machine.
✅ Protect your main conversation from crashes ✅ Get warned before token overflow kills your agent ✅ Recover in seconds, not hours of re-explaining
✅ Protect all agents (King + team leads + members) ✅ Track collaboration: who assigned what, who finished what ✅ Health scoring: monitor team communication quality ✅ Knowledge extraction: auto-save best practices from every agent
| Problem | Fix |
|---------|-----|
| Backups not running | Check crontab -l \| grep session-guardian |
| Agent slow/timing out | Run health-check — likely token overflow |
| Can't restore | Run restore.sh list to see available backups |
| Disk filling up | Check config retention settings (default: 7 days incremental, 30 days snapshots) |
Edit scripts/config.sh to customize:
BACKUP_DIR # Where backups go (default: Assets/SessionBackups)
INCREMENTAL_KEEP # Days to keep incremental backups (default: 7)
SNAPSHOT_KEEP # Days to keep snapshots (default: 30)
MAX_SESSION_SIZE # Alert threshold for session size (default: 5MB)
| Operation | Tokens | Storage | |-----------|--------|---------| | Incremental backup | ~100/run | ~10KB/session/day | | Hourly snapshot | ~500/run | ~100KB/session/day | | Health check | ~200/run | ~2KB/report | | Daily summary | ~5k/run | ~5KB/day | | Total | ~10-15k/day | ~1-2MB/agent/month |
clawhub star session-guardianclawhub update session-guardian你的 OpenClaw 对话存在 session 文件里。Gateway 一重启、模型一断连、token 一溢出——对话就没了。没有备份,没有恢复,没有预警。
clawhub install session-guardian
bash ~/.openclaw/workspace/skills/session-guardian/scripts/install.sh
五层自动防护,后台运行,零手动操作。
| 层级 | 频率 | 作用 | |------|------|------| | 增量备份 | 每 5 分钟 | 保存新对话,最多丢 5 分钟 | | 快照备份 | 每小时 | 完整 session 存档,支持回滚 | | 健康检查 | 每 6 小时 | 提前发现问题(token 溢出、磁盘不足) | | 智能总结 | 每天 | 提取关键信息到 MEMORY.md | | 知识沉淀 | 每天 | 自动保存最佳实践 |
# 查看状态
bash scripts/status.sh
# 健康检查
bash scripts/health-check.sh
# 恢复 session
bash scripts/restore.sh list
bash scripts/restore.sh restore --agent main
# 协作健康度(多 Agent)
bash scripts/collaboration-health.sh report
个人用户:保护主对话不丢失,token 溢出前预警,秒级恢复
多 Agent 团队:保护所有 Agent,追踪协作链路,自动沉淀知识
tools
Use when the user wants to connect to, test, or use the McDonalds service at mcp.mcd.cn, including checking authentication, probing MCP endpoints, listing tools, or calling McDonalds MCP tools through a reusable local CLI.
development
Web scraping platform — Twitter/X data, Vinted marketplace, and general web scraping API
development
SlowMist AI Agent Security Review — comprehensive security framework for skills, repositories, URLs, on-chain addresses, and products (Claude Code version)
data-ai
去除中文文本中的 AI 写作痕迹,使其读起来自然。基于维基百科 AI 写作特征指南,检测 24 种 AI 模式。触发词:humanizer-cn、去除 AI 痕迹、去除 AI 写作痕迹、中文文本人性化。