# Send ContextClaw Plugin Usage to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "contextclaw-usage",
    "name": "ContextClaw Plugin Usage",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/rmruss2022/contextclaw-usage",
    "canonicalUrl": "https://clawhub.ai/rmruss2022/contextclaw-usage",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/contextclaw-usage",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=contextclaw-usage",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "SKILL.md"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "slug": "contextclaw-usage",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-02T03:25:20.693Z",
      "expiresAt": "2026-05-09T03:25:20.693Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=contextclaw-usage",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=contextclaw-usage",
        "contentDisposition": "attachment; filename=\"contextclaw-usage-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "contextclaw-usage"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/contextclaw-usage"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/contextclaw-usage",
    "downloadUrl": "https://openagent3.xyz/downloads/contextclaw-usage",
    "agentUrl": "https://openagent3.xyz/skills/contextclaw-usage/agent",
    "manifestUrl": "https://openagent3.xyz/skills/contextclaw-usage/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/contextclaw-usage/agent.md"
  }
}
```
## Documentation

### 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

### 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

# If user approves, run live:
openclaw contextclaw clean-orphaned --dryRun false

### Session Types

ContextClaw categorizes sessions as:

main - Main agent session (protected from pruning)
cron - Cron job sessions (protected from pruning)
subagent - Spawned sub-agent sessions (can be pruned)
unknown - Unrecognized session types

### Orphaned Sessions

A session is orphaned if:

.jsonl file exists in sessions directory
Session ID is NOT in sessions.json

Common causes:

Completed sub-agent removed from index
Manual file operations
Crashed sessions
Development/testing

Orphaned sessions are safe to delete.

### Best Practices

Analyze regularly - Weekly or monthly: openclaw contextclaw analyze
Always dry-run first - Preview before deleting
Adjust age threshold - 30 days is default, adjust as needed
Review orphaned - Check before cleaning
Backup if worried - Though main/cron are protected

### Troubleshooting

If 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

### Technical Details

Port: 18797 (default, configurable)
Analysis: Parses all .jsonl files in ~/.openclaw/agents/main/sessions/
Token estimation: 1 token ≈ 4 characters (approximate)
Storage: Read-only, no database

### Analyze Command

📊 Session Analysis

┌──────────────────┬────────┐
│ Metric           │ Value  │
├──────────────────┼────────┤
│ Total Sessions   │ 45     │
│ Total Messages   │ 3,842  │
│ Total Tokens     │ 156,234│
│ Total Size       │ 12.4 MB│
│ Orphaned         │ 8      │
└──────────────────┴────────┘

### Prune Command

🧹 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)

### Repository

GitHub: https://github.com/rmruss2022/ContextClaw
npm: @rmruss2022/contextclaw
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: rmruss2022
- Version: 1.0.0
## Source health
- Status: healthy
- Item download looks usable.
- Yavira can redirect you to the upstream package for this item.
- Health scope: item
- Reason: direct_download_ok
- Checked at: 2026-05-02T03:25:20.693Z
- Expires at: 2026-05-09T03:25:20.693Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/contextclaw-usage)
- [Send to Agent page](https://openagent3.xyz/skills/contextclaw-usage/agent)
- [JSON manifest](https://openagent3.xyz/skills/contextclaw-usage/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/contextclaw-usage/agent.md)
- [Download page](https://openagent3.xyz/downloads/contextclaw-usage)