context-capsule

context-capsule is a skill for Claude Code, Codex from wrg32786/aigent-os. It costs 64 tokens per session (2,424 once invoked), scanned A, original, MIT.

A command for creating a resume-ready context capsule from the session's live memory and repository state.

In plain words
What is it for?
Use it before risky work, when handing work to another session, or when recording a completed thread for later continuation.
Why use it?
It preserves useful working context for a checkpoint, handoff, or completed task instead of relying on the full conversation history.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions subagents.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is node daemons/lifecycle-extension.mjs render capsule_ack --capsule-id <the confirmed capsule id> --root <the installed root>.

Good fit Use it before risky work, when handing work to another session, or when recording a completed thread for later continuation.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/wrg32786/aigent-os
agentmods
npx agentmods add skills/wrg32786/aigent-os/context-capsule

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/wrg32786/aigent-os/context-capsule/github.svg)](https://agentmods.dev/skills/wrg32786/aigent-os/context-capsule)
Your own site
<a href="https://agentmods.dev/skills/wrg32786/aigent-os/context-capsule"><img src="https://agentmods.dev/badge/skills/wrg32786/aigent-os/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/wrg32786/aigent-os/context-capsule"><img src="https://agentmods.dev/badge/skills/wrg32786/aigent-os/context-capsule.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 64 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,424 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Agent Snooping · line 10
    Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.
    Fix: Remove all code or instructions that list or read other skills' files or directories. Skills should operate independently; cross-skill access is a privilege escalation.
How audits are shown
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.00064 $0.02424
Opus 5.5 $0.00026 $0.00970
Sonnet 5.5 $0.00013 $0.00485
Haiku 4.5 $0.00006 $0.00242

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

Security

Grade A, and why

context-capsule scanned grade A with 0 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 4d ago.

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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

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

How it starts

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

/context-capsule — the capsule verb

The entire job: reconcile → write the capsule → confirm it → chronicle → sync the vault → STOP. The capsule absorbs /close: there is no separate close ceremony, and no separate stamping step — writing a valid capsule (content gate passes, required fields non-empty) and folding the session into durable memory is the capsule contract.

When this skill fires vs the automatic verb

A rolling, best-effort version of this write already runs on every Stop event via daemons/stop-capsule-writer.mjs — you don't need this skill for ordinary turn-by-turn capture. Invoke /context-capsule for the explicit cases: a mid-session checkpoint before risky work, a completion capsule when a thread ships, or a handoff.

Operator sovereignty (never violate)

  • The capsule is best-effort autosave, never a gate. An operator /clear passes through whether or not a capsule landed; never tell the operator to wait on capsule machinery.

Fences (never cross)

  • Do NOT write a narration capsule. Reconcile-from-memory is the value: a capsule that restates the transcript instead of the live memory/git state is the trap this verb exists to prevent.

Steps (tight + terminal)

  1. RECONCILE from live memory — re-read the session log, active priorities, and this session's git commits. Record what happened, not what was said. Budget: 2–4 reads, no more.
  2. WRITE vault/memory/capsules/<YYYY-MM-DD>-<slug>.md:
    • Frontmatter — all four REQUIRED fields non-empty, no inline # comments on them, waiting_on quoted (never bare null): id, objective, waiting_on, next_valid_action; plus parent_capsule_id, status: active, trigger, expires, tags, created_at. Stamp created_at with the real current date-time at this write, ISO-8601 with offset (e.g. 2026-07-25T11:12:04-07:00) — the selector parses this field, and a date-only stamp backdates the capsule to midnight UTC where it loses to every same-day autosave. resume_trigger and success_criteria are OPTIONAL — include them when they add real signal, omit otherwise.
    • Body — [REFERENCE ONLY] banner, then: Done (don't redo) · Historical-Errors → Resolutions · Historical-Rejected-Approaches · Files-Read / Files-Modified · Operating-Facts · Pending-Gates · Claimed-Rows. Historical- prefixes and latest-wins stay (anti-zombie).
    • waiting_on is the resume contract: write it so a fresh session can act from it alone — concrete items, owners, gates.
  3. CONFIRM the write. Re-read the exact file you just wrote: it landed at the path you think it did, id matches the filename, and every required field is populated. Self-check the frontmatter against the field list and the content gate (injection echo / ceremony action, daemons/capsule-content-gate.mjs). There is no separate trusted-writer pass to catch a mistake after the fact, so an unread write is an unverified one. Repair before continuing.
  4. CHRONICLE — the close-parity pass. This verb absorbed /close, so it has to absorb what /close actually did, or the durable record stops growing the moment you stop running the old verb:
    • Memory-delta pass — fold this session's real changes into the durable notes that changed (typically 2 to 6 files under vault/memory/). Precise edits, not a transcript dump.
    • Stage directives — anything decision-shaped or instruction-shaped that isn't already banked goes to vault/memory/MEMORY_CANDIDATES.md. A directive that exists only inside a capsule dies with that capsule: the capsule is spent on the next resume, and the directive is not meant to be.
    • One vault/memory/SESSION_LOG.md line, newest first: - <YYYY-MM-DD> <capsule-id>: <one-line summary>.
  5. SYNC fail-soft. After the capsule and memory edits land, run node daemons/vault-sync.mjs. The helper requires the operator to approve every effective push URL in repository-local aigent.vaultSyncPushUrl before staging or publishing memory. A clone's origin is not approval. Never add that approval yourself to bypass a refusal; see docs/vault-sync.md. No remote remains a silent no-op. Unapproved destinations and Git failures are recorded in the memory root's .daemon-errors.log; the CLI remains silent and exits 0, which is not proof of sync. Note the byte position of the resolved memory root's .daemon-errors.log before the call and inspect new tag="vault-sync" records afterward; an old last line is not this call's outcome. Keep any unsynced or unverified status in the durable record before step 7, without blocking the acknowledgement or clear. Local capsules remain on disk whether or not a remote backup succeeds.
  6. EXTENSION ACK, only if this install declares one. Run this and act on what it prints:

Read the full file on GitHub · 104 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. 4d ago Changed 11dc5ce5bd9d
  2. 1mo ago Changed · +11 lines 8b74a4661896
  3. 1mo ago First seen · 93 lines · 64 tokens per session scan A 56d872a87a7a

Subscribe to this mod's changes

context-capsule is a skill published in the GitHub repository wrg32786/aigent-os (24 stars, last pushed 2d ago), licensed MIT. It adds 64 tokens to every session and 2,424 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-01.

Related

Other skills, from other repositories

setup-brain

Set up or upgrade an AI-powered Obsidian vault. Interviews you, builds your vault structure (or works with what you already have), creates your CLAUDE.md memory file, installs tools, and gets you journaling — all in one conversation. Also has a repair/upgrade path for existing users.

mycelium-hq/ai-brain-starter · 66 tokens

second-brain-mapping

Use when the user wants to map or remap their second brain, refresh the vault's queryable metadata index, extract structured frontmatter from typed notes (books, meetings, people, journals, goals), fill wikilink gaps, or surface cross-type insights and patterns no single file shows. Triggers: /second-brain-mapping…

mycelium-hq/ai-brain-starter · 116 tokens

evolve

Use when many related hardened instincts (high-confidence feedback/discovery memories) have piled up in one domain, when the user runs /evolve or asks to promote, cluster, graduate, or consolidate accumulated instincts into a Command, Skill, or Agent, or when files in Instinct Proposals need review. Part of the…

mycelium-hq/ai-brain-starter · 100 tokens

vault-system

Use when maintaining the vault ITSELF as a system, not its content: knowledge-graph build/rebuild/query (graphify), second-brain mapping, vault diagnose/audit/hygiene, drift detection, extract rules from vault, backfill journals, setup vault types, consolidate memory (index over cap), Obsidian tooling…

mycelium-hq/ai-brain-starter · 112 tokens

diagnose

Use when an AI Brain vault needs a health check or something feels off: Claude ignores CLAUDE.md, journal entries missing from /weekly, hooks not firing, something broke after a git pull, a friend's install misbehaves, Obsidian crashes or pegs the CPU, a .claude/worktrees folder appeared, Granola/WhatsApp/Slack/Gmail…

mycelium-hq/ai-brain-starter · 110 tokens

agent-memory-discipline

Rules for when an agent should recall from long-term memory before acting and when it should save decisions, corrections and failures afterwards. Works with any memory backend.

lingxling/awesome-skills-cn · 36 tokens