ctx-purge

ctx-purge is a skill for Claude Code from opencue/cuecards. It costs 42 tokens per session (630 once invoked), scanned A, original, MIT.

A cleanup tool that permanently removes indexed Context Mode data and resets its session statistics. It can target one session or the whole project.

In plain words
What is it for?
Use it to erase a selected session's data or wipe the entire project's Context Mode knowledge base and related records after confirming the scope.
Why use it?
It provides a way to delete stored processing data when it is no longer needed, but deletion cannot be undone.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter. Also seen: installed under .agents/ (shared by several agents).

Good fit Use it to erase a selected session's data or wipe the entire project's Context Mode knowledge base and related records after confirming the scope.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/opencue/cuecards/ctx-purge
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 opencue/cuecards --skill ctx-purge
Clone the repo
git clone --depth 1 https://github.com/opencue/cuecards

Made for: Claude Code.

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 ctx-purge

README.md
[![agentmods](https://agentmods.dev/badge/skills/opencue/cuecards/ctx-purge/github.svg)](https://agentmods.dev/skills/opencue/cuecards/ctx-purge)
Your own site
<a href="https://agentmods.dev/skills/opencue/cuecards/ctx-purge"><img src="https://agentmods.dev/badge/skills/opencue/cuecards/ctx-purge/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 ctx-purge

Your own site · 80×15
<a href="https://agentmods.dev/skills/opencue/cuecards/ctx-purge"><img src="https://agentmods.dev/badge/skills/opencue/cuecards/ctx-purge.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 42 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 630 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.
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.00042 $0.00630
Opus 5.5 $0.00017 $0.00252
Sonnet 5.5 $0.00008 $0.00126
Haiku 4.5 $0.00004 $0.00063

Measured 3mo ago against content hash 1961df70dcdd, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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 3mo 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.

.agents/skills/ctx-purge/SKILL.md · 50 lines

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>" or scope: "session"): wipes ONLY the matching session's rows + FTS5 chunks. Sibling sessions, project stats, and the FTS5 store file are preserved.

Instructions

  1. 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).
  2. 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
  3. Call the mcp__context-mode__ctx_purge MCP 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.
  4. 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: true is always required.
  • sessionId and scope: "project" together is REJECTED as ambiguous (the sessionId implies session scope; combining with project scope contradicts intent).
  • scope: "session" without sessionId throws — 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.

Read the full file on GitHub · 50 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. 3mo ago First seen · 50 lines · 42 tokens per session scan A 1961df70dcdd

Subscribe to this mod's changes

ctx-purge is a skill published in the GitHub repository opencue/cuecards (10 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.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.

Related

ctx-purge compared with skills from other repositories

ctx-purge next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
ctx-purgeopencue/cuecardsSkill10yesterdayMITA42Claude Code
atomic-wikidamusix/atomic-claudeSkill117yesterdayMITA216Claude Code, Codex
nextllmapi-pro/claude-nextSkill26mo agoMITA66Claude Code, Codex
retiring-and-inheriting-a-seatmvschwarz/openrigSkill9.0ktodayApache-2.0A145Claude Code
session-compaction-and-restoremvschwarz/openrigSkill9.0ktodayApache-2.0B88Claude Code
durable-session-stateZaxbyHub/opencode-swarmSkill549todayMITA70Claude Code
reportcwinvestments/memstackSkill43318d agoMITA67Claude Code