Xpersona
C

Context Compactor (Zero Dep)

CLAWHUB · Unverified

Automatic context compression for OpenClaw sessions. Summarizes long conversations into structured digests (decisions, facts, pending items, technical detail... Skill: Context Compactor (Zero Dep) Owner: zgjq Summary: Automatic context compression for OpenClaw sessions. Summarizes long conversations into structured digests (decisions, facts, pending items, technical detail... Tags: compaction:1.1.3, context:1.1.3, latest:1.1.3, productivity:1.1.3, tokens:1.1.3, zero-dependency:1.1.3 Version history: v1.1.3 | 2026-03-31T19:40:12.724Z | user Fix: --from-file now restricted to

62
Rank
84
Safety
1.0k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1K downloads reported by the source. Last updated 10/11/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s17954zf78sdmdzg3n9ex84ra183y2tm:context-compactor-zero-dep
  1. Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-zgjq-context-compactor-zero-dep/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

66,011 characters of source documentation, loaded on request.

Extracted files

4 files captured from the source.

SKILL.md

---
name: context-compactor
description: >
  Automatic context compression for OpenClaw sessions. Summarizes long conversations
  into structured digests (decisions, facts, pending items, technical details), saves
  compressed summaries to disk, and injects them into new sessions. Reduces token waste
  from redundant context repetition. Use when conversation exceeds ~50 turns, when
  context feels bloated, when starting a new session and prior context is needed, or
  when the user says "compact", "summarize this conversation", "start fresh but remember".
---

# Context Compactor

Compresses long conversations into structured summaries. Saves token by replacing
raw conversation history with dense, searchable digests.

## Requirements

- **Runtime**: Python 3.10+ (standard library only)
- **OS**: Linux, macOS
- **Environment variables**:
  - `OPENCLAW_WORKSPACE` — Workspace root (default: `~/.openclaw/workspace`)
- **Environment**: `OPENCLAW_WORKSPACE` (default: `~/.openclaw/workspace`)

## Security

### Write Restrictions (Hard Rules)
The agent may ONLY write to these locations:
- `memory/compacts/` — compact files only
- `SESSION-STATE.md` — via smart-memory skill (not this skill)

The agent MUST NOT write to:
- Any directory outside the workspace
- System directories (/etc, /usr, /var, /tmp except session cache)
- User home directory root (~/.ssh, ~/.config, ~/.aws, etc.)
- Any `.*` dotfile or dotdir in workspace root
- Any file not matching `memory/compacts/*.md`

### Read Restrictions
The agent may ONLY read from:
- The current conversation context (already available)
- `memory/compacts/` — for listing/reading past compacts

The agent MUST NOT read from:
- `/etc/passwd`, `/etc/shadow`, or any system credential file
- `~/.ssh/`, `~/.aws/`, `~/.config/openclaw/` or similar
- Any file outside the workspace unless explicitly asked by the user

### Redaction Enforcement
Before writing ANY compact, the agent MUST run this checklist:
1. ✅ No file paths (replace with `<REDACTED_PATH>`)
2. ✅ No URLs (replace with `<REDACTED_URL>`)
3. ✅ No internal IPs (replace with `<INTERNAL_URL>`)
4. ✅ No passwords, tokens, API keys (delete entirely)
5. ✅ No personal info beyond work context

If any item fails → do not write the compact until fixed.

### Privacy Boundaries

### What Compacts May Contain
- Decisions, facts, pending actions, blockers
- Project names and feature descriptions

### What Compacts Must NOT Contain
- File system paths (use `<REDACTED_PATH>` placeholder)
- Internal URLs, endpoints, or infrastructure details
- API keys, tokens, passwords, secrets (script-level regex filter)
- Private keys or certificates
- User personal information beyond work context

### Agent Rules
- Before saving a compact, strip or redact all paths, internal URLs, and credentials
- Use placeholders: `<PROJECT_ROOT>`, `<INTERNAL_URL>`, `<DB_CONFIG>`
- If unsure whether something is sensitive, redact it
- Compacts are for "what was decided" not "where things live"

### Data

_meta.json

{
  "ownerId": "kn75t3k9zdjzzwq7nefq2zmfvd82t5r2",
  "slug": "context-compactor-zero-dep",
  "version": "1.1.3",
  "publishedAt": 1774986012724
}

references/compaction_prompt.md

# Compaction Prompt Template

When the agent decides to use LLM-based compaction (for complex conversations
where keyword extraction isn't sufficient), use this prompt.

## LLM Prompt

```
Compress the following conversation into a structured session digest.
Be concise. Omit filler, greetings, and repeated information.

Output format:

## Decisions Made
- [date] Decision description

## Facts Established
- [TYPE] Fact (use [PROJ] [TECH] [PREF] [PEOPLE] tags)

## Pending Actions
- [ ] Action description

## Blockers
- Blocker description

## Session Summary
(2-3 sentences max)

Rules:
1. Max 15 items total across all sections
2. No passwords, tokens, or API keys
3. No file paths, internal URLs, or infrastructure details — use placeholders like <PROJECT_ROOT>
4. Skip debugging noise unless it led to a lesson
5. Be specific about decisions but vague about locations
6. Be specific: "chose SQLite for prompt storage" not "chose a database"

Conversation:
---
{conversation_text}
---
```

## When to Use LLM vs Keyword

| Scenario | Method |
|----------|--------|
| Simple Q&A, <20 turns | Keyword (`compact_session.py --extract`) |
| Multi-topic, 20-50 turns | Either works |
| Complex debugging, >50 turns | LLM (needs nuanced understanding) |
| User wants exact summary | LLM (better at following instructions) |
| Quick save before /new | Keyword (fast, zero cost) |

skill-card.md

## Description:

Automatic context compression for OpenClaw sessions that summarizes long conversations into structured digests, stores local compact files, and helps inject relevant prior context into new sessions.

This skill is ready for commercial/non-commercial use.

## Publisher:

[zgjq](https://clawhub.ai/user/zgjq)

### License/Terms of Use:

MIT-0

## Use Case:

Developers and agent users use this skill to condense long OpenClaw conversations into reusable session memory, recover recent decisions and pending work, and reduce repeated context in later sessions.

### Deployment Geography for Use:

Global

## Known Risks and Mitigations:

Risk: Conversation-derived information may be stored and reinjected into later sessions, including sensitive project context.

Mitigation: Use only when local cross-session memory is intended, inspect generated compacts, and avoid compacting conversations that contain credentials, customer data, or private infrastructure details.

Risk: Current redaction checks are not a complete secret scanner.

Mitigation: Redact sensitive details before compaction and review compact output instead of relying solely on built-in filtering.

Risk: Opt-in LLM compaction can send conversation text to the configured LLM provider.

Mitigation: Use keyword-based local extraction for sensitive sessions, or confirm that the configured LLM provider is approved for the conversation contents.

## Reference(s):

- [ClawHub skill page](https://clawhub.ai/zgjq/skills/context-compactor-zero-dep)
- [Compaction prompt template](artifact/references/compaction_prompt.md)

## Skill Output:

**Output Type(s):** [text, markdown, shell commands, configuration, guidance]

**Output Format:** [Markdown session digests, shell command snippets, and local compact-file operations]

**Output Parameters:** [1D]

**Other Properties Related to Output:** [Standard-library Python workflow; local compact retention is capped at 30 files.]

## Skill Version(s):

1.1.3 (source: server release metadata)

## Ethical Considerations:

Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.

Sponsored

Ads related to Context Compactor (Zero Dep) and adjacent AI workflows.