ctx-purge — Claude Code skill: delete context data
A skill to permanently delete project context data in bulk or by session. Wipes the knowledge base, session records, and stats — this action cannot be undone.
npx skills add mksglu/context-mode --skill ctx-purge -a claude-codeWhat ctx-purge does
ctx-purge operates in two modes. Project scope deletes everything: the FTS5 knowledge base, all session data, events, and stats. Session scope wipes only one session; sibling sessions and project stats remain untouched. This is the only way to delete context-mode data — the built-in /clear and /compact commands do not affect it.
The skill asks for confirmation before deletion and reports exactly what was removed. Use it when the knowledge base has accumulated stale or wrong content that pollutes search results, or when switching to a fresh project without legacy data. For debugging, you can purge a single session while keeping your main work intact.
What it helps with
- remove stale or incorrect indexed content polluting search results
- delete one session's data for debugging without losing others
- start fresh with a new project in the same environment
- reset session statistics and event logs
Example prompts for the agent
- /context-mode:ctx-purge with project scope
- delete only the current session by sessionId
- wipe the entire project knowledge base in one call
How to install ctx-purge
1Skills CLI (Vercel)
npx skills add mksglu/context-mode --skill ctx-purge -a claude-code2Manually: put the files in place
~/.claude/skills/ctx-purge/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/ctx-purge/
1Skills CLI (Vercel)
npx skills add mksglu/context-mode --skill ctx-purge -a codex2Manually: put the files in place
.agents/skills/ctx-purge/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add mksglu/context-mode --skill ctx-purge -a cursor2Manually: put the files in place
.cursor/skills/ctx-purge/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install mksglu/context-mode ctx-purge2Manually: put the files in place
.github/skills/ctx-purge/SKILL.md1Skills CLI (Vercel)
npx skills add mksglu/context-mode --skill ctx-purge -a gemini-cli2Platform CLI
gemini skills install https://github.com/mksglu/context-mode --path skills/ctx-purgeManually: put the files in place
.devin/skills/ctx-purge/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add mksglu/context-mode --skill ctx-purge -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
From the same set7
The whole set →Similar
Questions about ctx-purge
How do I install ctx-purge in Claude Code?
Run npx skills add mksglu/context-mode --skill ctx-purge -a claude-code, then find the skill file at ~/.claude/skills/ctx-purge/SKILL.md.
What does ctx-purge delete?
In project scope, it deletes the knowledge base, all session data, events, and stats. In session scope, only the chosen session is removed.
Is deletion reversible?
No. If you need the content back, you must re-index it from scratch.