Install
openclaw skills install contextclaw-usageManage and analyze OpenClaw sessions by checking usage, pruning old sessions, cleaning orphaned files, and viewing stats via CLI or dashboard.
openclaw skills install contextclaw-usageUse this skill when the user asks about:
The ContextClaw plugin must be installed:
npm install -g @rmruss2022/contextclaw
openclaw plugins install @rmruss2022/contextclaw
Check if ContextClaw is installed and running:
openclaw contextclaw status
Get comprehensive analysis of all sessions:
openclaw contextclaw analyze
This shows:
Clean up sessions older than N days (default: 30):
# Dry run (preview only, safe)
openclaw contextclaw prune --days 30
# Live run (actually deletes)
openclaw contextclaw prune --days 30 --dryRun false
Safety features:
Remove session files not referenced in sessions.json:
# Dry run
openclaw contextclaw clean-orphaned
# Live run
openclaw contextclaw clean-orphaned --dryRun false
Open the visual session management dashboard:
openclaw contextclaw dashboard
This opens http://localhost:18797
Show brief status and statistics:
openclaw contextclaw status
Reconfigure port or OpenClaw home:
openclaw contextclaw setup
The dashboard at http://localhost:18797 provides:
User asks: "How much storage are my sessions using?"
Response:
openclaw contextclaw analyze
Look at the "Total Size" metric in the summary table.
User asks: "Clean up old sessions"
Response:
# First preview what would be deleted
openclaw contextclaw prune --days 30
# If approved, run live:
openclaw contextclaw prune --days 30 --dryRun false
User asks: "Which sessions are taking up the most space?"
Response:
openclaw contextclaw analyze
Check the "Largest Sessions" table, or open the dashboard:
openclaw contextclaw dashboard
User asks: "Remove orphaned session files"
Response:
# Preview first
openclaw contextclaw clean-orphaned
# If user approves, run live:
openclaw contextclaw clean-orphaned --dryRun false
ContextClaw categorizes sessions as:
A session is orphaned if:
.jsonl file exists in sessions directorysessions.jsonCommon causes:
Orphaned sessions are safe to delete.
openclaw contextclaw analyzeIf dashboard won't load:
openclaw contextclaw status # Check if running
openclaw contextclaw start # Start if stopped
If port is in use:
openclaw contextclaw setup
# Choose a different port
.jsonl files in ~/.openclaw/agents/main/sessions/📊 Session Analysis
┌──────────────────┬────────┐
│ Metric │ Value │
├──────────────────┼────────┤
│ Total Sessions │ 45 │
│ Total Messages │ 3,842 │
│ Total Tokens │ 156,234│
│ Total Size │ 12.4 MB│
│ Orphaned │ 8 │
└──────────────────┴────────┘
🧹 Session Pruning
⚠️ DRY RUN MODE - No files will be deleted
Sessions older than 30 days:
✓ Would delete: 12
- Would keep: 33
- Space freed: 4.2 MB
? Run prune in LIVE mode (actually delete files)? (y/N)
GitHub: https://github.com/rmruss2022/ContextClaw npm: @rmruss2022/contextclaw