{"id":"1991e8db-e073-4a8f-a8ec-783f0b7dbf0d","entityType":"agent","slug":"aeromomo-claw-compactor","name":"claw-compactor","canonicalUrl":"https://www.xpersona.co/agent/aeromomo-claw-compactor","canonicalPath":"/agent/aeromomo-claw-compactor","generatedAt":"2026-10-09T07:16:33.384Z","source":"GITHUB_OPENCLEW","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-04-15T05:21:22.124Z","emptyReason":null},"description":"--- --- name: claw-compactor description: \"Claw Compactor v6.0 — 50%+ savings through rule-based compression, dictionary encoding, session observation compression, and progressive context loading.\" Claw Compactor $1 $1 $1 $1 $1 $1 *\"Cut your tokens. Keep your facts.\"* **Cut your AI agent's token spend in half.** One command compresses your entire workspace — memory files, session transcripts, sub-agent context — using 5","descriptionLabel":"Technical summary","evidenceSummary":"Published capability contract available. No trust telemetry is available yet. 1K GitHub stars reported by the source. Last updated 4/15/2026.","installCommand":"git clone https://github.com/aeromomo/claw-compactor.git","sourceUrl":"https://github.com/aeromomo/claw-compactor","homepage":null,"primaryLinks":[{"label":"View Source","url":"https://github.com/aeromomo/claw-compactor","kind":"source"}],"safetyScore":100,"overallRank":37.96,"popularityScore":75,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"--- --- name: claw-compactor description: \"Claw Compactor v6.0 — 50%+ savings through rule-based compression, dictionary encoding, session observation compressi"},"coverage":{"evidence":{"source":"capability-contract + public-profile","verified":true,"confidence":"high","updatedAt":"2026-02-24T19:42:57.658Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[{"label":"i","status":"self-declared"},{"label":"including","status":"self-declared"}],"verifiedCount":0,"selfDeclaredCount":3,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"},{"key":"i","type":"capability","support":"supported","confidenceSource":"profile","notes":"Declared in agent profile metadata"},{"key":"including","type":"capability","support":"supported","confidenceSource":"profile","notes":"Declared in agent profile metadata"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile capability:i|supported|profile capability:including|supported|profile"}},"adoption":{"evidence":{"source":"GITHUB OPENCLEW","verified":false,"confidence":"medium","updatedAt":"2026-04-15T05:21:22.124Z","emptyReason":null},"stars":1021,"forks":83,"downloads":null,"packageName":null,"latestVersion":null,"tractionLabel":"1K GitHub stars"},"release":{"evidence":{"source":"agent-index","verified":false,"confidence":"medium","updatedAt":"2026-02-24T01:53:09.858Z","emptyReason":null},"lastUpdatedAt":"2026-04-15T05:21:22.124Z","lastCrawledAt":"2026-02-24T01:53:09.858Z","lastIndexedAt":null,"nextCrawlAt":"2026-02-25T01:53:09.858Z","lastVerifiedAt":null,"highlights":[]},"execution":{"evidence":{"source":"capability-contract","verified":true,"confidence":"high","updatedAt":"2026-02-24T19:42:57.658Z","emptyReason":null},"installCommand":"git clone https://github.com/aeromomo/claw-compactor.git","setupComplexity":"low","setupSteps":["Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.","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":{"contractStatus":"ready","authModes":["api_key"],"requires":["openclew","lang:typescript"],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":"https://github.com/aeromomo/claw-compactor#input","outputSchemaRef":"https://github.com/aeromomo/claw-compactor#output","dataRegion":"global","contractUpdatedAt":"2026-02-24T19:42:57.658Z","sourceUpdatedAt":"2026-02-24T19:42:57.658Z","freshnessSeconds":19568015},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/aeromomo-claw-compactor/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/aeromomo-claw-compactor/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/aeromomo-claw-compactor/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/aeromomo-claw-compactor/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/aeromomo-claw-compactor/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/aeromomo-claw-compactor/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"GITHUB_OPENCLEW","generatedAt":"2026-10-09T07:16:33.384Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/aeromomo-claw-compactor/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/aeromomo-claw-compactor/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/aeromomo-claw-compactor/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/aeromomo-claw-compactor/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":[],"safeUseWhen":["Contract is available with explicit auth and schema references.","Trust confidence is not low and verification freshness is acceptable."],"riskFlags":["trust_data_unavailable"],"operationalConfidence":"medium"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"GITHUB OPENCLEW","verified":false,"confidence":"high","updatedAt":"2026-04-15T05:21:22.124Z","emptyReason":null},"readme":"---\nname: claw-compactor\ndescription: \"Claw Compactor v6.0 — 50%+ savings through rule-based compression, dictionary encoding, session observation compression, and progressive context loading.\"\n\n# Claw Compactor\n![Claw Compactor Banner](assets/banner.png)\n\n[![Build](https://img.shields.io/badge/build-passing-brightgreen)](https://github.com/aeromomo/claw-compactor) [![Release](https://img.shields.io/github/v/release/aeromomo/claw-compactor?color=blue)](https://github.com/aeromomo/claw-compactor/releases) [![Tests](https://img.shields.io/badge/tests-800%20passed-brightgreen)](https://github.com/aeromomo/claw-compactor) [![Python](https://img.shields.io/badge/python-3.9%2B-blue)](https://python.org) [![License](https://img.shields.io/badge/license-MIT-purple)](LICENSE) [![OpenClaw](https://img.shields.io/badge/OpenClaw-skill-orange)](https://openclaw.ai)\n\n*\"Cut your tokens. Keep your facts.\"*\n\n**Cut your AI agent's token spend in half.** One command compresses your entire workspace — memory files, session transcripts, sub-agent context — using 5 layered compression techniques. Deterministic. Mostly lossless. No LLM required.\n\n## Features\n- **5 compression layers** working in sequence for maximum savings\n- **Zero LLM cost** — all compression is rule-based and deterministic\n- **Lossless roundtrip** for dictionary, RLE, and rule-based compression\n- **~97% savings** on session transcripts via observation extraction\n- **Tiered summaries** (L0/L1/L2) for progressive context loading\n- **CJK-aware** — full Chinese/Japanese/Korean support\n- **One command** (`full`) runs everything in optimal order\n\n## 5 Compression Layers\n| 1 | Rule engine | Dedup lines, strip markdown filler, merge sections | 4-8% | |\n| 2 | Dictionary encoding | Auto-learned codebook, `$XX` substitution | 4-5% | |\n| 3 | Observation compression | Session JSONL → structured summaries | ~97% | * |\n| 4 | RLE patterns | Path shorthand (`$WS`), IP prefix, enum compaction | 1-2% | |\n| 5 | Compressed Context Protocol | ultra/medium/light abbreviation | 20-60% | * |\n\n\\*Lossy techniques preserve all facts and decisions; only verbose formatting is removed.\n\n## Quick Start\n```bash\ngit clone https://github.com/aeromomo/claw-compactor.git\ncd claw-compactor\n\n# See how much you'd save (non-destructive)\npython3 scripts/mem_compress.py /path/to/workspace benchmark\n\n# Compress everything\npython3 scripts/mem_compress.py /path/to/workspace full\n```\n\n**Requirements:** Python 3.9+. Optional: `pip install tiktoken` for exact token counts (falls back to heuristic).\n\n## Architecture\n┌─────────────────────────────────────────────────────────────┐\n│ mem_compress.py │\n│ (unified entry point) │\n└──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬────┘\n │ │ │ │ │ │ │ │\n ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼\n estimate compress dict dedup observe tiers audit optimize\n └──────┴──────┴──┬───┴──────┴──────┴──────┴──────┘\n ▼\n ┌────────────────┐\n │ lib/ │\n │ tokens.py │ ← tiktoken or heuristic\n │ markdown.py │ ← section parsing\n │ dedup.py │ ← shingle hashing\n │ dictionary.py │ ← codebook compression\n │ rle.py │ ← path/IP/enum encoding\n │ tokenizer_ │\n │ optimizer.py │ ← format optimization\n │ config.py │ ← JSON config\n │ exceptions.py │ ← error types\n └────────────────┘\n\n## Commands\nAll commands: `python3 scripts/mem_compress.py <workspace> <command> [options]`\n\n`full`, Description=Complete pipeline (all steps in order), Typical Savings=50%+ combined\n`benchmark`, Description=Dry-run performance report, Typical Savings=—\n`compress`, Description=Rule-based compression, Typical Savings=4-8%\n`dict`, Description=Dictionary encoding with auto-codebook, Typical Savings=4-5%\n`observe`, Description=Session transcript → observations, Typical Savings=~97%\n`tiers`, Description=Generate L0/L1/L2 summaries, Typical Savings=88-95% on sub-agent loads\n`dedup`, Description=Cross-file duplicate detection, Typical Savings=varies\n`estimate`, Description=Token count report, Typical Savings=—\n`audit`, Description=Workspace health check, Typical Savings=—\n`optimize`, Description=Tokenizer-level format fixes, Typical Savings=1-3%\n\n### Global Options\n- `--json` — Machine-readable JSON output\n- `--dry-run` — Preview changes without writing\n- `--since YYYY-MM-DD` — Filter sessions by date\n- `--auto-merge` — Auto-merge duplicates (dedup)\n\n## Real-World Savings\nSession transcripts (observe), Typical Savings=**~97%**, Notes=Megabytes of JSONL → concise observation MD\nVerbose/new workspace, Typical Savings=**50-70%**, Notes=First run on unoptimized workspace\nRegular maintenance, Typical Savings=**10-20%**, Notes=Weekly runs on active workspace\nAlready-optimized, Typical Savings=**3-12%**, Notes=Diminishing returns — workspace is clean\n\n## cacheRetention — Complementary Optimization\nBefore compression runs, enable **prompt caching** for a 90% discount on cached tokens:\n\n```json\n{\n \"agents\": {\n \"defaults\": {\n \"models\": {\n  \"anthropic/claude-opus-4-6\": {\n   \"params\": {\n    \"cacheRetention\": \"long\"\n   }\n  }\n }\n }\n }\n\nCompression reduces token count, caching reduces cost-per-token. Together: 50% compression + 90% cache discount = **95% effective cost reduction**.\n\n## Heartbeat Automation\nRun weekly or on heartbeat:\n\n```markdown\n\n## Memory Maintenance (weekly)\n- python3 skills/claw-compactor/scripts/mem_compress.py <workspace> benchmark\n- If savings > 5%: run full pipeline\n- If pending transcripts: run observe\n\nCron example:\n0 3 * * 0 cd /path/to/skills/claw-compactor && python3 scripts/mem_compress.py /path/to/workspace full\n\n## Configuration\nOptional `claw-compactor-config.json` in workspace root:\n\n \"chars_per_token\": 4,\n \"level0_max_tokens\": 200,\n \"level1_max_tokens\": 500,\n \"dedup_similarity_threshold\": 0.6,\n \"dedup_shingle_size\": 3\n\nAll fields optional — sensible defaults are used when absent.\n\n## Artifacts\n- `memory/.codebook.json`: Dictionary codebook (must travel with memory files)\n- `memory/.observed-sessions.json`: Tracks processed transcripts\n- `memory/observations/`: Compressed session summaries\n- `memory/MEMORY-L0.md`: Level 0 summary (~200 tokens)\n\n## FAQ\n**Q: Will compression lose my data?**\nA: Rule engine, dictionary, RLE, and tokenizer optimization are fully lossless. Observation compression and CCP are lossy but preserve all facts and decisions.\n\n**Q: How does dictionary decompression work?**\nA: `decompress_text(text, codebook)` expands all `$XX` codes back. The codebook JSON must be present.\n\n**Q: Can I run individual steps?**\nA: Yes. Every command is independent: `compress`, `dict`, `observe`, `tiers`, `dedup`, `optimize`.\n\n**Q: What if tiktoken isn't installed?**\nA: Falls back to a CJK-aware heuristic (chars÷4). Results are ~90% accurate.\n\n**Q: Does it handle Chinese/Japanese/Unicode?**\nA: Yes. Full CJK support including character-aware token estimation and Chinese punctuation normalization.\n\n## Troubleshooting\n- **`FileNotFoundError` on workspace:** Ensure path points to workspace root (contains `memory/` or `MEMORY.md`)\n- **Dictionary decompression fails:** Check `memory/.codebook.json` exists and is valid JSON\n- **Zero savings on `benchmark`:** Workspace is already optimized — nothing to do\n- **`observe` finds no transcripts:** Check sessions directory for `.jsonl` files\n- **Token count seems wrong:** Install tiktoken: `pip3 install tiktoken`\n\n## Credits\n- Inspired by [claude-mem](https://github.com/thedotmack/claude-mem) by thedotmack\n- Built by Bot777 for [OpenClaw](https://openclaw.ai)\n\n## License\nMIT","readmeExcerpt":"--- name: claw-compactor description: \"Claw Compactor v6.0 — 50%+ savings through rule-based compression, dictionary encoding, session observation compression, and progressive context loading.\" Claw Compactor $1 $1 $1 $1 $1 $1 *\"Cut your tokens. Keep your facts.\"* **Cut your AI agent's token spend in half.** One command compresses your entire workspace — memory files, session transcripts, sub-agent context — using 5 ","codeSnippets":[],"executableExamples":[{"language":"bash","snippet":"git clone https://github.com/aeromomo/claw-compactor.git\ncd claw-compactor\n\n# See how much you'd save (non-destructive)\npython3 scripts/mem_compress.py /path/to/workspace benchmark\n\n# Compress everything\npython3 scripts/mem_compress.py /path/to/workspace full"},{"language":"json","snippet":"{\n \"agents\": {\n \"defaults\": {\n \"models\": {\n  \"anthropic/claude-opus-4-6\": {\n   \"params\": {\n    \"cacheRetention\": \"long\"\n   }\n  }\n }\n }\n }\n\nCompression reduces token count, caching reduces cost-per-token. Together: 50% compression + 90% cache discount = **95% effective cost reduction**.\n\n## Heartbeat Automation\nRun weekly or on heartbeat:"}],"parameters":{},"dependencies":[],"permissions":[],"extractedFiles":[],"languages":["typescript"],"docsSourceLabel":"GITHUB OPENCLEW","editorialOverview":"--- --- name: claw-compactor description: \"Claw Compactor v6.0 — 50%+ savings through rule-based compression, dictionary encoding, session observation compression, and progressive context loading.\" Claw Compactor $1 $1 $1 $1 $1 $1 *\"Cut your tokens. Keep your facts.\"* **Cut your AI agent's token spend in half.** One command compresses your entire workspace — memory files, session transcripts, sub-agent context — using 5","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":350,"uniquenessScore":69,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-04-15T05:21:22.124Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-04-15T05:21:22.124Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-09T07:16:33.384Z","emptyReason":null},"items":[{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-10T18:48:31.762Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/github_openclew","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}