Context Mode Purge
SkillDocs & knowledgeThis skill purges the context-mode knowledge base for a project. It permanently deletes indexed content and resets session stats, either for one session or for the entire project. The agent confirms the scope with you first, warns that project-wide deletion is irreversible, then calls the purge tool and reports exactly what was removed. There is no undo, so deleted content must be re-indexed if it is needed again.
Then ask your AI: use the Context Mode Purge skill
Details
Instructions available. Your AI can read the instructions. Execution depends on the setup they require.
Account requirements not reviewed. Check the skill instructions before use; Ahel provides instructions and does not run this skill.
No other account needed.
Have the context-mode knowledge base set up for the project you want to purge.
What your AI can do with it
- Delete all indexed content in the context-mode knowledge base for a project
- Wipe a single session's rows and FTS5 chunks while keeping sibling sessions
- Reset in-memory and persisted session stats
- Remove the session events database and markdown file for a project
- Report exactly what was deleted after a purge
Getting started
- Have the context-mode knowledge base set up for the project you want to purge.
- Decide with the agent whether to wipe one session or the whole project.
- For a single session, provide the sessionId; for the whole project, confirm project scope.
- Run the purge with confirm set to true and the chosen parameters.
- Read the result to see what was removed and whether other sessions were preserved.
What this skill tells your AI
The instructions your AI receives, as published by mksglu/context-mode in skills/ctx-purge/SKILL.md and read by Ahel’s review.
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.
Important
ctx_purgeis the only way to delete session data. No other mechanism exists.ctx_statsis read-only — shows statistics only./clearand/compactdo NOT affect any context-mode data.- There is no undo. Re-index content if you need it again.
Signals
- GitHub stars
- 26k
- Forks
- 2k
- Last commit
- Oct 2026
Questions
- Can I undo a purge?
- No. There is no undo. Deleted content must be re-indexed if you need it again.
- Does /clear or /compact affect context-mode data?
- No. /clear and /compact do not affect any context-mode data. ctx_purge is the only way to delete session data.
- What is the difference between session scope and project scope?
- Session scope wipes only the matching session's rows and FTS5 chunks, preserving sibling sessions, project stats, and the FTS5 store file. Project scope wipes everything: the knowledge base, all session DB rows, events markdown, and stats.
Advanced
- Item type
- skill
- Key
ctx-purge- Source
- github.com/mksglu/context-mode
github.com/mksglu/context-mode
Related picks
Skill · larksuite
The pick for Markdownmarkdown-formatter
Skill · nvidia
The pick for Markdownhandoff
Skill · mattpocock
More in Docs & knowledgecanvas-design
Skill · anthropics
More in Docs & knowledgedoc-coauthoring
Skill · anthropics
More in Docs & knowledgedefuddle
Skill · kepano
More in Docs & knowledge