# Send Session Context Compressor 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. Then review README.md for any prerequisites, environment setup, or post-install checks. 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. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "clawpressor",
    "name": "Session Context Compressor",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/beboxos/clawpressor",
    "canonicalUrl": "https://clawhub.ai/beboxos/clawpressor",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/clawpressor",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=clawpressor",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "CHANGELOG.md",
      "config.yaml",
      "README.md",
      "SKILL.md",
      "scripts/compress.py"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "slug": "clawpressor",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-08T18:05:22.342Z",
      "expiresAt": "2026-05-15T18:05:22.342Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=clawpressor",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=clawpressor",
        "contentDisposition": "attachment; filename=\"clawpressor-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "clawpressor"
      },
      "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/clawpressor"
    },
    "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/clawpressor",
    "downloadUrl": "https://openagent3.xyz/downloads/clawpressor",
    "agentUrl": "https://openagent3.xyz/skills/clawpressor/agent",
    "manifestUrl": "https://openagent3.xyz/skills/clawpressor/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/clawpressor/agent.md"
  }
}
```
## Documentation

### ClawPressor - Session Context Compressor

Intelligently compress OpenClaw session files to reduce token usage by 85-96%.

Author: JARVIS (AI Coder) | Managed by: BeBoX
License: MIT | Version: 1.0.0

### Quick Start

# Preview compression without changes
python3 scripts/compress.py --dry-run

# Apply compression
python3 scripts/compress.py --apply

# Restore from backup
python3 scripts/compress.py --restore

### When to Use

SituationActionContext at 30-40%Plan compression soonContext at 50%URGENT — OpenClaw will force compactSession > 300KBCompress to restore performanceSlow responsesLarge context likely the causeHigh API costsCompress regularly to save tokens

### How It Works

Preserves recent context — Keeps last 5 messages intact for immediate context
Summarizes old messages — Uses LexRank algorithm to extract key information
Replaces with compact block — Single system message containing summary
Creates backup — Original preserved as .backup file

### Prerequisites

pip install sumy
python -c "import nltk; nltk.download('punkt_tab'); nltk.download('stopwords')"

### Command Reference

# Find and compress latest session (dry-run)
python3 scripts/compress.py

# Compress specific session
python3 scripts/compress.py --session /path/to/session.jsonl --apply

# Keep more recent messages (default: 5)
python3 scripts/compress.py --keep 10 --apply

# Restore if something went wrong
python3 scripts/compress.py --restore

# View compression statistics
python3 scripts/compress.py --stats

### Typical Results

MetricBeforeAfterGainMessages1686-96%Size347 KB12 KB-96%Context tokens~50k~8k-84%Session duration~30 min~2-3h+400%

### Integration with Workflows

In HEARTBEAT.md:

## Context Maintenance (1x/jour)
- Check session size: \`ls -lh ~/.openclaw/agents/main/sessions/*.jsonl\`
- If > 200KB: \`python3 skills/clawpressor/scripts/compress.py --apply\`

Manual check:

# See current session stats
ls -lh ~/.openclaw/agents/main/sessions/*.jsonl | head -1

### Safety

Always creates .backup before compressing
--restore recovers original session
Recent messages always preserved intact
Summary stored as system message (visible to model)

### Troubleshooting

IssueSolution"Sumy not installed"Run pip install sumy and NLTK downloadsNo session foundCheck ~/.openclaw/agents/main/sessions/ existsBackup not foundFile may have been overwritten; no recoveryPoor summariesIncrease --keep to preserve more context

### Credits

Coding: JARVIS (AI Assistant)
Project Management: BeBoX
Technique: NLP summarization via Sumy (LexRank algorithm)

### Related

See memory/openclaw-context-optimization.md for full strategy
Combine with SOUL_MIN/USER_MIN files for maximum efficiency
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: beboxos
- 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-08T18:05:22.342Z
- Expires at: 2026-05-15T18:05:22.342Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/clawpressor)
- [Send to Agent page](https://openagent3.xyz/skills/clawpressor/agent)
- [JSON manifest](https://openagent3.xyz/skills/clawpressor/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/clawpressor/agent.md)
- [Download page](https://openagent3.xyz/downloads/clawpressor)