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.
npx skills add opencue/cuecards --skill ctx-purgegit clone --depth 1 https://github.com/opencue/cuecardsWrote 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/opencue/cuecards/ctx-purge)<a href="https://agentmods.dev/skills/opencue/cuecards/ctx-purge"><img src="https://agentmods.dev/badge/skills/opencue/cuecards/ctx-purge.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.00042 | $0.00630 |
| Opus 5 | $0.00021 | $0.00315 |
| Sonnet 5 | $0.00008 | $0.00126 |
| Haiku 4.5 | $0.00004 | $0.00063 |
Grade A, and why
ctx-purge 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 7d 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.
How it starts
The opening of the file, as written. The whole thing — 50 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Context Mode Purge
Permanently deletes session data for this project. Two scopes are supported (issue #520):
- Project scope (
scope: "project"): wipes EVERYTHING — knowledge base, all session DB rows for every session, events markdown, and stats. - Session scope (
sessionId: "<id>"orscope: "session"): wipes ONLY the matching session's rows + FTS5 chunks. Sibling sessions, project stats, and the FTS5 store file are preserved.
Instructions
- Decide the scope first with the user:
- "Wipe just one session?" → ask for the
sessionId. - "Wipe the whole project?" → confirm scope:'project' (this is the destructive, irreversible default).
- "Wipe just one session?" → ask for the
- Warn the user about scope:'project'. Everything will be deleted:
- FTS5 knowledge base (all indexed content from
ctx_index,ctx_fetch_and_index,ctx_batch_execute) - Session events DB (analytics, metadata, resume snapshots) for ALL sessions in the project
- Session events markdown file
- In-memory session stats + persisted stats file
- FTS5 knowledge base (all indexed content from
- Call the
mcp__context-mode__ctx_purgeMCP tool with the chosen parameters:- Scoped:
{ confirm: true, sessionId: "<id>" }— implies scope:'session'. - Project:
{ confirm: true, scope: "project" }— explicit destructive form. - Bare
{ confirm: true }still works but emits a deprecation warning. Prefer the explicit forms.
- Scoped:
- Report the result to the user — the response lists exactly what was deleted and (for scoped purges) confirms that other sessions and project stats were preserved.
Schema rules
confirm: trueis always required.sessionIdandscope: "project"together is REJECTED as ambiguous (the sessionId implies session scope; combining with project scope contradicts intent).scope: "session"withoutsessionIdthrows — sessionId is required.
When to Use
- Scoped (per-session): scratch acceptance scenarios, drill replays, isolating a polluted session without losing the main working session's stats.
- Project: KB contains stale or incorrect content polluting search results, switching between unrelated projects in the same session, completely fresh start.
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.
- 7d ago First seen · 50 lines · 42 tokens per session scan A 1961df70dcdd
ctx-purge is a skill published in the GitHub repository opencue/cuecards (5 stars, last pushed yesterday), licensed MIT. It adds 42 tokens to every session and 630 once invoked, about $0.0002 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-08-31.
Other skills, from other repositories
atomic-wiki
Conversational wiki and capture-bucket routing. Fires when the user wants a place, space, or folder for notes, research, tickets, raw dumps, or knowledge capture — checks the block in /.claude/CLAUDE.md; if the cwd is under a registered realm, creates the folder as a bucket via atomic wiki bucket add rather than a…
next
Produce a clean handoff to a fresh Claude Code window. Use when the current conversation is too long (>400K tokens, hallucinations, lost context, or the user wants to close the window). "/next" produces a handoff, "/next list" shows all pending, "/next remove X" deletes one.
durable-session-state
Persist plans, scope decisions, evidence, and reviewer/critic verdicts to durable files during long or multi-phase tasks so work survives context compaction, session resumes, and handoffs. Use for swarm-mode tasks, before context grows large, when recording approval gates, and when resuming after compaction or a…
token-optimization
Use when the user says 'token optimization', 'save tokens', 'context window', 'reduce tokens', 'token stack', or 'TokenStack', or asks about extending context window capacity. Covers TokenStack, the built-in compression proxy that shrinks Claude Code tool output before it reaches the Anthropic API. Do NOT use for…
state
Use when the user says 'update state', 'project state', 'where was I', or at session start to load current context.
memory
Persistent, token-efficient project memory. When ON, maintains a .shob/memory/ folder of structured .md files so the full context of the project is NEVER lost across responses, sessions, or context compaction. Uses progressive disclosure — routes through a lightweight INDEX and loads only the files a task needs…