session-cleaner
Session Cleaner
Clean up OpenClaw sessions and reset to a clean state. This skill handles:
- Closing all sub-agent sessions
- Clearing current context
- Killing background processes
- Resetting the system
Triggers (Keywords)
English:
- "close all sessions"
- "kill all agents"
- "clear context"
- "clean up sessions"
- "reset everything"
- "start fresh"
- "wipe everything"
Chinese:
- "关掉所有子agent"
- "关闭所有会话"
- "清空上下文"
- "关闭所有session"
- "清理会话"
- "重置系统"
- "重新开始"
- "全部关掉"
Usage
Quick Cleanup (Keep Current Session)
# 1. List all sessions
openclaw sessions list
# 2. Stop Gateway
pkill -9 -f "openclaw-gateway"
# 3. Clean sessions.json (Python script)
python3 ~/clawd/skills/session-cleaner/scripts/clean_sessions.py
# 4. Restart Gateway
openclaw gateway start
Full Reset (Including Current Session)
# User should send: /new
# Then run the cleanup above
Manual Steps
Step 1: Check Current Sessions
openclaw sessions list
Step 2: Stop Gateway (kills all session processes)
pkill -9 -f "openclaw-gateway"
Step 3: Clean Session Registry
python3 ~/clawd/skills/session-cleaner/scripts/clean_sessions.py
Step 4: Restart Gateway
openclaw gateway start
Step 5: Clear Current Context (User Action)
Tell user to send: /new or /reset
Important Notes
- Always backup
sessions.jsonbefore cleaning - Current session is preserved by default (
agent:main:main) - Sub-agents, cron jobs, group chats are all cleaned
- Gateway restart is required to fully clear memory
- Context reset (
/new) is a separate user action
Safety Checklist
- Backup sessions.json
- Confirm with user before destructive operations
- Preserve current session unless user says "clear everything"
- Restart Gateway after cleaning
- Instruct user to send
/newfor context reset
Examples
Example 1: Clean all other sessions
User: "关掉所有子agent"
Agent: "正在清理... [执行 cleanup 脚本]"
Example 2: Full reset
User: "重置所有,包括当前会话"
Agent: "确认?这将清除所有历史。[用户确认后执行]"
Files
scripts/clean_sessions.py- Python script to clean sessions.jsonSKILL.md- This documentation
Version
v1.0.0 - Initial release
More from xdrshjr/jr-openclaw-skills
doubao-open-tts
Text-to-Speech using Doubao (Volcano Engine) API. Use when converting text to natural-sounding speech, generating audio files from text, listing available TTS voices, or synthesizing speech with customizable speed/volume parameters.
91volcengine-image-gen
使用火山引擎(豆包)Seedream 系列模型生成高质量图片。支持文生图、多种分辨率、多种比例。
41paper-review
Comprehensive peer review of academic papers for top-tier computer science conferences and journals. Supports PDF and LaTeX inputs, provides detailed reviews with scores, and generates improvement plans. Use when the user asks to review, evaluate, or provide feedback on academic papers.
27project-indexer
Generate and use project index for quick codebase understanding in new Claude Code sessions. Scans project structure, extracts code symbols, and creates a navigable feature map.
2reference-finder
Automatically analyze research text, extract domains and key concepts, then generate comprehensive reference lists with summaries using Gemini AI. Use when users need to (1) Generate literature references from research descriptions, (2) Find relevant academic papers for a research topic, (3) Build bibliography for research proposals, (4) Discover key papers in specific research domains, or (5) Create structured reference documentation from free-form research text.
2auto-updater
Automatically update Clawdbot and all installed skills once daily. Runs via cron, checks for updates, applies them, and messages the user with a summary of what changed.
2