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.
git clone --depth 1 https://github.com/wrg32786/aigent-osnpx agentmods add skills/wrg32786/aigent-os/context-capsuleWrote 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.
[](https://agentmods.dev/skills/wrg32786/aigent-os/context-capsule)<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="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00064 | $0.02343 |
| Opus 5 | $0.00032 | $0.01171 |
| Sonnet 5 | $0.00013 | $0.00469 |
| Haiku 4.5 | $0.00006 | $0.00234 |
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 yesterday.
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.
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
/clearpasses 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)
- 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.
- WRITE
vault/memory/capsules/<YYYY-MM-DD>-<slug>.md:- Frontmatter — all four REQUIRED fields non-empty, no inline
#comments on them,waiting_onquoted (never barenull):id,objective,waiting_on,next_valid_action; plusparent_capsule_id,status: active,trigger,expires,tags,created_at. Stampcreated_atwith 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_triggerandsuccess_criteriaare 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_onis the resume contract: write it so a fresh session can act from it alone — concrete items, owners, gates.
- Frontmatter — all four REQUIRED fields non-empty, no inline
- CONFIRM the write. Re-read the exact file you just wrote: it landed at the path you think it did,
idmatches 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. - CHRONICLE — the close-parity pass. This verb absorbed
/close, so it has to absorb what/closeactually 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.mdline, newest first:- <YYYY-MM-DD> <capsule-id>: <one-line summary>.
- Memory-delta pass — fold this session's real changes into the durable notes that changed (typically 2 to 6 files under
- SYNC fail-soft. After the capsule and any memory edits land, run
node daemons/vault-sync.mjs. It resolves the installed root from.aigent/state.json, stages only capsule/memory changes, and handles no-remote or push-failure outcomes without prompting or gating the lifecycle. Fail-soft is deliberate: a fresh install has no remote, and the lifecycle must never wedge because one is absent. But if it reports a failure and a remote IS configured, that is a real finding — say so plainly rather than moving on, because unsynced memory is memory you will lose. - EXTENSION ACK, only if this install declares one. Run this and act on what it prints:
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.
- yesterday Changed · +11 lines 8b74a4661896
- 5d ago First seen · 93 lines · 64 tokens per session scan A 56d872a87a7a
context-capsule is a skill published in the GitHub repository wrg32786/aigent-os (18 stars, last pushed yesterday), licensed MIT. It adds 64 tokens to every session and 2,343 once invoked, about $0.0003 per session on Opus 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.
Other skills, from other repositories
hive.context-preservation
Proactively extract critical values from tool results into working notes before automatic context pruning destroys them.
hive.note-taking
Maintain a free-form scratchpad of decisions, extracted values, and open questions so context pruning doesn't lose anything you still need.
memory-flush
Promote important recent log entries into MEMORY.md and prune stale ones.
Vizra ADK Memory System
Implement persistent memory, session context, and vector memory (RAG) for AI agents.
continuum-memory
Configure and use Continuum's two-tier memory system — mem0+Qdrant/Milvus for long-term facts, Redis for short-term sessions, with multi-tenant scopes (USER / AGENT / SHARED / RUN / CONVERSATION). Invoke when the user asks about "remember", "user preferences", "long-term memory", "vector search over memories"…
carryover
Use when recalling, saving or curating carryover memory, wikis, playbooks or the Obsidian vault.