context-capsule

context-capsule is a skill for Claude Code, Codex from Parad0x-Labs/openclaw-skills. It costs 51 tokens per session (1,659 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,659 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.01659
Opus 5.5 $0.00020 $0.00664
Sonnet 5.5 $0.00010 $0.00332
Haiku 4.5 $0.00005 $0.00166

Measured 23d ago against content hash 50f766b9272a, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 23d ago.

The scan reads SKILL.md. This mod also ships 23 executable files (bench/check-drift.mjs, bench/fixture-bench.mjs, demo/compression.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 · 147 lines

How it starts

The opening of the file, as written. The whole thing — 147 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 is steered away from a dropped plan. On the 6-case pivot set in test/supersession-bench.mjs (5 pivots, 1 no-pivot control, 6 abandoned subjects) v1.7.0 strikes or omits 6 of 6 abandoned subjects and flags 0 live choices at budgets 700 and 1,400; npm test fails below 83% or on any wrongly flagged live choice. Pivots stated without an explicit cue are not detected.
  • 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 (test/value-survival.test.mjs). On the public 109-message fixture in bench/fixtures, with default settings the model receives 2,061 estimated tokens per call instead of 7,281, and 21 of 40 fixture questions still have their answer keywords in that text (35 with full history). Key-signal recall of the capsule alone is 65% at a 1,200-token budget and 86% at 2,000 (test/fidelity-bench.mjs, which also runs on your own ~/.openclaw sessions). These are availability checks, not model-answer accuracy, which has not been measured. Details: docs/CONTEXT_CAPSULE_BENCHMARK.md in the repository.

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 checked by npm test, which runs in the repository's skills CI lane and before every publish):

  • 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 · 147 lines

Files

What ships with it

36 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 23d ago Changed · +12 lines 50f766b9272a
  2. 2mo 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 (23 stars, last pushed 17d ago), licensed MIT. It adds 51 tokens to every session and 1,659 once invoked, about $0.0002 per session on Opus 5.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

brain-save

Create and manage governed memories by capturing one fact, decision, pattern, or convention, or by retiring an outdated memory. This is side-effecting and never auto-fires. Use when preserving a durable fact without a full recompile or changing a memory's lifecycle. Trigger with "/brain-save".

jeremylongshore/bobs-big-brain-plugin · 66 tokens

brain

Search and analyze governed notes, decisions, runbooks, and conventions, returning a qmd:// citation for every supported claim. Use when checking what the brain has captured about architecture, infrastructure, decisions, or operating practices. Trigger with "/brain", "ask the brain", or "check my knowledge base".

jeremylongshore/bobs-big-brain-plugin · 66 tokens

notes

Skill "notes" from Pinvou/pinvou-agent, covering ima notes, operations, write rules, examples and response handling.

Pinvou/pinvou-agent · 0 tokens

context-recovery

Recovers project handoff context from local Codex, Claude Code, Gemini, CodeBuddy, and codexmate-derived sessions. Use when the user asks what happened in prior project/PR/branch/file/error work, needs a handoff brief, wants old decisions or validations recovered, or asks to summarize cross-session project activity…

SakuraByteCore/codexmate · 72 tokens

shodh-memory

Persistent memory system for AI agents. Use this skill to remember context across conversations, recall relevant information, and build long-term knowledge. Activate when you need to store decisions, learnings, errors, or context that should persist beyond the current session.

varun29ankuS/shodh-memory · 53 tokens

learn

Manually record an insight, correction, preference, or rule that the agent should remember for future tasks.

CoWork-OS/CoWork-OS · 23 tokens