context-capsule

context-capsule is a skill for Claude Code, Codex from Parad0x-Labs/openclaw-skills. It costs 51 tokens per session (1,444 once invoked), scanned B, original, MIT.

A local tool for shortening old OpenClaw agent conversation history into a compact summary for later turns. It keeps recent messages and important details such as decisions, tasks, errors, file paths, links, and values.

In plain words
What is it for?
Use it to compress lengthy agent sessions, retain important technical details, and protect secrets while preparing older history for another model.
Why use it?
Long conversations can exceed the model’s context limit or waste tokens by repeating the full transcript. This tool preserves useful details and marks abandoned directions so the agent can follow the current one.

Skill for Claude CodeCodex

Which agent this was written for is unclear — built for openclaw. Also seen: built for openclaw.

Good fit Use it to compress lengthy agent sessions, retain important technical details, and protect secrets while preparing older history for another model.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/parad0x-labs/openclaw-skills/context-capsule
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Parad0x-Labs/openclaw-skills --skill context-capsule
Clone the repo
git clone --depth 1 https://github.com/Parad0x-Labs/openclaw-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for context-capsule

README.md
[![agentmods](https://agentmods.dev/badge/skills/parad0x-labs/openclaw-skills/context-capsule/github.svg)](https://agentmods.dev/skills/parad0x-labs/openclaw-skills/context-capsule)
Your own site
<a href="https://agentmods.dev/skills/parad0x-labs/openclaw-skills/context-capsule"><img src="https://agentmods.dev/badge/skills/parad0x-labs/openclaw-skills/context-capsule/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for context-capsule

Your own site · 80×15
<a href="https://agentmods.dev/skills/parad0x-labs/openclaw-skills/context-capsule"><img src="https://agentmods.dev/badge/skills/parad0x-labs/openclaw-skills/context-capsule.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 51 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,444 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 2 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00051 $0.01444
Opus 5 $0.00026 $0.00722
Sonnet 5 $0.00010 $0.00289
Haiku 4.5 $0.00005 $0.00144

Measured 11d ago against content hash 685906e53b45, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade B, and why

context-capsule scanned grade B with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

The scan reads SKILL.md. This mod also ships 21 executable files (demo/compression.js, demo/platform.browser.js, demo/vendor/noble-hashes/_md.js, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Instruction-override phrasingmediumPrompt injection

Text telling the model to disregard its earlier instructions or safety rules is the shape of a prompt injection, whoever wrote it.

> ("ignore previous instructions", "you are now…", "reveal your prompt") are

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

Asks the agent to reveal its instructionslowSystem prompt leakage

Directions to print, repeat or translate the system prompt extract configuration the operator did not intend to expose.

> ("ignore previous instructions", "you are now…", "reveal your prompt") are

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

skills/context-capsule/SKILL.md · 135 lines

How it starts

The opening of the file, as written. The whole thing — 135 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Context Capsule

Compress older agent session history before it hits the LLM, so long chats stop re-sending the full transcript every turn. It keeps the recent tail verbatim and turns older history into a bounded extractive capsule with decisions, tasks, errors, paths, links, questions, and durable facts. Works with any model — Claude, GPT, Ollama, Mistral, LM Studio.

What sets it apart:

  • Lane-change aware. When the session pivots ("replace X with Y", "forget X, use Y instead"), the capsule marks the abandoned direction as superseded and keeps the live one — so the model never wanders back into a dropped plan. On a held-out pivot set it cleans 83% of abandoned subjects with zero wrongly flagged live choices.
  • High fidelity per token. Distinctive signals — file paths, IDs, ports, URLs, commands, errors, decisions — are emitted as dense atoms. As of v1.7.0, a lone value (a bare port 5433, an issue ref #4821, a version v2.13.0, an ISO date, a hyphenated code like NEEDLE-ZX-7742) is emitted as its own atom, so it survives compression even when its surrounding sentence loses the budget race — CI-tested in test/value-survival.test.mjs. On the maintainer's own real sessions the capsule kept ~79% of key signals at ~5× reduction and ~93% at ~3.4×; test/fidelity-bench.mjs measures this against your own ~/.openclaw sessions (run it on your data to reproduce — the figures are from private sessions, not a repo fixture).

Self-contained (v1.7.0): The compression core is bundled directly in this skill (src/compression.ts). There is no external runtime dependency, and the plugin makes no network, file-system, or on-chain calls. Everything runs locally using only Node's built-in zlib and crypto, and is fully deterministic. Capsules carry a schema tag (context-capsule.v2).

Protections (defense-in-depth, all CI-gated by npm test):

  • Secret redaction (every surface). API keys (OpenAI, Anthropic, AWS, Google, GitHub classic + fine-grained, GitLab, npm, Slack, Stripe, SendGrid, Twilio), JWTs, PEM blocks, URL basic-auth, DATABASE_URL= DSNs, and key=value credentials are detected by prefix/shape/context — never by raw entropy, so public IDs (git SHAs, UUIDs, chain addresses) are untouched. Redaction runs before compression, so no secret survives even in the zlib audit blob, and again on output — the core never emits a secret even if called directly. Each redaction carries a one-way SHA-256 fingerprint ([REDACTED_AWS_KEY#a1b2c3d4]) so the same key is correlatable across turns without ever exposing its value. Best-effort pattern matching — strong, not a guarantee for the most sensitive chats.
  • Injection quarantine — instruction-injection patterns in older history ("ignore previous instructions", "you are now…", "reveal your prompt") are wrapped as inert untrusted text, never surfaced as a live instruction.
  • Bounded work — every extraction pass runs on size-capped input, so a megabyte message or an adversarial string finishes in milliseconds instead of hanging the turn.

Read the full file on GitHub · 135 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 135 lines · 51 tokens per session scan B 685906e53b45

Subscribe to this mod's changes

context-capsule is a skill published in the GitHub repository Parad0x-Labs/openclaw-skills (22 stars, last pushed 8d ago), licensed MIT. It adds 51 tokens to every session and 1,444 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it B with 2 findings (instruction-override phrasing, asks the agent to reveal its instructions). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

engraphis-memory

Give the agent durable, scoped, explainable memory across sessions and repositories through the Engraphis MCP tools. Use when you learn a convention, decision, bug cause/fix, or user preference worth keeping; when prior context would help before you answer or act (to avoid re-asking or re-deriving); when asked "why is…

Coding-Dev-Tools/engraphis · 134 tokens

memorywhale

Query and write durable debugging memory recorded by MemoryWhale. Use when debugging a failure that may have happened before, when you need the exact error/flags/output from an earlier attempt, when the user asks "how did we fix this last time?", or once you've figured out why something failed / how a fix worked and…

wuisabel-gif/MemWhale · 79 tokens

card-refresh

Use when refreshing stale Brigade memory cards from the care refresh queue - category allowlist, grounded edits that cite on-disk sources of truth, archive-only retention, and reinforce-in-place instead of near-duplicate siblings (#724). Never delete, remove, or prune.

escoffier-labs/brigade · 56 tokens

help

Show how to use Cortex persistent memory. Use when the user asks about Cortex, memory, storing decisions, or recalling past work.

AdityaVG13/cortex · 28 tokens

recall

Search Cortex memory for past decisions, conventions, and lessons. Use when the user asks about previous work, past decisions, or what they learned about something.

AdityaVG13/cortex · 34 tokens

store

Store a decision or lesson in Cortex persistent memory. Use when the user wants to save a decision, convention, lesson learned, or important knowledge for future sessions.

AdityaVG13/cortex · 34 tokens