{"id":"e10f1691-394b-444c-a4bc-ac441e50a596","entityType":"agent","slug":"clawhub-parad0x-labs-context-capsule","name":"Openclaw Context Capsule","canonicalUrl":"https://www.xpersona.co/agent/clawhub-parad0x-labs-context-capsule","canonicalPath":"/agent/clawhub-parad0x-labs-context-capsule","generatedAt":"2026-10-11T00:32:17.815Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-10T22:05:18.779Z","emptyReason":null},"description":"Compresses older OpenClaw agent session history into a bounded, lane-change-aware context capsule — keeps recent messages verbatim, flags abandoned directions, quarantines injected instructions, and redacts secrets. Local, deterministic, any model.","descriptionLabel":"Source description","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 1.2K downloads reported by the source. Last updated 10/10/2026.","installCommand":"clawhub skill install s17f1wyc9w1zq21b4wj4a63xw187x632:context-capsule","sourceUrl":"https://clawhub.ai/parad0x-labs/context-capsule","homepage":"https://clawhub.ai/parad0x-labs/skills/context-capsule","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/parad0x-labs/context-capsule","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/parad0x-labs/skills/context-capsule","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":62,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Openclaw Context Capsule technical dossier on Xpersona with agent coverage, OPENCLEW support, and live trust metadata."},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-10T22:05:18.779Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-10T22:05:18.779Z","emptyReason":null},"stars":null,"forks":null,"downloads":1247,"packageName":null,"latestVersion":"1.6.1","tractionLabel":"1.2K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-10T22:05:18.708Z","emptyReason":null},"lastUpdatedAt":"2026-10-10T22:05:18.779Z","lastCrawledAt":"2026-10-10T22:05:18.708Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-11T22:05:18.708Z","lastVerifiedAt":null,"highlights":[{"version":"1.6.1","createdAt":"2026-07-09T20:47:38.561Z","changelog":"v1.7.0 - Value-atom preservation: a lone port (5433), issue ref (#4821), version (v2.13.0), ISO date, or hyphenated code now survives compression as its own atom — even when its surrounding line is dropped. New regression: test/value-survival.test.mjs. - Corrected the documented config defaults (maxCapsuleTokens 700 → 1400, capsuleTokenRatio 0.08 → 0.14) to match the shipped values. - Reframed the fidelity figures as measured on your own private sessions via test/fidelity-bench.mjs (reproduce on your data), not a repo fixture.","fileCount":13,"zipByteSize":36134},{"version":"1.6.0","createdAt":"2026-06-21T16:52:23.082Z","changelog":"v1.6.0 • Lane-change awareness — when a session pivots (\"use Y instead of X\"), the capsule marks the abandoned direction as superseded and keeps the live one, so the model never wanders back into a dropped plan. On the held-out pivot set: 83% of abandoned subjects cleaned, zero live choices wrongly flagged. • Dense-atom fidelity — file paths, IDs, ports, URLs, commands, errors and decisions are emitted as compact atoms: 79% of key signals kept at ~5× reduction, 93% at ~3.4×. • Defense-in-depth secret redaction — API keys, JWTs, PEM blocks, basic-auth URLs and DSNs are redacted before compression and again on output, each with a one-way SHA-256 fingerprint so the same key stays correlatable across turns without ever exposing its value. • Injection quarantine — instruction-injection patterns in older history are wrapped as inert untrusted text, never surfaced as a live instruction. • Self-contained — no runtime dependencies, no network/filesystem/on-chain calls, fully deterministic. Ships prebuilt and dependency-free: drop it in, no build step.","fileCount":10,"zipByteSize":32564},{"version":"1.4.0","createdAt":"2026-06-03T20:42:09.845Z","changelog":"Made the skill fully self-contained: vendored the compression core inline (zlib + SHA-256 only) and removed the external @parad0x_labs/context-capsule dependency. No network, file-system, or on-chain access. Tightened the plugin description with explicit when-to-use / when-not-to-use guidance. Removes the \"unresolved external package\" that drove prior audit Review outcomes.","fileCount":8,"zipByteSize":12994},{"version":"1.3.1","createdAt":"2026-06-03T19:39:09.068Z","changelog":"Pin context-capsule dep to exact 1.0.0 — removes ^ range, fixes SkillSpector supply-chain flag.","fileCount":7,"zipByteSize":9110},{"version":"1.3.0","createdAt":"2026-06-03T17:06:40.837Z","changelog":"Security: fix fail-open vault — compression error fallback now returns vault-scanned (redacted) messages instead of raw originals. Secrets/PII can no longer leak to the model if compression throws. Operator visibility: compression failures now emit a console.warn with the error message so fallbacks are never silent. Resolves both SkillSpector medium findings from v1.2.0 audit.","fileCount":7,"zipByteSize":8972},{"version":"1.2.0","createdAt":"2026-06-03T15:07:09.909Z","changelog":"- Vault scan now applied to ALL message paths: short sessions, verbatim tail, and compressed history. Previously only older messages were scanned (fixes SkillSpector Finding 1 - Intent-Code Divergence) - README: added explicit warnings about compression fidelity loss, system-message injection, vault scan coverage limits, and dependency provenance (fixes SkillSpector Finding 2 - Missing User Warnings)","fileCount":7,"zipByteSize":8553},{"version":"1.1.0","createdAt":"2026-06-03T14:41:36.382Z","changelog":"- Add inline vault-scan gate: strips API keys, tokens, credentials, PII, and card numbers from all message content before compression (addresses SkillSpector Medium finding) - No matched values are logged — only category counts - Add plain-English data handling disclosure to SKILL.md","fileCount":7,"zipByteSize":7806},{"version":"1.0.0","createdAt":"2026-06-02T19:22:38.079Z","changelog":"- Initial release: compresses agent session history by 99.3% before sending to LLMs. - Retains last 10 messages verbatim; earlier history is compressed into a 60-token capsule. - Maintains high memory accuracy (answers 30/30 questions correctly on benchmark). - Compatible with Claude, GPT, Ollama, Mistral, LM Studio, and more. - Significant token and cost savings per call; continuous benchmarking ensures efficiency.","fileCount":7,"zipByteSize":6598}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s17f1wyc9w1zq21b4wj4a63xw187x632:context-capsule","setupComplexity":"low","setupSteps":["Install using `clawhub skill install s17f1wyc9w1zq21b4wj4a63xw187x632:context-capsule` in an isolated environment before connecting it to live workloads.","No published capability contract is available yet, so validate auth and request/response behavior manually.","Review the upstream CLAWHUB listing at https://clawhub.ai/parad0x-labs/context-capsule before using production credentials."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-parad0x-labs-context-capsule/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-parad0x-labs-context-capsule/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-parad0x-labs-context-capsule/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-parad0x-labs-context-capsule/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-parad0x-labs-context-capsule/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-parad0x-labs-context-capsule/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-11T00:32:17.812Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-parad0x-labs-context-capsule/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-parad0x-labs-context-capsule/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-parad0x-labs-context-capsule/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-parad0x-labs-context-capsule/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":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"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":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-10T22:05:18.779Z","emptyReason":null},"readme":"Skill: Openclaw Context Capsule\n\nOwner: parad0x-labs\n\nSummary: Compresses older OpenClaw agent session history into a bounded, lane-change-aware context capsule — keeps recent messages verbatim, flags abandoned directions, quarantines injected instructions, and redacts secrets. Local, deterministic, any model.\n\nTags: agent-memory:1.3.1, compression:1.6.0, context:1.6.0, context-compression:1.4.0, latest:1.6.1, llm:1.4.0, memory:1.6.0, ollama:1.4.0, openclaw:1.6.0, openclaw-plugin:1.4.0, parad0x-labs:1.4.0, privacy:1.4.0, self-contained:1.4.0, session-history:1.3.0, token-savings:1.4.0, tokens:1.6.0, vault-scan:1.4.0, zero-dependencies:1.4.0\n\nVersion history:\n\nv1.6.1 | 2026-07-09T20:47:38.561Z | user\n\nv1.7.0\n- Value-atom preservation: a lone port (5433), issue ref (#4821), version (v2.13.0), ISO date, or hyphenated code now survives compression as its own atom — even when its surrounding line is dropped. New regression: test/value-survival.test.mjs.\n- Corrected the documented config defaults (maxCapsuleTokens 700 → 1400, capsuleTokenRatio 0.08 → 0.14) to match the shipped values.\n- Reframed the fidelity figures as measured on your own private sessions via test/fidelity-bench.mjs (reproduce on your data), not a repo fixture.\n\nv1.6.0 | 2026-06-21T16:52:23.082Z | user\n\nv1.6.0\n\n• Lane-change awareness — when a session pivots (\"use Y instead of X\"), the\n  capsule marks the abandoned direction as superseded and keeps the live one,\n  so the model never wanders back into a dropped plan. On the held-out pivot\n  set: 83% of abandoned subjects cleaned, zero live choices wrongly flagged.\n\n• Dense-atom fidelity — file paths, IDs, ports, URLs, commands, errors and\n  decisions are emitted as compact atoms: 79% of key signals kept at ~5×\n  reduction, 93% at ~3.4×.\n\n• Defense-in-depth secret redaction — API keys, JWTs, PEM blocks, basic-auth\n  URLs and DSNs are redacted before compression and again on output, each with\n  a one-way SHA-256 fingerprint so the same key stays correlatable across turns\n  without ever exposing its value.\n\n• Injection quarantine — instruction-injection patterns in older history are\n  wrapped as inert untrusted text, never surfaced as a live instruction.\n\n• Self-contained — no runtime dependencies, no network/filesystem/on-chain\n  calls, fully deterministic. Ships prebuilt and dependency-free: drop it in,\n  no build step.\n\nv1.4.0 | 2026-06-03T20:42:09.845Z | user\n\nMade the skill fully self-contained: vendored the compression core inline (zlib + SHA-256 only) and removed the external @parad0x_labs/context-capsule dependency. No network, file-system, or on-chain access. Tightened the plugin description with explicit when-to-use / when-not-to-use guidance. Removes the \"unresolved external package\" that drove prior audit Review outcomes.\n\nv1.3.1 | 2026-06-03T19:39:09.068Z | user\n\nPin context-capsule dep to exact 1.0.0 — removes ^ range, fixes SkillSpector supply-chain flag.\n\nv1.3.0 | 2026-06-03T17:06:40.837Z | user\n\nSecurity: fix fail-open vault — compression error fallback now returns\nvault-scanned (redacted) messages instead of raw originals. Secrets/PII\ncan no longer leak to the model if compression throws.\n\nOperator visibility: compression failures now emit a console.warn with\nthe error message so fallbacks are never silent.\n\nResolves both SkillSpector medium findings from v1.2.0 audit.\n\nv1.2.0 | 2026-06-03T15:07:09.909Z | user\n\n- Vault scan now applied to ALL message paths: short sessions, verbatim tail, and compressed history. Previously only older messages were scanned (fixes SkillSpector Finding 1 - Intent-Code Divergence)\n- README: added explicit warnings about compression fidelity loss, system-message injection, vault scan coverage limits, and dependency provenance (fixes SkillSpector Finding 2 - Missing User Warnings)\n\nv1.1.0 | 2026-06-03T14:41:36.382Z | user\n\n- Add inline vault-scan gate: strips API keys, tokens, credentials, PII, and card numbers from all message content before compression (addresses SkillSpector Medium finding)\n- No matched values are logged — only category counts\n- Add plain-English data handling disclosure to SKILL.md\n\nv1.0.0 | 2026-06-02T19:22:38.079Z | auto\n\n- Initial release: compresses agent session history by 99.3% before sending to LLMs.\n- Retains last 10 messages verbatim; earlier history is compressed into a 60-token capsule.\n- Maintains high memory accuracy (answers 30/30 questions correctly on benchmark).\n- Compatible with Claude, GPT, Ollama, Mistral, LM Studio, and more.\n- Significant token and cost savings per call; continuous benchmarking ensures efficiency.\n\nArchive index:\n\nArchive v1.6.1: 13 files, 36134 bytes\n\nFiles: CHANGELOG.md (1119b), dist/compression.d.ts (2665b), dist/compression.js (55294b), dist/index.d.ts (973b), dist/index.js (13097b), dist/platform.d.ts (747b), dist/platform.js (2290b), openclaw.plugin.json (1311b), package.json (1618b), README.md (2695b), skill-card.md (2249b), SKILL.md (5772b), _meta.json (134b)\n\nFile v1.6.1:SKILL.md\n\n---\nname: context-capsule\ndescription: Compresses older OpenClaw agent session history into a bounded, lane-change-aware context capsule — keeps recent messages verbatim, flags abandoned directions, quarantines injected instructions, and redacts secrets. Local, deterministic, any model.\nlicense: MIT\nmetadata:\n  author: Parad0x-Labs\n---\n\n# Context Capsule\n\nCompress older agent session history before it hits the LLM, so long chats stop\nre-sending the full transcript every turn. It keeps the recent tail verbatim and\nturns older history into a bounded extractive capsule with decisions, tasks,\nerrors, paths, links, questions, and durable facts. Works with any model —\nClaude, GPT, Ollama, Mistral, LM Studio.\n\n**What sets it apart:**\n\n- **Lane-change aware.** When the session pivots (\"replace X with Y\", \"forget X,\n  use Y instead\"), the capsule marks the abandoned direction as superseded and\n  keeps the live one — so the model never wanders back into a dropped plan. On a\n  held-out pivot set it cleans 83% of abandoned subjects with **zero** wrongly\n  flagged live choices.\n- **High fidelity per token.** Distinctive signals — file paths, IDs, ports,\n  URLs, commands, errors, decisions — are emitted as dense atoms. As of **v1.7.0**,\n  a lone value (a bare port `5433`, an issue ref `#4821`, a version `v2.13.0`, an\n  ISO date, a hyphenated code like `NEEDLE-ZX-7742`) is emitted as its **own** atom,\n  so it survives compression even when its surrounding sentence loses the budget\n  race — CI-tested in `test/value-survival.test.mjs`. On the maintainer's own real\n  sessions the capsule kept ~79% of key signals at ~5× reduction and ~93% at ~3.4×;\n  `test/fidelity-bench.mjs` measures this against **your own** `~/.openclaw` sessions\n  (run it on your data to reproduce — the figures are from private sessions, not a\n  repo fixture).\n\n> **Self-contained (v1.7.0):** The compression core is bundled directly in this\n> skill (`src/compression.ts`). There is **no external runtime dependency**, and\n> the plugin makes **no network, file-system, or on-chain calls**. Everything\n> runs locally using only Node's built-in `zlib` and `crypto`, and is fully\n> deterministic. Capsules carry a `schema` tag (`context-capsule.v2`).\n\n> **Protections (defense-in-depth, all CI-gated by `npm test`):**\n> - **Secret redaction (every surface).** API keys (OpenAI, Anthropic, AWS,\n>   Google, GitHub classic + fine-grained, GitLab, npm, Slack, Stripe, SendGrid,\n>   Twilio), JWTs, PEM blocks, URL basic-auth, `DATABASE_URL=` DSNs, and\n>   `key=value` credentials are detected by prefix/shape/context — never by raw\n>   entropy, so public IDs (git SHAs, UUIDs, chain addresses) are untouched.\n>   Redaction runs **before compression**, so no secret survives even in the zlib\n>   audit blob, and again on output — the core never emits a secret even if called\n>   directly. Each redaction carries a one-way **SHA-256 fingerprint**\n>   (`[REDACTED_AWS_KEY#a1b2c3d4]`) so the same key is correlatable across turns\n>   without ever exposing its value. Best-effort pattern matching — strong, not a\n>   guarantee for the most sensitive chats.\n> - **Injection quarantine** — instruction-injection patterns in older history\n>   (\"ignore previous instructions\", \"you are now…\", \"reveal your prompt\") are\n>   wrapped as inert untrusted text, never surfaced as a live instruction.\n> - **Bounded work** — every extraction pass runs on size-capped input, so a\n>   megabyte message or an adversarial string finishes in milliseconds instead of\n>   hanging the turn.\n\n## When to use\n\n- Long-running agent sessions (default: more than 20 messages) where the\n  transcript is large and you want to cut per-call token cost.\n- Any model/provider — local or hosted.\n\n## When NOT to use\n\n- Sessions that require **exact, verbatim transcript fidelity**. Older history is\n  summarized into a compact capsule; detail and nuance can be lost. Only the most\n  recent 10 messages are kept verbatim.\n- As your only safeguard for secrets/PII. The vault scan is best-effort, and the\n  compressed history is injected into the **system** context position.\n\n## How it works\n\nKeeps the last 10 messages verbatim by default. Older history is zlib-compressed\nfor auditability, then converted into a model-readable extractive capsule. The\nmodel sees compact sections for decisions/constraints, tasks, errors, files,\ncommands, links, questions, and durable facts. The capsule is capped by\n`maxCapsuleTokens` and adapts to the host token budget with\n`capsuleTokenRatio`.\n\n## Savings\n\n|                       | Without | With     |\n| --------------------- | ------- | -------- |\n| Prompt history sent   | Full transcript | Capsule + recent tail |\n| Compression trigger   | N/A     | Message + token threshold |\n| Runtime dependencies  | N/A     | Node built-ins only |\n\n## Install\n\nThis skill is self-contained — no extra packages to install. Register it as your\ncontext engine in `openclaw.json`:\n\n```jsonc\n{\n  \"plugins\": {\n    \"slots\": { \"contextEngine\": \"context-capsule\" }\n  }\n}\n```\n\nOptional config (defaults shown):\n\n```jsonc\n{\n  \"plugins\": {\n    \"entries\": {\n      \"context-capsule\": {\n        \"minMessages\": 20,\n        \"keepRecentMessages\": 10,\n        \"maxCapsuleTokens\": 1400,\n        \"capsuleTokenRatio\": 0.14,\n        \"minCompressTokens\": 900\n      }\n    }\n  }\n}\n```\n\n## Source\n\ngithub.com/Parad0x-Labs/openclaw-skills/tree/main/skills/context-capsule\n\nThe standalone library (`@parad0x_labs/context-capsule`) is published separately\non npm for non-OpenClaw use; this skill vendors only the two pure functions it\nneeds and does not depend on it at runtime.\n\n---\n\n💜 If Context Capsule is quietly shrinking your token bill, a ⭐ on ClawHub helps\nother agent builders find it.\n\nFile v1.6.1:README.md\n\n# context-capsule — OpenClaw ContextEngine plugin\n\nSelf-contained OpenClaw context engine that reduces prompt tokens in long agent\nsessions. It keeps the recent tail verbatim and converts older history into a\nbounded, model-readable extractive capsule.\n\nThe capsule preserves high-value older context:\n\n- decisions and constraints\n- open tasks and requested work\n- errors and failed attempts\n- files, commands, and links\n- open questions and durable facts\n\nIt also keeps a zlib-compressed payload and Merkle root for auditability, but the\nLLM is given the extractive capsule, not opaque compressed bytes.\n\n## Safety and limits\n\n- **Lossy by design.** Older messages are not preserved verbatim in the model\n  prompt. Exact wording, nuance, and low-priority details can be lost.\n- **Recent context remains verbatim.** `keepRecentMessages` controls how many\n  latest messages stay untouched.\n- **Best-effort vault scan.** Text content is scanned for common secrets and PII\n  before compression or model injection. This is useful defense-in-depth, not a\n  formal guarantee.\n- **No external runtime dependency.** The plugin uses only Node built-ins\n  (`zlib` and `crypto`) and makes no network, file-system, or on-chain calls.\n\n## Activation\n\n```jsonc\n// openclaw.json\n{\n  \"plugins\": {\n    \"slots\": {\n      \"contextEngine\": \"context-capsule\"\n    }\n  }\n}\n```\n\n## Config options\n\n| Key | Default | Description |\n| --- | ---: | --- |\n| `minMessages` | `20` | Sessions shorter than this pass through unchanged. |\n| `keepRecentMessages` | `10` | Recent messages kept verbatim after compression. |\n| `maxCapsuleTokens` | `1400` | Hard cap for the injected extractive capsule. |\n| `capsuleTokenRatio` | `0.14` | If OpenClaw provides a model token budget, cap the capsule to this fraction of the budget. |\n| `minCompressTokens` | `900` | Estimated transcript-token floor before compression activates. |\n\n```jsonc\n{\n  \"plugins\": {\n    \"entries\": {\n      \"context-capsule\": {\n        \"minMessages\": 20,\n        \"keepRecentMessages\": 10,\n        \"maxCapsuleTokens\": 1400,\n        \"capsuleTokenRatio\": 0.14,\n        \"minCompressTokens\": 900\n      }\n    }\n  }\n}\n```\n\n## Packaging\n\nThe npm/ClawHub package ships compiled `dist/` JavaScript. It does not require\nTypeScript support from the host runtime.\n\n```sh\nnpm run typecheck\nnpm test\nnpm pack --dry-run\n```\n\n## When to use\n\nUse this for long-running local or hosted model sessions where resending the full\nconversation is too expensive or pushes the model toward context overflow.\n\nDo not use it for workflows where old transcript wording must remain exact. For\nthat, keep normal OpenClaw history or use a retrieval system that can quote the\noriginal source.\n\nFile v1.6.1:_meta.json\n\n{\n  \"ownerId\": \"kn7bp6ev0v1qec2qahhgdvzt3x81q4fv\",\n  \"slug\": \"context-capsule\",\n  \"version\": \"1.6.1\",\n  \"publishedAt\": 1783630058561\n}\n\nFile v1.6.1:CHANGELOG.md\n\n# Changelog\n\n## 1.7.0\n\n- **Value-atom preservation.** A lone distinctive value — a bare port (`5433`), an\n  issue ref (`#4821`), a version (`v2.13.0`), an ISO date, or a hyphenated code\n  (`NEEDLE-ZX-7742`) — is now emitted as its own dense atom, so it survives\n  compression even when its surrounding sentence loses the budget race. Previously\n  such a value only survived when its whole line was selected. New regression:\n  `test/value-survival.test.mjs` (wired into `npm test`).\n- **Docs accuracy.** Corrected the documented config defaults (`maxCapsuleTokens`\n  `700` → `1400`, `capsuleTokenRatio` `0.08` → `0.14`) to match the shipped values.\n  Reframed the fidelity figures to state plainly that they are measured on the\n  maintainer's own private sessions via `test/fidelity-bench.mjs` (reproduce on your\n  own `~/.openclaw` sessions), not a repo fixture. The supersession clean rate (83%\n  floor) and value-survival remain CI-gated by `npm test`.\n\n## 1.6.0\n\n- Self-contained compression core bundled in `src/compression.ts` (no external\n  runtime dependency; no network / file-system / on-chain calls).\n\nFile v1.6.1:skill-card.md\n\n## Description:\n\nOpenclaw Context Capsule compresses older OpenClaw agent session history into a bounded, lane-change-aware context capsule while keeping recent messages verbatim, redacting credential-shaped secrets, and quarantining injected instructions.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[parad0x-labs](https://clawhub.ai/user/parad0x-labs)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and agent operators use this skill to reduce prompt tokens in long OpenClaw sessions while keeping recent turns and important older decisions, tasks, errors, paths, links, and durable facts available to the model.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Older session history is summarized rather than preserved verbatim, so exact wording, nuance, or low-priority details can be lost.\n\nMitigation: Use the skill for long-running sessions where bounded context is acceptable; keep original logs or retrieval sources available when exact transcript fidelity is required.\n\nRisk: Credential-shaped secrets are redacted on a best-effort basis, but semantic personal or confidential details may still appear in retained context.\n\nMitigation: Do not treat the skill as the only privacy control for highly sensitive chats; limit sensitive inputs and apply host-level data handling controls.\n\n## Reference(s):\n\n- [Openclaw Context Capsule ClawHub listing](https://clawhub.ai/parad0x-labs/skills/context-capsule)\n- [README](README.md)\n- [Changelog](CHANGELOG.md)\n\n## Skill Output:\n\n**Output Type(s):** [text, JSON, configuration]\n\n**Output Format:** [Model-readable text capsule with JSON-compatible capsule metadata and OpenClaw configuration examples]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Older history is lossy and bounded by maxCapsuleTokens and capsuleTokenRatio; recent messages are retained verbatim.]\n\n## Skill Version(s):\n\n1.6.1 (source: ClawHub release metadata)\n\n## Ethical Considerations:\n\nUsers 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.\n\nFile v1.6.1:openclaw.plugin.json\n\n{\n  \"id\": \"context-capsule\",\n  \"activation\": {\n    \"onStartup\": false\n  },\n  \"enabledByDefault\": false,\n  \"configSchema\": {\n    \"type\": \"object\",\n    \"additionalProperties\": false,\n    \"properties\": {\n      \"minMessages\": {\n        \"type\": \"integer\",\n        \"minimum\": 1,\n        \"description\": \"Minimum session length (messages) before compression is applied. Default: 20.\"\n      },\n      \"keepRecentMessages\": {\n        \"type\": \"integer\",\n        \"minimum\": 1,\n        \"description\": \"Number of most-recent messages kept verbatim after compression. Default: 10.\"\n      },\n      \"maxCapsuleTokens\": {\n        \"type\": \"integer\",\n        \"minimum\": 120,\n        \"maximum\": 4000,\n        \"description\": \"Maximum tokens reserved for the injected extractive capsule. Default: 1400 (tuned for fidelity — near the knee of the recall/compression curve).\"\n      },\n      \"capsuleTokenRatio\": {\n        \"type\": \"number\",\n        \"minimum\": 0.01,\n        \"maximum\": 0.5,\n        \"description\": \"When the host provides a model token budget, cap the capsule at this fraction of that budget. Default: 0.14.\"\n      },\n      \"minCompressTokens\": {\n        \"type\": \"integer\",\n        \"minimum\": 0,\n        \"description\": \"Minimum estimated transcript tokens before compression is applied. Default: 900.\"\n      }\n    }\n  }\n}\n\nFile v1.6.1:package.json\n\n{\n  \"name\": \"@parad0x_labs/openclaw-context-capsule\",\n  \"version\": \"1.7.0\",\n  \"description\": \"Self-contained OpenClaw context engine that compresses older agent session history into a bounded extractive capsule, preserving decisions, tasks, errors, files, links, and durable facts while keeping recent messages verbatim.\",\n  \"type\": \"module\",\n  \"main\": \"./dist/index.js\",\n  \"files\": [\n    \"dist/\",\n    \"openclaw.plugin.json\",\n    \"README.md\",\n    \"SKILL.md\",\n    \"CHANGELOG.md\"\n  ],\n  \"keywords\": [\n    \"openclaw\",\n    \"openclaw-plugin\",\n    \"context-compression\",\n    \"llm\",\n    \"token-savings\",\n    \"ollama\",\n    \"context-capsule\"\n  ],\n  \"openclaw\": {\n    \"extensions\": [\n      \"./dist/index.js\"\n    ],\n    \"compat\": {\n      \"pluginApi\": \"1.x\"\n    },\n    \"build\": {\n      \"openclawVersion\": \">=2026.6.0\"\n    }\n  },\n  \"devDependencies\": {\n    \"@noble/hashes\": \"^2.2.0\",\n    \"@types/node\": \"^22.0.0\",\n    \"pako\": \"^2.1.0\",\n    \"typescript\": \"^5.6.0\"\n  },\n  \"scripts\": {\n    \"build\": \"tsc -p tsconfig.json\",\n    \"typecheck\": \"tsc --noEmit -p tsconfig.json\",\n    \"prepack\": \"npm run build\",\n    \"prepublishOnly\": \"npm run build && npm test\",\n    \"test\": \"npm run build && node test/compression-smoke.mjs && node test/quality.test.mjs && node test/value-survival.test.mjs && node test/supersession-bench.mjs && node test/hardening-bench.mjs && node test/secret-bench.mjs && node test/platform-parity.test.mjs\"\n  },\n  \"engines\": {\n    \"node\": \">=22\"\n  },\n  \"license\": \"MIT\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/Parad0x-Labs/openclaw-skills\",\n    \"directory\": \"skills/context-capsule\"\n  }\n}\n\nArchive v1.6.0: 10 files, 32564 bytes\n\nFiles: dist/compression.d.ts (2309b), dist/compression.js (53879b), dist/index.d.ts (973b), dist/index.js (13097b), openclaw.plugin.json (1311b), package.json (1422b), README.md (2693b), skill-card.md (2269b), SKILL.md (5245b), _meta.json (134b)\n\nFile v1.6.0:SKILL.md\n\n---\nname: context-capsule\ndescription: Compresses older OpenClaw agent session history into a bounded, lane-change-aware context capsule — keeps recent messages verbatim, flags abandoned directions, quarantines injected instructions, and redacts secrets. Local, deterministic, any model.\n---\n\n# Context Capsule\n\nCompress older agent session history before it hits the LLM, so long chats stop\nre-sending the full transcript every turn. It keeps the recent tail verbatim and\nturns older history into a bounded extractive capsule with decisions, tasks,\nerrors, paths, links, questions, and durable facts. Works with any model —\nClaude, GPT, Ollama, Mistral, LM Studio.\n\n**What sets it apart:**\n\n- **Lane-change aware.** When the session pivots (\"replace X with Y\", \"forget X,\n  use Y instead\"), the capsule marks the abandoned direction as superseded and\n  keeps the live one — so the model never wanders back into a dropped plan. On a\n  held-out pivot set it cleans 83% of abandoned subjects with **zero** wrongly\n  flagged live choices.\n- **High fidelity per token.** Distinctive signals — file paths, IDs, ports,\n  URLs, commands, errors, decisions — are emitted as dense atoms, so the capsule\n  keeps **79% of key signals at ~5× reduction and 93% at ~3.4×** on real\n  sessions (measured, see `test/fidelity-bench.mjs`).\n\n> **Self-contained (v1.6.0):** The compression core is bundled directly in this\n> skill (`src/compression.ts`). There is **no external runtime dependency**, and\n> the plugin makes **no network, file-system, or on-chain calls**. Everything\n> runs locally using only Node's built-in `zlib` and `crypto`, and is fully\n> deterministic. Capsules carry a `schema` tag (`context-capsule.v2`).\n\n> **Protections (defense-in-depth, all CI-gated by `npm test`):**\n> - **Secret redaction (every surface).** API keys (OpenAI, Anthropic, AWS,\n>   Google, GitHub classic + fine-grained, GitLab, npm, Slack, Stripe, SendGrid,\n>   Twilio), JWTs, PEM blocks, URL basic-auth, `DATABASE_URL=` DSNs, and\n>   `key=value` credentials are detected by prefix/shape/context — never by raw\n>   entropy, so public IDs (git SHAs, UUIDs, chain addresses) are untouched.\n>   Redaction runs **before compression**, so no secret survives even in the zlib\n>   audit blob, and again on output — the core never emits a secret even if called\n>   directly. Each redaction carries a one-way **SHA-256 fingerprint**\n>   (`[REDACTED_AWS_KEY#a1b2c3d4]`) so the same key is correlatable across turns\n>   without ever exposing its value. Best-effort pattern matching — strong, not a\n>   guarantee for the most sensitive chats.\n> - **Injection quarantine** — instruction-injection patterns in older history\n>   (\"ignore previous instructions\", \"you are now…\", \"reveal your prompt\") are\n>   wrapped as inert untrusted text, never surfaced as a live instruction.\n> - **Bounded work** — every extraction pass runs on size-capped input, so a\n>   megabyte message or an adversarial string finishes in milliseconds instead of\n>   hanging the turn.\n\n## When to use\n\n- Long-running agent sessions (default: more than 20 messages) where the\n  transcript is large and you want to cut per-call token cost.\n- Any model/provider — local or hosted.\n\n## When NOT to use\n\n- Sessions that require **exact, verbatim transcript fidelity**. Older history is\n  summarized into a compact capsule; detail and nuance can be lost. Only the most\n  recent 10 messages are kept verbatim.\n- As your only safeguard for secrets/PII. The vault scan is best-effort, and the\n  compressed history is injected into the **system** context position.\n\n## How it works\n\nKeeps the last 10 messages verbatim by default. Older history is zlib-compressed\nfor auditability, then converted into a model-readable extractive capsule. The\nmodel sees compact sections for decisions/constraints, tasks, errors, files,\ncommands, links, questions, and durable facts. The capsule is capped by\n`maxCapsuleTokens` and adapts to the host token budget with\n`capsuleTokenRatio`.\n\n## Savings\n\n|                       | Without | With     |\n| --------------------- | ------- | -------- |\n| Prompt history sent   | Full transcript | Capsule + recent tail |\n| Compression trigger   | N/A     | Message + token threshold |\n| Runtime dependencies  | N/A     | Node built-ins only |\n\n## Install\n\nThis skill is self-contained — no extra packages to install. Register it as your\ncontext engine in `openclaw.json`:\n\n```jsonc\n{\n  \"plugins\": {\n    \"slots\": { \"contextEngine\": \"context-capsule\" }\n  }\n}\n```\n\nOptional config (defaults shown):\n\n```jsonc\n{\n  \"plugins\": {\n    \"entries\": {\n      \"context-capsule\": {\n        \"minMessages\": 20,\n        \"keepRecentMessages\": 10,\n        \"maxCapsuleTokens\": 1400,\n        \"capsuleTokenRatio\": 0.14,\n        \"minCompressTokens\": 900\n      }\n    }\n  }\n}\n```\n\n## Source\n\ngithub.com/Parad0x-Labs/openclaw-skills/tree/main/skills/context-capsule\n\nThe standalone library (`@parad0x_labs/context-capsule`) is published separately\non npm for non-OpenClaw use; this skill vendors only the two pure functions it\nneeds and does not depend on it at runtime.\n\n---\n\n💜 If Context Capsule is quietly shrinking your token bill, a ⭐ on ClawHub helps\nother agent builders find it.\n\nFile v1.6.0:README.md\n\n# context-capsule — OpenClaw ContextEngine plugin\n\nSelf-contained OpenClaw context engine that reduces prompt tokens in long agent\nsessions. It keeps the recent tail verbatim and converts older history into a\nbounded, model-readable extractive capsule.\n\nThe capsule preserves high-value older context:\n\n- decisions and constraints\n- open tasks and requested work\n- errors and failed attempts\n- files, commands, and links\n- open questions and durable facts\n\nIt also keeps a zlib-compressed payload and Merkle root for auditability, but the\nLLM is given the extractive capsule, not opaque compressed bytes.\n\n## Safety and limits\n\n- **Lossy by design.** Older messages are not preserved verbatim in the model\n  prompt. Exact wording, nuance, and low-priority details can be lost.\n- **Recent context remains verbatim.** `keepRecentMessages` controls how many\n  latest messages stay untouched.\n- **Best-effort vault scan.** Text content is scanned for common secrets and PII\n  before compression or model injection. This is useful defense-in-depth, not a\n  formal guarantee.\n- **No external runtime dependency.** The plugin uses only Node built-ins\n  (`zlib` and `crypto`) and makes no network, file-system, or on-chain calls.\n\n## Activation\n\n```jsonc\n// openclaw.json\n{\n  \"plugins\": {\n    \"slots\": {\n      \"contextEngine\": \"context-capsule\"\n    }\n  }\n}\n```\n\n## Config options\n\n| Key | Default | Description |\n| --- | ---: | --- |\n| `minMessages` | `20` | Sessions shorter than this pass through unchanged. |\n| `keepRecentMessages` | `10` | Recent messages kept verbatim after compression. |\n| `maxCapsuleTokens` | `700` | Hard cap for the injected extractive capsule. |\n| `capsuleTokenRatio` | `0.08` | If OpenClaw provides a model token budget, cap the capsule to this fraction of the budget. |\n| `minCompressTokens` | `900` | Estimated transcript-token floor before compression activates. |\n\n```jsonc\n{\n  \"plugins\": {\n    \"entries\": {\n      \"context-capsule\": {\n        \"minMessages\": 20,\n        \"keepRecentMessages\": 10,\n        \"maxCapsuleTokens\": 700,\n        \"capsuleTokenRatio\": 0.08,\n        \"minCompressTokens\": 900\n      }\n    }\n  }\n}\n```\n\n## Packaging\n\nThe npm/ClawHub package ships compiled `dist/` JavaScript. It does not require\nTypeScript support from the host runtime.\n\n```sh\nnpm run typecheck\nnpm test\nnpm pack --dry-run\n```\n\n## When to use\n\nUse this for long-running local or hosted model sessions where resending the full\nconversation is too expensive or pushes the model toward context overflow.\n\nDo not use it for workflows where old transcript wording must remain exact. For\nthat, keep normal OpenClaw history or use a retrieval system that can quote the\noriginal source.\n\nFile v1.6.0:_meta.json\n\n{\n  \"ownerId\": \"kn7bp6ev0v1qec2qahhgdvzt3x81q4fv\",\n  \"slug\": \"context-capsule\",\n  \"version\": \"1.6.0\",\n  \"publishedAt\": 1782060743082\n}\n\nFile v1.6.0:skill-card.md\n\n## Description: <br>\nCompresses older OpenClaw agent session history into a bounded, lane-change-aware context capsule that keeps recent messages verbatim, flags abandoned directions, quarantines injected instructions, and redacts secrets. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[parad0x-labs](https://clawhub.ai/user/parad0x-labs) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers and agent operators use this skill to reduce prompt size in long-running OpenClaw sessions while preserving recent messages and high-value older context such as decisions, tasks, errors, files, links, questions, and durable facts. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Older session history is compressed into a lossy capsule, so exact wording, nuance, and low-priority details can be lost. <br>\nMitigation: Use normal history or a retrieval system when verbatim transcript fidelity is required, and review important long-session context before relying on it. <br>\nRisk: Secret and PII redaction is best-effort pattern matching and should not be treated as a formal privacy guarantee. <br>\nMitigation: Avoid using the skill as the only safeguard for sensitive chats, and keep credential handling controls in place before agent sessions reach the context engine. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/parad0x-labs/context-capsule) <br>\n- [README](README.md) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, configuration] <br>\n**Output Format:** [Plain-text extractive context capsule with configurable plugin settings] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Capsule size and activation are controlled by minMessages, keepRecentMessages, maxCapsuleTokens, capsuleTokenRatio, and minCompressTokens.] <br>\n\n## Skill Version(s): <br>\n1.6.0 (source: server release metadata and package.json) <br>\n\n## Ethical Considerations: <br>\nUsers 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. <br>\n\nFile v1.6.0:openclaw.plugin.json\n\n{\n  \"id\": \"context-capsule\",\n  \"activation\": {\n    \"onStartup\": false\n  },\n  \"enabledByDefault\": false,\n  \"configSchema\": {\n    \"type\": \"object\",\n    \"additionalProperties\": false,\n    \"properties\": {\n      \"minMessages\": {\n        \"type\": \"integer\",\n        \"minimum\": 1,\n        \"description\": \"Minimum session length (messages) before compression is applied. Default: 20.\"\n      },\n      \"keepRecentMessages\": {\n        \"type\": \"integer\",\n        \"minimum\": 1,\n        \"description\": \"Number of most-recent messages kept verbatim after compression. Default: 10.\"\n      },\n      \"maxCapsuleTokens\": {\n        \"type\": \"integer\",\n        \"minimum\": 120,\n        \"maximum\": 4000,\n        \"description\": \"Maximum tokens reserved for the injected extractive capsule. Default: 1400 (tuned for fidelity — near the knee of the recall/compression curve).\"\n      },\n      \"capsuleTokenRatio\": {\n        \"type\": \"number\",\n        \"minimum\": 0.01,\n        \"maximum\": 0.5,\n        \"description\": \"When the host provides a model token budget, cap the capsule at this fraction of that budget. Default: 0.14.\"\n      },\n      \"minCompressTokens\": {\n        \"type\": \"integer\",\n        \"minimum\": 0,\n        \"description\": \"Minimum estimated transcript tokens before compression is applied. Default: 900.\"\n      }\n    }\n  }\n}\n\nFile v1.6.0:package.json\n\n{\n  \"name\": \"@parad0x_labs/openclaw-context-capsule\",\n  \"version\": \"1.6.0\",\n  \"description\": \"Self-contained OpenClaw context engine that compresses older agent session history into a bounded extractive capsule, preserving decisions, tasks, errors, files, links, and durable facts while keeping recent messages verbatim.\",\n  \"type\": \"module\",\n  \"main\": \"./dist/index.js\",\n  \"files\": [\n    \"dist/\",\n    \"openclaw.plugin.json\",\n    \"README.md\",\n    \"SKILL.md\"\n  ],\n  \"keywords\": [\n    \"openclaw\",\n    \"openclaw-plugin\",\n    \"context-compression\",\n    \"llm\",\n    \"token-savings\",\n    \"ollama\",\n    \"context-capsule\"\n  ],\n  \"openclaw\": {\n    \"extensions\": [\n      \"./dist/index.js\"\n    ],\n    \"build\": {\n      \"openclawVersion\": \">=2026.6.0\"\n    }\n  },\n  \"devDependencies\": {\n    \"@types/node\": \"^22.0.0\",\n    \"typescript\": \"^5.6.0\"\n  },\n  \"scripts\": {\n    \"build\": \"tsc -p tsconfig.json\",\n    \"typecheck\": \"tsc --noEmit -p tsconfig.json\",\n    \"prepack\": \"npm run build\",\n    \"prepublishOnly\": \"npm run build && npm test\",\n    \"test\": \"npm run build && node test/compression-smoke.mjs && node test/quality.test.mjs && node test/supersession-bench.mjs && node test/hardening-bench.mjs && node test/secret-bench.mjs\"\n  },\n  \"engines\": {\n    \"node\": \">=22\"\n  },\n  \"license\": \"MIT\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/Parad0x-Labs/openclaw-skills\",\n    \"directory\": \"skills/context-capsule\"\n  }\n}\n\nArchive v1.4.0: 8 files, 12994 bytes\n\nFiles: openclaw.plugin.json (586b), package.json (1005b), README.md (2817b), skill-card.md (2638b), SKILL.md (2765b), src/compression.ts (6464b), src/index.ts (13126b), _meta.json (134b)\n\nFile v1.4.0:SKILL.md\n\n# Context Capsule\n\nCompress agent session history ~99% before it hits the LLM, so you stop paying\nto re-send the whole transcript on every call. Works with any model — Claude,\nGPT, Ollama, Mistral, LM Studio.\n\n> **Self-contained (v1.4.0):** The compression core is bundled directly in this\n> skill (`src/compression.ts`). There is **no external runtime dependency**, and\n> the plugin makes **no network, file-system, or on-chain calls**. Everything\n> runs locally using only Node's built-in `zlib` and `crypto`.\n\n> **Data handling:** Every message is scanned by an inline vault gate before it\n> reaches the compression core or the model — on every code path, including short\n> sessions, the verbatim tail, and the compression-failure fallback. API keys,\n> tokens, credentials, PII, and card numbers are replaced with typed\n> placeholders. No matched values are logged, only category counts. Redaction is\n> best-effort pattern matching, **not a guarantee** — do not rely on it as the\n> sole protection for highly sensitive chats.\n\n## When to use\n\n- Long-running agent sessions (default: more than 20 messages) where the\n  transcript is large and you want to cut per-call token cost.\n- Any model/provider — local or hosted.\n\n## When NOT to use\n\n- Sessions that require **exact, verbatim transcript fidelity**. Older history is\n  summarized into a compact capsule; detail and nuance can be lost. Only the most\n  recent 10 messages are kept verbatim.\n- As your only safeguard for secrets/PII. The vault scan is best-effort, and the\n  compressed history is injected into the **system** context position.\n\n## How it works\n\nKeeps the last 10 messages verbatim. Compresses everything older into a ~60-token\ncapsule (zlib deflate + a topic/Merkle summary). In benchmarks the agent still\nanswers 30/30 memory-recall questions correctly.\n\n## Savings\n\n|                       | Without | With     |\n| --------------------- | ------- | -------- |\n| Tokens per call       | 7,583   | 53       |\n| Cost (Claude Sonnet)  | $0.023  | $0.00016 |\n| Monthly (50 calls/day)| ~$34    | ~$0.24   |\n\n## Install\n\nThis skill is self-contained — no extra packages to install. Register it as your\ncontext engine in `openclaw.json`:\n\n```jsonc\n{\n  \"plugins\": {\n    \"slots\": { \"contextEngine\": \"context-capsule\" }\n  }\n}\n```\n\nOptional config (defaults shown):\n\n```jsonc\n{\n  \"plugins\": {\n    \"entries\": {\n      \"context-capsule\": { \"minMessages\": 20, \"keepRecentMessages\": 10 }\n    }\n  }\n}\n```\n\n## Source\n\ngithub.com/Parad0x-Labs/dna-x402/tree/main/packages/openclaw-context-capsule\n\nThe standalone library (`@parad0x_labs/context-capsule`) is published separately\non npm for non-OpenClaw use; this skill vendors only the two pure functions it\nneeds and does not depend on it at runtime.\n\nFile v1.4.0:README.md\n\n# context-capsule — OpenClaw ContextEngine plugin\n\nCompresses agent session history before it reaches the LLM. **Self-contained:**\nthe compression core is vendored inline (`src/compression.ts`) — no external\nruntime dependency, and no network, file-system, or on-chain access. It uses\nonly Node's built-in `zlib` and `crypto`.\n\nSessions under 20 messages pass through unchanged. Longer sessions have their\nolder history compressed into a capsule summary (injected as a system message)\nwhile the last 10 messages are kept verbatim — giving the model full coherence\non recent turns without paying for the full transcript.\n\n> **Before you use this skill — read these:**\n>\n> - **All messages are vault-scanned** for secrets and PII on every path (short\n>   sessions, verbatim tail, and compressed history alike). Matched values are\n>   replaced with typed placeholders. However, the vault scan covers common\n>   patterns — it is not a guarantee that all sensitive content is removed.\n>   Do not rely on it as the sole protection for highly sensitive sessions.\n>\n> - **Compression alters history fidelity.** Older messages are summarised, not\n>   preserved verbatim. Detail, nuance, and exact wording can be lost. Do not\n>   use this skill where exact transcript fidelity is required.\n>\n> - **Compressed history is injected as a system message.** This places\n>   summarised content in a privileged prompt position. Be aware that prior\n>   user/assistant content will influence the model from the system role after\n>   compression.\n>\n> - **No external runtime dependency.** The compression core is vendored inline\n>   (`src/compression.ts`), so there is nothing external to resolve or verify.\n>   The standalone `@parad0x_labs/context-capsule` library on npm is optional and\n>   only relevant for non-OpenClaw use.\n\n**Most useful for:** local models (Ollama, LM Studio) and GPT-4 where context\ncost matters. Claude users with a 200k context window and built-in compaction\nenabled may not need this.\n\n## Benchmark\n\n| Metric | Result | CI gate |\n|---|---|---|\n| Token savings | 99.3% | >= 95% |\n| Recovery score | 100% | >= 90% |\n| Runtime | 29ms | < 1000ms |\n\nReproduce locally:\n\n```sh\ncd packages/context-capsule\nnpm run bench:public\n```\n\nCI fails if savings drop below 95% or recovery falls below 90%.\n\n## Activation\n\n```jsonc\n// openclaw.json\n{\n  \"plugins\": {\n    \"slots\": {\n      \"contextEngine\": \"context-capsule\"\n    }\n  }\n}\n```\n\n## Config options\n\n| Key | Default | Description |\n|---|---|---|\n| `minMessages` | `20` | Sessions shorter than this pass through unchanged |\n| `keepRecentMessages` | `10` | Recent messages kept verbatim after compression |\n\n```jsonc\n{\n  \"plugins\": {\n    \"entries\": {\n      \"context-capsule\": {\n        \"minMessages\": 15,\n        \"keepRecentMessages\": 8\n      }\n    }\n  }\n}\n```\n\nFile v1.4.0:_meta.json\n\n{\n  \"ownerId\": \"kn7bp6ev0v1qec2qahhgdvzt3x81q4fv\",\n  \"slug\": \"context-capsule\",\n  \"version\": \"1.4.0\",\n  \"publishedAt\": 1780519329845\n}\n\nFile v1.4.0:skill-card.md\n\n## Description: <br>\nCompresses long agent session history into a compact local context capsule before model calls while keeping recent messages verbatim. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[parad0x-labs](https://clawhub.ai/user/parad0x-labs) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers and agent operators use this skill as an OpenClaw context engine to reduce token usage in long-running sessions while retaining recent turns verbatim. It is most appropriate when approximate older-history recall is acceptable and exact transcript fidelity is not required. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Older chat history is summarized rather than preserved exactly, so details, nuance, or exact wording can be lost. <br>\nMitigation: Use this skill only for sessions where approximate older-history recall is acceptable, and keep exact source material outside the compressed context when verbatim fidelity is required. <br>\nRisk: Summarized prior history is placed into system context and can influence later model behavior from a privileged prompt position. <br>\nMitigation: Review whether system-context reinjection is appropriate for the workflow and avoid using the skill for sessions where prior untrusted content should not receive elevated prompt authority. <br>\nRisk: The built-in redaction is best-effort pattern matching and may not remove all sensitive content. <br>\nMitigation: Do not rely on the skill as the only protection for secrets or highly sensitive data; apply separate data-handling safeguards before use. <br>\n\n\n## Reference(s): <br>\n- [Openclaw Context Capsule on ClawHub](https://clawhub.ai/parad0x-labs/context-capsule) <br>\n- [Publisher profile](https://clawhub.ai/user/parad0x-labs) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, configuration] <br>\n**Output Format:** [Agent message context containing a compact system-context capsule plus recent messages kept verbatim.] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Configurable message threshold and recent-message retention; older history is summarized and best-effort redacted before compression.] <br>\n\n## Skill Version(s): <br>\n1.4.0 (source: server release metadata and package.json) <br>\n\n## Ethical Considerations: <br>\nUsers 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. <br>\n\nFile v1.4.0:openclaw.plugin.json\n\n{\n  \"id\": \"context-capsule\",\n  \"activation\": {\n    \"onStartup\": false\n  },\n  \"enabledByDefault\": false,\n  \"configSchema\": {\n    \"type\": \"object\",\n    \"additionalProperties\": false,\n    \"properties\": {\n      \"minMessages\": {\n        \"type\": \"integer\",\n        \"minimum\": 1,\n        \"description\": \"Minimum session length (messages) before compression is applied. Default: 20.\"\n      },\n      \"keepRecentMessages\": {\n        \"type\": \"integer\",\n        \"minimum\": 1,\n        \"description\": \"Number of most-recent messages kept verbatim after compression. Default: 10.\"\n      }\n    }\n  }\n}\n\nFile v1.4.0:package.json\n\n{\n  \"name\": \"@parad0x_labs/openclaw-context-capsule\",\n  \"version\": \"1.4.0\",\n  \"description\": \"Self-contained OpenClaw context engine that compresses long agent session history (> 20 messages) into a compact capsule before the model call, keeping the last 10 messages verbatim. Cuts token cost on long chats with any model. No external runtime dependencies; no network, file, or on-chain access.\",\n  \"type\": \"module\",\n  \"main\": \"./src/index.ts\",\n  \"files\": [\n    \"src/\",\n    \"openclaw.plugin.json\",\n    \"README.md\"\n  ],\n  \"keywords\": [\n    \"openclaw\",\n    \"openclaw-plugin\",\n    \"context-compression\",\n    \"llm\",\n    \"token-savings\",\n    \"ollama\",\n    \"context-capsule\"\n  ],\n  \"openclaw\": {\n    \"extensions\": [\n      \"./src/index.ts\"\n    ],\n    \"compat\": {\n      \"pluginApi\": \"1.x\"\n    },\n    \"build\": {\n      \"openclawVersion\": \">=1.0.0\"\n    }\n  },\n  \"engines\": {\n    \"node\": \">=22\"\n  },\n  \"license\": \"MIT\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/Parad0x-Labs/dna-x402\"\n  }\n}\n\nArchive v1.3.1: 7 files, 9110 bytes\n\nFiles: openclaw.plugin.json (586b), package.json (910b), README.md (2602b), skill-card.md (2803b), SKILL.md (1044b), src/index.ts (12218b), _meta.json (134b)\n\nFile v1.3.1:SKILL.md\n\n# Context Capsule\n\nCompress agent session history 99.3% before it hits the LLM.\nWorks with Claude, GPT, Ollama, Mistral, LM Studio — any model.\n\n> **Data handling (v1.1.0):** Every message is scanned by an inline vault gate\n> before reaching the compression library. API keys, tokens, credentials, PII,\n> and card numbers are replaced with typed placeholders. No matched values are\n> logged — only category counts. Compression runs locally; nothing is sent to\n> external services.\n\n## What it does\n\nKeeps last 10 messages verbatim. Compresses the rest into a\n60-token capsule. Agent still answers 30/30 memory questions correctly.\n\n## Savings\n\n| | Without | With |\n|---|---|---|\n| Tokens per call | 7,583 | 53 |\n| Cost (Claude Sonnet) | $0.023 | $0.00016 |\n| Monthly (50 calls/day) | ~$34 | ~$0.24 |\n\n## Install\n\n```\nnpm i @parad0x_labs/context-capsule\n```\n\n## Benchmark\n\n```\nnpm run bench:public\n```\n\nCI fails if savings drop below 95% or recovery below 90%.\n\n## Source\n\ngithub.com/Parad0x-Labs/dna-x402/tree/main/packages/context-capsule\n\nFile v1.3.1:README.md\n\n# context-capsule — OpenClaw ContextEngine plugin\n\nCompresses agent session history before it reaches the LLM using\n[`@parad0x_labs/context-capsule`](https://github.com/Parad0x-Labs/dna-x402/tree/main/packages/context-capsule).\nSessions under 20 messages pass through unchanged. Longer sessions have their\nolder history compressed into a capsule summary (injected as a system message)\nwhile the last 10 messages are kept verbatim — giving the model full coherence\non recent turns without paying for the full transcript.\n\n> **Before you use this skill — read these:**\n>\n> - **All messages are vault-scanned** for secrets and PII on every path (short\n>   sessions, verbatim tail, and compressed history alike). Matched values are\n>   replaced with typed placeholders. However, the vault scan covers common\n>   patterns — it is not a guarantee that all sensitive content is removed.\n>   Do not rely on it as the sole protection for highly sensitive sessions.\n>\n> - **Compression alters history fidelity.** Older messages are summarised, not\n>   preserved verbatim. Detail, nuance, and exact wording can be lost. Do not\n>   use this skill where exact transcript fidelity is required.\n>\n> - **Compressed history is injected as a system message.** This places\n>   summarised content in a privileged prompt position. Be aware that prior\n>   user/assistant content will influence the model from the system role after\n>   compression.\n>\n> - **The `@parad0x_labs/context-capsule` dependency** must be resolvable in\n>   your environment. Verify its source and provenance before deploying in\n>   production.\n\n**Most useful for:** local models (Ollama, LM Studio) and GPT-4 where context\ncost matters. Claude users with a 200k context window and built-in compaction\nenabled may not need this.\n\n## Benchmark\n\n| Metric | Result | CI gate |\n|---|---|---|\n| Token savings | 99.3% | >= 95% |\n| Recovery score | 100% | >= 90% |\n| Runtime | 29ms | < 1000ms |\n\nReproduce locally:\n\n```sh\ncd packages/context-capsule\nnpm run bench:public\n```\n\nCI fails if savings drop below 95% or recovery falls below 90%.\n\n## Activation\n\n```jsonc\n// openclaw.json\n{\n  \"plugins\": {\n    \"slots\": {\n      \"contextEngine\": \"context-capsule\"\n    }\n  }\n}\n```\n\n## Config options\n\n| Key | Default | Description |\n|---|---|---|\n| `minMessages` | `20` | Sessions shorter than this pass through unchanged |\n| `keepRecentMessages` | `10` | Recent messages kept verbatim after compression |\n\n```jsonc\n{\n  \"plugins\": {\n    \"entries\": {\n      \"context-capsule\": {\n        \"minMessages\": 15,\n        \"keepRecentMessages\": 8\n      }\n    }\n  }\n}\n```\n\nFile v1.3.1:_meta.json\n\n{\n  \"ownerId\": \"kn7bp6ev0v1qec2qahhgdvzt3x81q4fv\",\n  \"slug\": \"context-capsule\",\n  \"version\": \"1.3.1\",\n  \"publishedAt\": 1780515549068\n}\n\nFile v1.3.1:skill-card.md\n\n## Description: <br>\nOpenclaw Context Capsule compresses OpenClaw agent session history into a short local context capsule while vault-scanning messages for common secrets and PII before model assembly. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[parad0x-labs](https://clawhub.ai/user/parad0x-labs) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers and operators of OpenClaw agents use this ContextEngine plugin to reduce LLM context cost for long-running sessions while keeping recent messages verbatim. It is most useful when exact older transcript wording is less important than compact conversational continuity. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: A bundled review helper defaults to running a nested agent with full filesystem authority. <br>\nMitigation: Review the helper before installation or invocation and use the documented opt-out path for full-access nested review unless full access is intentional. <br>\nRisk: Vault scanning covers common secrets and PII patterns but may not remove all sensitive content. <br>\nMitigation: Do not rely on vault scanning as the only protection for highly sensitive sessions; review sensitive workflows before deployment. <br>\nRisk: Compression summarizes older history and can lose detail, nuance, or exact wording. <br>\nMitigation: Avoid this skill where exact transcript fidelity is required, or keep a separate authoritative transcript outside the compressed context path. <br>\nRisk: Compressed history is injected as a system message, giving summarized prior content privileged prompt placement. <br>\nMitigation: Use the skill only in contexts where older conversation content is trusted enough to influence later model behavior from a system-context position. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/parad0x-labs/context-capsule) <br>\n- [Artifact README](README.md) <br>\n- [Artifact skill description](SKILL.md) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, configuration, guidance] <br>\n**Output Format:** [OpenClaw ContextEngine message output with a compressed system-message capsule and recent verbatim messages] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Short sessions pass through after vault scanning; older history is summarized and may lose exact wording.] <br>\n\n## Skill Version(s): <br>\n1.3.1 (source: server release metadata and package.json) <br>\n\n## Ethical Considerations: <br>\nUsers 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. <br>\n\nFile v1.3.1:openclaw.plugin.json\n\n{\n  \"id\": \"context-capsule\",\n  \"activation\": {\n    \"onStartup\": false\n  },\n  \"enabledByDefault\": false,\n  \"configSchema\": {\n    \"type\": \"object\",\n    \"additionalProperties\": false,\n    \"properties\": {\n      \"minMessages\": {\n        \"type\": \"integer\",\n        \"minimum\": 1,\n        \"description\": \"Minimum session length (messages) before compression is applied. Default: 20.\"\n      },\n      \"keepRecentMessages\": {\n        \"type\": \"integer\",\n        \"minimum\": 1,\n        \"description\": \"Number of most-recent messages kept verbatim after compression. Default: 10.\"\n      }\n    }\n  }\n}\n\nFile v1.3.1:package.json\n\n{\n  \"name\": \"@parad0x_labs/openclaw-context-capsule\",\n  \"version\": \"1.3.1\",\n  \"description\": \"context-capsule ContextEngine for OpenClaw — 99.3% token reduction with recovery-score gate. Works with Ollama, GPT, Mistral, Claude.\",\n  \"type\": \"module\",\n  \"main\": \"./src/index.ts\",\n  \"files\": [\n    \"src/\",\n    \"openclaw.plugin.json\",\n    \"README.md\"\n  ],\n  \"keywords\": [\n    \"openclaw\",\n    \"openclaw-plugin\",\n    \"context-compression\",\n    \"llm\",\n    \"token-savings\",\n    \"ollama\",\n    \"context-capsule\"\n  ],\n  \"openclaw\": {\n    \"extensions\": [\n      \"./src/index.ts\"\n    ],\n    \"compat\": {\n      \"pluginApi\": \"1.x\"\n    },\n    \"build\": {\n      \"openclawVersion\": \">=1.0.0\"\n    }\n  },\n  \"dependencies\": {\n    \"@parad0x_labs/context-capsule\": \"1.0.0\"\n  },\n  \"engines\": {\n    \"node\": \">=22\"\n  },\n  \"license\": \"MIT\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/Parad0x-Labs/dna-x402\"\n  }\n}\n\nArchive v1.3.0: 7 files, 8972 bytes\n\nFiles: openclaw.plugin.json (586b), package.json (911b), README.md (2602b), skill-card.md (2540b), SKILL.md (1044b), src/index.ts (12218b), _meta.json (134b)\n\nFile v1.3.0:SKILL.md\n\n# Context Capsule\n\nCompress agent session history 99.3% before it hits the LLM.\nWorks with Claude, GPT, Ollama, Mistral, LM Studio — any model.\n\n> **Data handling (v1.1.0):** Every message is scanned by an inline vault gate\n> before reaching the compression library. API keys, tokens, credentials, PII,\n> and card numbers are replaced with typed placeholders. No matched values are\n> logged — only category counts. Compression runs locally; nothing is sent to\n> external services.\n\n## What it does\n\nKeeps last 10 messages verbatim. Compresses the rest into a\n60-token capsule. Agent still answers 30/30 memory questions correctly.\n\n## Savings\n\n| | Without | With |\n|---|---|---|\n| Tokens per call | 7,583 | 53 |\n| Cost (Claude Sonnet) | $0.023 | $0.00016 |\n| Monthly (50 calls/day) | ~$34 | ~$0.24 |\n\n## Install\n\n```\nnpm i @parad0x_labs/context-capsule\n```\n\n## Benchmark\n\n```\nnpm run bench:public\n```\n\nCI fails if savings drop below 95% or recovery below 90%.\n\n## Source\n\ngithub.com/Parad0x-Labs/dna-x402/tree/main/packages/context-capsule\n\nFile v1.3.0:README.md\n\n# context-capsule — OpenClaw ContextEngine plugin\n\nCompresses agent session history before it reaches the LLM using\n[`@parad0x_labs/context-capsule`](https://github.com/Parad0x-Labs/dna-x402/tree/main/packages/context-capsule).\nSessions under 20 messages pass through unchanged. Longer sessions have their\nolder history compressed into a capsule summary (injected as a system message)\nwhile the last 10 messages are kept verbatim — giving the model full coherence\non recent turns without paying for the full transcript.\n\n> **Before you use this skill — read these:**\n>\n> - **All messages are vault-scanned** for secrets and PII on every path (short\n>   sessions, verbatim tail, and compressed history alike). Matched values are\n>   replaced with typed placeholders. However, the vault scan covers common\n>   patterns — it is not a guarantee that all sensitive content is removed.\n>   Do not rely on it as the sole protection for highly sensitive sessions.\n>\n> - **Compression alters history fidelity.** Older messages are summarised, not\n>   preserved verbatim. Detail, nuance, and exact wording can be lost. Do not\n>   use this skill where exact transcript fidelity is required.\n>\n> - **Compressed history is injected as a system message.** This places\n>   summarised content in a privileged prompt position. Be aware that prior\n>   user/assistant content will influence the model from the system role after\n>   compression.\n>\n> - **The `@parad0x_labs/context-capsule` dependency** must be resolvable in\n>   your environment. Verify its source and provenance before deploying in\n>   production.\n\n**Most useful for:** local models (Ollama, LM Studio) and GPT-4 where context\ncost matters. Claude users with a 200k context window and built-in compaction\nenabled may not need this.\n\n## Benchmark\n\n| Metric | Result | CI gate |\n|---|---|---|\n| Token savings | 99.3% | >= 95% |\n| Recovery score | 100% | >= 90% |\n| Runtime | 29ms | < 1000ms |\n\nReproduce locally:\n\n```sh\ncd packages/context-capsule\nnpm run bench:public\n```\n\nCI fails if savings drop below 95% or recovery falls below 90%.\n\n## Activation\n\n```jsonc\n// openclaw.json\n{\n  \"plugins\": {\n    \"slots\": {\n      \"contextEngine\": \"context-capsule\"\n    }\n  }\n}\n```\n\n## Config options\n\n| Key | Default | Description |\n|---|---|---|\n| `minMessages` | `20` | Sessions shorter than this pass through unchanged |\n| `keepRecentMessages` | `10` | Recent messages kept verbatim after compression |\n\n```jsonc\n{\n  \"plugins\": {\n    \"entries\": {\n      \"context-capsule\": {\n        \"minMessages\": 15,\n        \"keepRecentMessages\": 8\n      }\n    }\n  }\n}\n```\n\nFile v1.3.0:_meta.json\n\n{\n  \"ownerId\": \"kn7bp6ev0v1qec2qahhgdvzt3x81q4fv\",\n  \"slug\": \"context-capsule\",\n  \"version\": \"1.3.0\",\n  \"publishedAt\": 1780506400837\n}\n\nFile v1.3.0:skill-card.md\n\n## Description: <br>\nCompresses OpenClaw agent session history before it reaches an LLM, keeping recent turns verbatim while summarizing older history into a short capsule. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[parad0x-labs](https://clawhub.ai/user/parad0x-labs) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers using OpenClaw can use this plugin to reduce token use and context cost for longer agent sessions while preserving recent messages. It is best suited to workflows where summarized older history is acceptable and exact transcript fidelity is not required. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The plugin reads and transforms full agent conversation history. <br>\nMitigation: Install only in environments where plugin access to full conversation history is acceptable, and review deployment boundaries before use. <br>\nRisk: Built-in vault scanning may miss structured message content or sensitive data patterns. <br>\nMitigation: Do not rely on the vault scan as the only protection for sensitive chats; use upstream secret handling and review workflows that include tool results or structured content. <br>\nRisk: The external compression dependency affects what history reaches the model. <br>\nMitigation: Verify the external compression dependency and pin or review it before production use. <br>\nRisk: Older conversation history is summarized, so detail, nuance, and exact wording can be lost. <br>\nMitigation: Avoid this skill where exact transcript fidelity is required, and test thresholds against representative agent sessions. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill listing](https://clawhub.ai/parad0x-labs/context-capsule) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, configuration, guidance] <br>\n**Output Format:** [OpenClaw agent messages with a compressed history system message and verbatim recent messages] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Configurable message thresholds; sessions below the threshold pass through after vault scanning.] <br>\n\n## Skill Version(s): <br>\n1.3.0 (source: server release metadata and package.json) <br>\n\n## Ethical Considerations: <br>\nUsers 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. <br>\n\nFile v1.3.0:openclaw.plugin.json\n\n{\n  \"id\": \"context-capsule\",\n  \"activation\": {\n    \"onStartup\": false\n  },\n  \"enabledByDefault\": false,\n  \"configSchema\": {\n    \"type\": \"object\",\n    \"additionalProperties\": false,\n    \"properties\": {\n      \"minMessages\": {\n        \"type\": \"integer\",\n        \"minimum\": 1,\n        \"description\": \"Minimum session length (messages) before compression is applied. Default: 20.\"\n      },\n      \"keepRecentMessages\": {\n        \"type\": \"integer\",\n        \"minimum\": 1,\n        \"description\": \"Number of most-recent messages kept verbatim after compression. Default: 10.\"\n      }\n    }\n  }\n}\n\nFile v1.3.0:package.json\n\n{\n  \"name\": \"@parad0x_labs/openclaw-context-capsule\",\n  \"version\": \"1.3.0\",\n  \"description\": \"context-capsule ContextEngine for OpenClaw — 99.3% token reduction with recovery-score gate. Works with Ollama, GPT, Mistral, Claude.\",\n  \"type\": \"module\",\n  \"main\": \"./src/index.ts\",\n  \"files\": [\n    \"src/\",\n    \"openclaw.plugin.json\",\n    \"README.md\"\n  ],\n  \"keywords\": [\n    \"openclaw\",\n    \"openclaw-plugin\",\n    \"context-compression\",\n    \"llm\",\n    \"token-savings\",\n    \"ollama\",\n    \"context-capsule\"\n  ],\n  \"openclaw\": {\n    \"extensions\": [\n      \"./src/index.ts\"\n    ],\n    \"compat\": {\n      \"pluginApi\": \"1.x\"\n    },\n    \"build\": {\n      \"openclawVersion\": \">=1.0.0\"\n    }\n  },\n  \"dependencies\": {\n    \"@parad0x_labs/context-capsule\": \"^1.0.0\"\n  },\n  \"engines\": {\n    \"node\": \">=22\"\n  },\n  \"license\": \"MIT\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/Parad0x-Labs/dna-x402\"\n  }\n}\n\nArchive v1.2.0: 7 files, 8553 bytes\n\nFiles: openclaw.plugin.json (586b), package.json (911b), README.md (2602b), skill-card.md (2069b), SKILL.md (1044b), src/index.ts (11430b), _meta.json (134b)\n\nFile v1.2.0:SKILL.md\n\n# Context Capsule\n\nCompress agent session history 99.3% before it hits the LLM.\nWorks with Claude, GPT, Ollama, Mistral, LM Studio — any model.\n\n> **Data handling (v1.1.0):** Every message is scanned by an inline vault gate\n> before reaching the compression library. API keys, tokens, credentials, PII,\n> and card numbers are replaced with typed placeholders. No matched values are\n> logged — only category counts. Compression runs locally; nothing is sent to\n> external services.\n\n## What it does\n\nKeeps last 10 messages verbatim. Compresses the rest into a\n60-token capsule. Agent still answers 30/30 memory questions correctly.\n\n## Savings\n\n| | Without | With |\n|---|---|---|\n| Tokens per call | 7,583 | 53 |\n| Cost (Claude Sonnet) | $0.023 | $0.00016 |\n| Monthly (50 calls/day) | ~$34 | ~$0.24 |\n\n## Install\n\n```\nnpm i @parad0x_labs/context-capsule\n```\n\n## Benchmark\n\n```\nnpm run bench:public\n```\n\nCI fails if savings drop below 95% or recovery below 90%.\n\n## Source\n\ngithub.com/Parad0x-Labs/dna-x402/tree/main/packages/context-capsule\n\nFile v1.2.0:README.md\n\n# context-capsule — OpenClaw ContextEngine plugin\n\nCompresses agent session history before it reaches the LLM using\n[`@parad0x_labs/context-capsule`](https://github.com/Parad0x-Labs/dna-x402/tree/main/packages/context-capsule).\nSessions under 20 messages pass through unchanged. Longer sessions have their\nolder history compressed into a capsule summary (injected as a system message)\nwhile the last 10 messages are kept verbatim — giving the model full coherence\non recent turns without paying for the full transcript.\n\n> **Before you use this skill — read these:**\n>\n> - **All messages are vault-scanned** for secrets and PII on every path (short\n>   sessions, verbatim tail, and compressed history alike). Matched values are\n>   replaced with typed placeholders. However, the vault scan covers common\n>   patterns — it is not a guarantee that all sensitive content is removed.\n>   Do not rely on it as the sole protection for highly sensitive sessions.\n>\n> - **Compression alters history fidelity.** Older messages are summarised, not\n>   preserved verbatim. Detail, nuance, and exact wording can be lost. Do not\n>   use this skill where exact transcript fidelity is required.\n>\n> - **Compressed history is injected as a system message.** This places\n>   summarised content in a privileged prompt position. Be aware that prior\n>   user/assistant content will influence the model from the system role after\n>   compression.\n>\n> - **The `@parad0x_labs/context-capsule` dependency** must be resolvable in\n>   your environment. Verify its source and provenance before deploying in\n>   production.\n\n**Most useful for:** local models (Ollama, LM Studio) and GPT-4 where context\ncost matters. Claude users with a 200k context window and built-in compaction\nenabled may not need this.\n\n## Benchmark\n\n| Metric | Result | CI gate |\n|---|---|---|\n| Token savings | 99.3% | >= 95% |\n| Recovery score | 100% | >= 90% |\n| Runtime | 29ms | < 1000ms |\n\nReproduce locally:\n\n```sh\ncd packages/context-capsule\nnpm run bench:public\n```\n\nCI fails if savings drop below 95% or recovery falls below 90%.\n\n## Activation\n\n```jsonc\n// openclaw.json\n{\n  \"plugins\": {\n    \"slots\": {\n      \"contextEngine\": \"context-capsule\"\n    }\n  }\n}\n```\n\n## Config options\n\n| Key | Default | Description |\n|---|---|---|\n| `minMessages` | `20` | Sessions shorter than this pass through unchanged |\n| `keepRecentMessages` | `10` | Recent messages kept verbatim after compression |\n\n```jsonc\n{\n  \"plugins\": {\n    \"entries\": {\n      \"context-capsule\": {\n        \"minMessages\": 15,\n        \"keepRecentMessages\": 8\n      }\n    }\n  }\n}\n```\n\nFile v1.2.0:_meta.json\n\n{\n  \"ownerId\": \"kn7bp6ev0v1qec2qahhgdvzt3x81q4fv\",\n  \"slug\": \"context-capsule\",\n  \"version\": \"1.2.0\",\n  \"publishedAt\": 1780499229909\n}\n\nFile v1.2.0:skill-card.md\n\n## Description: <br>\nCompresses long OpenClaw agent session history before model calls while scanning messages for common secrets and PII patterns. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[parad0x-labs](https://clawhub.ai/user/parad0x-labs) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers and agent operators use this ContextEngine plugin to reduce token cost for long OpenClaw sessions while keeping recent turns available. It is best suited for sessions where summarized older history is acceptable. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: A reported compression-error fallback may let unredacted sensitive content continue to the model. <br>\nMitigation: Review or patch the fallback to return scanned/redacted messages or fail closed, and test compression failures before using the skill with sensitive content. <br>\nRisk: Compressed history is summarized rather than preserved verbatim, so older details or exact wording can be lost. <br>\nMitigation: Use the skill only where summary-level history is acceptable, and keep exact transcript access outside the compressed model context when fidelity matters. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/parad0x-labs/context-capsule) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, configuration, guidance] <br>\n**Output Format:** [OpenClaw context messages with an optional compressed system-message summary] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Uses configurable message thresholds and may pass shorter sessions through unchanged.] <br>\n\n## Skill Version(s): <br>\n1.2.0 (source: server release metadata and package.json) <br>\n\n## Ethical Considerations: <br>\nUsers 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. <br>\n\nFile v1.2.0:openclaw.plugin.json\n\n{\n  \"id\": \"context-capsule\",\n  \"activation\": {\n    \"onStartup\": false\n  },\n  \"enabledByDefault\": false,\n  \"configSchema\": {\n    \"type\": \"object\",\n    \"additionalProperties\": false,\n    \"properties\": {\n      \"minMessages\": {\n        \"type\": \"integer\",\n        \"minimum\": 1,\n        \"description\": \"Minimum session length (messages) before compression is applied. Default: 20.\"\n      },\n      \"keepRecentMessages\": {\n        \"type\": \"integer\",\n        \"minimum\": 1,\n        \"description\": \"Number of most-recent messages kept verbatim after compression. Default: 10.\"\n      }\n    }\n  }\n}\n\nFile v1.2.0:package.json\n\n{\n  \"name\": \"@parad0x_labs/openclaw-context-capsule\",\n  \"version\": \"1.2.0\",\n  \"description\": \"context-capsule ContextEngine for OpenClaw — 99.3% token reduction with recovery-score gate. Works with Ollama, GPT, Mistral, Claude.\",\n  \"type\": \"module\",\n  \"main\": \"./src/index.ts\",\n  \"files\": [\n    \"src/\",\n    \"openclaw.plugin.json\",\n    \"README.md\"\n  ],\n  \"keywords\": [\n    \"openclaw\",\n    \"openclaw-plugin\",\n    \"context-compression\",\n    \"llm\",\n    \"token-savings\",\n    \"ollama\",\n    \"context-capsule\"\n  ],\n  \"openclaw\": {\n    \"extensions\": [\n      \"./src/index.ts\"\n    ],\n    \"compat\": {\n      \"pluginApi\": \"1.x\"\n    },\n    \"build\": {\n      \"openclawVersion\": \">=1.0.0\"\n    }\n  },\n  \"dependencies\": {\n    \"@parad0x_labs/context-capsule\": \"^0.1.0\"\n  },\n  \"engines\": {\n    \"node\": \">=22\"\n  },\n  \"license\": \"MIT\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/Parad0x-Labs/dna-x402\"\n  }\n}\n\nArchive v1.1.0: 7 files, 7806 bytes\n\nFiles: openclaw.plugin.json (586b), package.json (911b), README.md (1522b), skill-card.md (1829b), SKILL.md (1044b), src/index.ts (10860b), _meta.json (134b)\n\nFile v1.1.0:SKILL.md\n\n# Context Capsule\n\nCompress agent session history 99.3% before it hits the LLM.\nWorks with Claude, GPT, Ollama, Mistral, LM Studio — any model.\n\n> **Data handling (v1.1.0):** Every message is scanned by an inline vault gate\n> before reaching the compression library. API keys, tokens, credentials, PII,\n> and card numbers are replaced with typed placeholders. No matched values are\n> logged — only category counts. Compression runs locally; nothing is sent to\n> external services.\n\n## What it does\n\nKeeps last 10 messages verbatim. Compresses the rest into a\n60-token capsule. Agent still answers 30/30 memory questions correctly.\n\n## Savings\n\n| | Without | With |\n|---|---|---|\n| Tokens per call | 7,583 | 53 |\n| Cost (Claude Sonnet) | $0.023 | $0.00016 |\n| Monthly (50 calls/day) | ~$34 | ~$0.24 |\n\n## Install\n\n```\nnpm i @parad0x_labs/context-capsule\n```\n\n## Benchmark\n\n```\nnpm run bench:public\n```\n\nCI fails if savings drop below 95% or recovery below 90%.\n\n## Source\n\ngithub.com/Parad0x-Labs/dna-x402/tree/main/packages/context-capsule\n\nFile v1.1.0:README.md\n\n# context-capsule — OpenClaw ContextEngine plugin\n\nCompresses agent session history before it reaches the LLM using\n[`@parad0x_labs/context-capsule`](https://github.com/Parad0x-Labs/dna-x402/tree/main/packages/context-capsule).\nSessions under 20 messages pass through unchanged. Longer sessions have their\nolder history compressed into a capsule summary (injected as a system message)\nwhile the last 10 messages are kept verbatim — giving the model full coherence\non recent turns without paying for the full transcript.\n\n**Most useful for:** local models (Ollama, LM Studio) and GPT-4 where context\ncost matters. Claude users with a 200k context window and built-in compaction\nenabled may not need this.\n\n## Benchmark\n\n| Metric | Result | CI gate |\n|---|---|---|\n| Token savings | 99.3% | >= 95% |\n| Recovery score | 100% | >= 90% |\n| Runtime | 29ms | < 1000ms |\n\nReproduce locally:\n\n```sh\ncd packages/context-capsule\nnpm run bench:public\n```\n\nCI fails if savings drop below 95% or recovery falls below 90%.\n\n## Activation\n\n```jsonc\n// openclaw.json\n{\n  \"plugins\": {\n    \"slots\": {\n      \"contextEngine\": \"context-capsule\"\n    }\n  }\n}\n```\n\n## Config options\n\n| Key | Default | Description |\n|---|---|---|\n| `minMessages` | `20` | Sessions shorter than this pass through unchanged |\n| `keepRecentMessages` | `10` | Recent messages kept verbatim after compression |\n\n```jsonc\n{\n  \"plugins\": {\n    \"entries\": {\n      \"context-capsule\": {\n        \"minMessages\": 15,\n        \"keepRecentMessages\": 8\n      }\n    }\n  }\n}\n```\n\nFile v1.1.0:_meta.json\n\n{\n  \"ownerId\": \"kn7bp6ev0v1qec2qahhgdvzt3x81q4fv\",\n  \"slug\": \"context-capsule\",\n  \"version\": \"1.1.0\",\n  \"publishedAt\": 1780497696382\n}\n\nFile v1.1.0:skill-card.md\n\n## Description: <br>\nCompresses OpenClaw agent session history before LLM calls by summarizing older messages into a compact context capsule while preserving recent messages verbatim. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[parad0x-labs](https://clawhub.ai/user/parad0x-labs) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers and OpenClaw users use this skill to reduce context size and token cost for longer agent sessions while keeping recent turns intact for coherence. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Short conversations may bypass the advertised vault-scan redaction path, so the skill should not be treated as a guaranteed secret-scrubbing layer. <br>\nMitigation: Avoid relying on this skill to remove secrets before model calls; confirm documentation and implementation behavior before using it with sensitive credentials or personal data. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/parad0x-labs/context-capsule) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, configuration, guidance] <br>\n**Output Format:** [Agent message stream with a compressed system-message capsule and recent messages preserved verbatim] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Compression behavior is controlled by minMessages and keepRecentMessages configuration values.] <br>\n\n## Skill Version(s): <br>\n1.1.0 (source: server release evidence) <br>\n\n## Ethical Considerations: <br>\nUsers 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. <br>\n\nFile v1.1.0:openclaw.plugin.json\n\n{\n  \"id\": \"context-capsule\",\n  \"activation\": {\n    \"onStartup\": false\n  },\n  \"enabledByDefault\": false,\n  \"configSchema\": {\n    \"type\": \"object\",\n    \"additionalProperties\": false,\n    \"properties\": {\n      \"minMessages\": {\n        \"type\": \"integer\",\n        \"minimum\": 1,\n        \"description\": \"Minimum session length (messages) before compression is applied. Default: 20.\"\n      },\n      \"keepRecentMessages\": {\n        \"type\": \"integer\",\n        \"minimum\": 1,\n        \"description\": \"Number of most-recent messages kept verbatim after compression. Default: 10.\"\n      }\n    }\n  }\n}\n\nFile v1.1.0:package.json\n\n{\n  \"name\": \"@parad0x_labs/openclaw-context-capsule\",\n  \"version\": \"0.1.1\",\n  \"description\": \"context-capsule ContextEngine for OpenClaw — 99.3% token reduction with recovery-score gate. Works with Ollama, GPT, Mistral, Claude.\",\n  \"type\": \"module\",\n  \"main\": \"./src/index.ts\",\n  \"files\": [\n    \"src/\",\n    \"openclaw.plugin.json\",\n    \"README.md\"\n  ],\n  \"keywords\": [\n    \"openclaw\",\n    \"openclaw-plugin\",\n    \"context-compression\",\n    \"llm\",\n    \"token-savings\",\n    \"ollama\",\n    \"context-capsule\"\n  ],\n  \"openclaw\": {\n    \"extensions\": [\n      \"./src/index.ts\"\n    ],\n    \"compat\": {\n      \"pluginApi\": \"1.x\"\n    },\n    \"build\": {\n      \"openclawVersion\": \">=1.0.0\"\n    }\n  },\n  \"dependencies\": {\n    \"@parad0x_labs/context-capsule\": \"^0.1.0\"\n  },\n  \"engines\": {\n    \"node\": \">=22\"\n  },\n  \"license\": \"MIT\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/Parad0x-Labs/dna-x402\"\n  }\n}\n\nArchive v1.0.0: 7 files, 6598 bytes\n\nFiles: openclaw.plugin.json (586b), package.json (911b), README.md (1522b), skill-card.md (2450b), SKILL.md (705b), src/index.ts (7403b), _meta.json (134b)\n\nFile v1.0.0:SKILL.md\n\n# Context Capsule\n\nCompress agent session history 99.3% before it hits the LLM.\nWorks with Claude, GPT, Ollama, Mistral, LM Studio — any model.\n\n## What it does\n\nKeeps last 10 messages verbatim. Compresses the rest into a\n60-token capsule. Agent still answers 30/30 memory questions correctly.\n\n## Savings\n\n| | Without | With |\n|---|---|---|\n| Tokens per call | 7,583 | 53 |\n| Cost (Claude Sonnet) | $0.023 | $0.00016 |\n| Monthly (50 calls/day) | ~$34 | ~$0.24 |\n\n## Install\n\n```\nnpm i @parad0x_labs/context-capsule\n```\n\n## Benchmark\n\n```\nnpm run bench:public\n```\n\nCI fails if savings drop below 95% or recovery below 90%.\n\n## Source\n\ngithub.com/Parad0x-Labs/dna-x402/tree/main/packages/context-capsule\n\nFile v1.0.0:README.md\n\n# context-capsule — OpenClaw ContextEngine plugin\n\nCompresses agent session history before it reaches the LLM using\n[`@parad0x_labs/context-capsule`](https://github.com/Parad0x-Labs/dna-x402/tree/main/packages/context-capsule).\nSessions under 20 messages pass through unchanged. Longer sessions have their\nolder history compressed into a capsule summary (injected as a system message)\nwhile the last 10 messages are kept verbatim — giving the model full coherence\non recent turns without paying for the full transcript.\n\n**Most useful for:** local models (Ollama, LM Studio) and GPT-4 where context\ncost matters. Claude users with a 200k context window and built-in compaction\nenabled may not need this.\n\n## Benchmark\n\n| Metric | Result | CI gate |\n|---|---|---|\n| Token savings | 99.3% | >= 95% |\n| Recovery score | 100% | >= 90% |\n| Runtime | 29ms | < 1000ms |\n\nReproduce locally:\n\n```sh\ncd packages/context-capsule\nnpm run bench:public\n```\n\nCI fails if savings drop below 95% or recovery falls below 90%.\n\n## Activation\n\n```jsonc\n// openclaw.json\n{\n  \"plugins\": {\n    \"slots\": {\n      \"contextEngine\": \"context-capsule\"\n    }\n  }\n}\n```\n\n## Config options\n\n| Key | Default | Description |\n|---|---|---|\n| `minMessages` | `20` | Sessions shorter than this pass through unchanged |\n| `keepRecentMessages` | `10` | Recent messages kept verbatim after compression |\n\n```jsonc\n{\n  \"plugins\": {\n    \"entries\": {\n      \"context-capsule\": {\n        \"minMessages\": 15,\n        \"keepRecentMessages\": 8\n      }\n    }\n  }\n}\n```\n\nFile v1.0.0:_meta.json\n\n{\n  \"ownerId\": \"kn7bp6ev0v1qec2qahhgdvzt3x81q4fv\",\n  \"slug\": \"context-capsule\",\n  \"version\": \"1.0.0\",\n  \"publishedAt\": 1780428158079\n}\n\nFile v1.0.0:skill-card.md\n\n## Description: <br>\nCompresses agent session history by over 99% before sending it to an LLM while retaining the last 10 messages verbatim and summarizing earlier history into a short capsule. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[parad0x-labs](https://clawhub.ai/user/parad0x-labs) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers using OpenClaw can install this ContextEngine plugin to reduce long-session context size before model calls while preserving recent conversation turns. It is most relevant when token cost or local model context limits are operational concerns. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Conversation history may contain credentials, private customer data, or confidential work, and the security evidence says this plugin processes that history through an external compression dependency whose provenance and behavior are not sufficiently disclosed. <br>\nMitigation: Install only after verifying the publisher and the @parad0x_labs/context-capsule dependency; avoid sensitive sessions unless local-only data handling and dependency provenance are confirmed. <br>\nRisk: Compressed history may omit details from older conversation turns that an agent later needs. <br>\nMitigation: Use the configurable thresholds to keep enough recent context verbatim, and review outputs in workflows where older context affects correctness. <br>\n\n\n## Reference(s): <br>\n- [ClawHub listing](https://clawhub.ai/parad0x-labs/context-capsule) <br>\n- [Artifact README](artifact/README.md) <br>\n- [Artifact skill description](artifact/SKILL.md) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, configuration] <br>\n**Output Format:** [Compressed context text inserted as a system message, with OpenClaw configuration options.] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Sessions below the configured message threshold pass through unchanged; longer sessions keep a configurable recent-message tail verbatim.] <br>\n\n## Skill Version(s): <br>\n1.0.0 (source: server release metadata) <br>\n\n## Ethical Considerations: <br>\nUsers 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. <br>\n\nFile v1.0.0:openclaw.plugin.json\n\n{\n  \"id\": \"context-capsule\",\n  \"activation\": {\n    \"onStartup\": false\n  },\n  \"enabledByDefault\": false,\n  \"configSchema\": {\n    \"type\": \"object\",\n    \"additionalProperties\": false,\n    \"properties\": {\n      \"minMessages\": {\n        \"type\": \"integer\",\n        \"minimum\": 1,\n        \"description\": \"Minimum session length (messages) before compression is applied. Default: 20.\"\n      },\n      \"keepRecentMessages\": {\n        \"type\": \"integer\",\n        \"minimum\": 1,\n        \"description\": \"Number of most-recent messages kept verbatim after compression. Default: 10.\"\n      }\n    }\n  }\n}\n\nFile v1.0.0:package.json\n\n{\n  \"name\": \"@parad0x_labs/openclaw-context-capsule\",\n  \"version\": \"0.1.1\",\n  \"description\": \"context-capsule ContextEngine for OpenClaw — 99.3% token reduction with recovery-score gate. Works with Ollama, GPT, Mistral, Claude.\",\n  \"type\": \"module\",\n  \"main\": \"./src/index.ts\",\n  \"files\": [\n    \"src/\",\n    \"openclaw.plugin.json\",\n    \"README.md\"\n  ],\n  \"keywords\": [\n    \"openclaw\",\n    \"openclaw-plugin\",\n    \"context-compression\",\n    \"llm\",\n    \"token-savings\",\n    \"ollama\",\n    \"context-capsule\"\n  ],\n  \"openclaw\": {\n    \"extensions\": [\n      \"./src/index.ts\"\n    ],\n    \"compat\": {\n      \"pluginApi\": \"1.x\"\n    },\n    \"build\": {\n      \"openclawVersion\": \">=1.0.0\"\n    }\n  },\n  \"dependencies\": {\n    \"@parad0x_labs/context-capsule\": \"^0.1.0\"\n  },\n  \"engines\": {\n    \"node\": \">=22\"\n  },\n  \"license\": \"MIT\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/Parad0x-Labs/dna-x402\"\n  }\n}","readmeExcerpt":"Skill: Openclaw Context Capsule Owner: parad0x-labs Summary: Compresses older OpenClaw agent session history into a bounded, lane-change-aware context capsule — keeps recent messages verbatim, flags abandoned directions, quarantines injected instructions, and redacts secrets. Local, deterministic, any model. Tags: agent-memory:1.3.1, compression:1.6.0, context:1.6.0, context-compression:1.4.0, latest:1.6.1, llm:1.4.0","codeSnippets":[],"executableExamples":[{"language":"jsonc","snippet":"{\n  \"plugins\": {\n    \"slots\": { \"contextEngine\": \"context-capsule\" }\n  }\n}"},{"language":"jsonc","snippet":"{\n  \"plugins\": {\n    \"entries\": {\n      \"context-capsule\": {\n        \"minMessages\": 20,\n        \"keepRecentMessages\": 10,\n        \"maxCapsuleTokens\": 1400,\n        \"capsuleTokenRatio\": 0.14,\n        \"minCompressTokens\": 900\n      }\n    }\n  }\n}"},{"language":"jsonc","snippet":"// openclaw.json\n{\n  \"plugins\": {\n    \"slots\": {\n      \"contextEngine\": \"context-capsule\"\n    }\n  }\n}"},{"language":"jsonc","snippet":"{\n  \"plugins\": {\n    \"entries\": {\n      \"context-capsule\": {\n        \"minMessages\": 20,\n        \"keepRecentMessages\": 10,\n        \"maxCapsuleTokens\": 1400,\n        \"capsuleTokenRatio\": 0.14,\n        \"minCompressTokens\": 900\n      }\n    }\n  }\n}"},{"language":"sh","snippet":"npm run typecheck\nnpm test\nnpm pack --dry-run"},{"language":"jsonc","snippet":"{\n  \"plugins\": {\n    \"slots\": { \"contextEngine\": \"context-capsule\" }\n  }\n}"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: context-capsule\ndescription: Compresses older OpenClaw agent session history into a bounded, lane-change-aware context capsule — keeps recent messages verbatim, flags abandoned directions, quarantines injected instructions, and redacts secrets. Local, deterministic, any model.\nlicense: MIT\nmetadata:\n  author: Parad0x-Labs\n---\n\n# Context Capsule\n\nCompress older agent session history before it hits the LLM, so long chats stop\nre-sending the full transcript every turn. It keeps the recent tail verbatim and\nturns older history into a bounded extractive capsule with decisions, tasks,\nerrors, paths, links, questions, and durable facts. Works with any model —\nClaude, GPT, Ollama, Mistral, LM Studio.\n\n**What sets it apart:**\n\n- **Lane-change aware.** When the session pivots (\"replace X with Y\", \"forget X,\n  use Y instead\"), the capsule marks the abandoned direction as superseded and\n  keeps the live one — so the model never wanders back into a dropped plan. On a\n  held-out pivot set it cleans 83% of abandoned subjects with **zero** wrongly\n  flagged live choices.\n- **High fidelity per token.** Distinctive signals — file paths, IDs, ports,\n  URLs, commands, errors, decisions — are emitted as dense atoms. As of **v1.7.0**,\n  a lone value (a bare port `5433`, an issue ref `#4821`, a version `v2.13.0`, an\n  ISO date, a hyphenated code like `NEEDLE-ZX-7742`) is emitted as its **own** atom,\n  so it survives compression even when its surrounding sentence loses the budget\n  race — CI-tested in `test/value-survival.test.mjs`. On the maintainer's own real\n  sessions the capsule kept ~79% of key signals at ~5× reduction and ~93% at ~3.4×;\n  `test/fidelity-bench.mjs` measures this against **your own** `~/.openclaw` sessions\n  (run it on your data to reproduce — the figures are from private sessions, not a\n  repo fixture).\n\n> **Self-contained (v1.7.0):** The compression core is bundled directly in this\n> skill (`src/compression.ts`). There is **no external runtime dependency**, and\n> the plugin makes **no network, file-system, or on-chain calls**. Everything\n> runs locally using only Node's built-in `zlib` and `crypto`, and is fully\n> deterministic. Capsules carry a `schema` tag (`context-capsule.v2`).\n\n> **Protections (defense-in-depth, all CI-gated by `npm test`):**\n> - **Secret redaction (every surface).** API keys (OpenAI, Anthropic, AWS,\n>   Google, GitHub classic + fine-grained, GitLab, npm, Slack, Stripe, SendGrid,\n>   Twilio), JWTs, PEM blocks, URL basic-auth, `DATABASE_URL=` DSNs, and\n>   `key=value` credentials are detected by prefix/shape/context — never by raw\n>   entropy, so public IDs (git SHAs, UUIDs, chain addresses) are untouched.\n>   Redaction runs **before compression**, so no secret survives even in the zlib\n>   audit blob, and again on output — the core never emits a secret even if called\n>   directly. Each redaction carries a one-way **SHA-256 fingerprint**\n>   (`[REDACTED_AWS_KEY#a1b2c3d4]`) so the same key is correlatable across turn"},{"path":"README.md","content":"# context-capsule — OpenClaw ContextEngine plugin\n\nSelf-contained OpenClaw context engine that reduces prompt tokens in long agent\nsessions. It keeps the recent tail verbatim and converts older history into a\nbounded, model-readable extractive capsule.\n\nThe capsule preserves high-value older context:\n\n- decisions and constraints\n- open tasks and requested work\n- errors and failed attempts\n- files, commands, and links\n- open questions and durable facts\n\nIt also keeps a zlib-compressed payload and Merkle root for auditability, but the\nLLM is given the extractive capsule, not opaque compressed bytes.\n\n## Safety and limits\n\n- **Lossy by design.** Older messages are not preserved verbatim in the model\n  prompt. Exact wording, nuance, and low-priority details can be lost.\n- **Recent context remains verbatim.** `keepRecentMessages` controls how many\n  latest messages stay untouched.\n- **Best-effort vault scan.** Text content is scanned for common secrets and PII\n  before compression or model injection. This is useful defense-in-depth, not a\n  formal guarantee.\n- **No external runtime dependency.** The plugin uses only Node built-ins\n  (`zlib` and `crypto`) and makes no network, file-system, or on-chain calls.\n\n## Activation\n\n```jsonc\n// openclaw.json\n{\n  \"plugins\": {\n    \"slots\": {\n      \"contextEngine\": \"context-capsule\"\n    }\n  }\n}\n```\n\n## Config options\n\n| Key | Default | Description |\n| --- | ---: | --- |\n| `minMessages` | `20` | Sessions shorter than this pass through unchanged. |\n| `keepRecentMessages` | `10` | Recent messages kept verbatim after compression. |\n| `maxCapsuleTokens` | `1400` | Hard cap for the injected extractive capsule. |\n| `capsuleTokenRatio` | `0.14` | If OpenClaw provides a model token budget, cap the capsule to this fraction of the budget. |\n| `minCompressTokens` | `900` | Estimated transcript-token floor before compression activates. |\n\n```jsonc\n{\n  \"plugins\": {\n    \"entries\": {\n      \"context-capsule\": {\n        \"minMessages\": 20,\n        \"keepRecentMessages\": 10,\n        \"maxCapsuleTokens\": 1400,\n        \"capsuleTokenRatio\": 0.14,\n        \"minCompressTokens\": 900\n      }\n    }\n  }\n}\n```\n\n## Packaging\n\nThe npm/ClawHub package ships compiled `dist/` JavaScript. It does not require\nTypeScript support from the host runtime.\n\n```sh\nnpm run typecheck\nnpm test\nnpm pack --dry-run\n```\n\n## When to use\n\nUse this for long-running local or hosted model sessions where resending the full\nconversation is too expensive or pushes the model toward context overflow.\n\nDo not use it for workflows where old transcript wording must remain exact. For\nthat, keep normal OpenClaw history or use a retrieval system that can quote the\noriginal source."},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn7bp6ev0v1qec2qahhgdvzt3x81q4fv\",\n  \"slug\": \"context-capsule\",\n  \"version\": \"1.6.1\",\n  \"publishedAt\": 1783630058561\n}"},{"path":"CHANGELOG.md","content":"# Changelog\n\n## 1.7.0\n\n- **Value-atom preservation.** A lone distinctive value — a bare port (`5433`), an\n  issue ref (`#4821`), a version (`v2.13.0`), an ISO date, or a hyphenated code\n  (`NEEDLE-ZX-7742`) — is now emitted as its own dense atom, so it survives\n  compression even when its surrounding sentence loses the budget race. Previously\n  such a value only survived when its whole line was selected. New regression:\n  `test/value-survival.test.mjs` (wired into `npm test`).\n- **Docs accuracy.** Corrected the documented config defaults (`maxCapsuleTokens`\n  `700` → `1400`, `capsuleTokenRatio` `0.08` → `0.14`) to match the shipped values.\n  Reframed the fidelity figures to state plainly that they are measured on the\n  maintainer's own private sessions via `test/fidelity-bench.mjs` (reproduce on your\n  own `~/.openclaw` sessions), not a repo fixture. The supersession clean rate (83%\n  floor) and value-survival remain CI-gated by `npm test`.\n\n## 1.6.0\n\n- Self-contained compression core bundled in `src/compression.ts` (no external\n  runtime dependency; no network / file-system / on-chain calls)."},{"path":"skill-card.md","content":"## Description:\n\nOpenclaw Context Capsule compresses older OpenClaw agent session history into a bounded, lane-change-aware context capsule while keeping recent messages verbatim, redacting credential-shaped secrets, and quarantining injected instructions.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[parad0x-labs](https://clawhub.ai/user/parad0x-labs)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and agent operators use this skill to reduce prompt tokens in long OpenClaw sessions while keeping recent turns and important older decisions, tasks, errors, paths, links, and durable facts available to the model.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Older session history is summarized rather than preserved verbatim, so exact wording, nuance, or low-priority details can be lost.\n\nMitigation: Use the skill for long-running sessions where bounded context is acceptable; keep original logs or retrieval sources available when exact transcript fidelity is required.\n\nRisk: Credential-shaped secrets are redacted on a best-effort basis, but semantic personal or confidential details may still appear in retained context.\n\nMitigation: Do not treat the skill as the only privacy control for highly sensitive chats; limit sensitive inputs and apply host-level data handling controls.\n\n## Reference(s):\n\n- [Openclaw Context Capsule ClawHub listing](https://clawhub.ai/parad0x-labs/skills/context-capsule)\n- [README](README.md)\n- [Changelog](CHANGELOG.md)\n\n## Skill Output:\n\n**Output Type(s):** [text, JSON, configuration]\n\n**Output Format:** [Model-readable text capsule with JSON-compatible capsule metadata and OpenClaw configuration examples]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Older history is lossy and bounded by maxCapsuleTokens and capsuleTokenRatio; recent messages are retained verbatim.]\n\n## Skill Version(s):\n\n1.6.1 (source: ClawHub release metadata)\n\n## Ethical Considerations:\n\nUsers 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."}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":null,"editorialQuality":{"score":100,"threshold":65,"status":"thin","wordCount":2092,"uniquenessScore":43,"reasons":["uniqueness-below-45"]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-10T22:05:18.779Z","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-10-10T22:05:18.779Z","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-11T00:32:17.815Z","emptyReason":null},"items":[{"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-10-09T19:11:12.944Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"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":"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/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}