Contextclaw Usage
Skill by rmruss2022
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/rmruss2022/contextclaw-usageContextClaw Plugin Usage
When to Use
Use this skill when the user asks about:
- Session management or cleanup
- Context usage or token consumption
- Storage space used by sessions
- Pruning old sessions
- Cleaning up orphaned session files
- Session analysis or statistics
- Which sessions are taking up space
- How many messages/tokens in sessions
Prerequisites
The ContextClaw plugin must be installed:
npm install -g @rmruss2022/contextclaw
openclaw plugins install @rmruss2022/contextclaw
Quick Start
Check if ContextClaw is installed and running:
openclaw contextclaw status
Commands
Analyze Sessions
Get comprehensive analysis of all sessions:
openclaw contextclaw analyze
This shows:
- Total sessions, messages, tokens, storage size
- Largest sessions (top 10)
- Oldest sessions (top 10)
- Orphaned sessions
Prune Old Sessions
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:
- Dry run by default (previews before deleting)
- Always keeps main agent sessions
- Always keeps cron sessions
- Shows confirmation before deleting
Clean Orphaned Sessions
Remove session files not referenced in sessions.json:
# Dry run
openclaw contextclaw clean-orphaned
# Live run
openclaw contextclaw clean-orphaned --dryRun false
Dashboard
Open the visual session management dashboard:
openclaw contextclaw dashboard
This opens http://localhost:18797
Quick Stats
Show brief status and statistics:
openclaw contextclaw status
Configuration
Reconfigure port or OpenClaw home:
openclaw contextclaw setup
Dashboard Features
The dashboard at http://localhost:18797 provides:
- Session statistics - Total sessions, messages, tokens, storage
- Multiple views - All, Largest, Oldest, Orphaned, Charts
- Bar charts - Visual size distribution
- Type breakdown - Sessions by agent type (main, cron, sub-agent)
- Quick actions - Prune and clean from UI (preview only)
Example Usage
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
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-rmruss2022-contextclaw-usage": {
"enabled": true,
"auto_update": true
}
}
}