mksglu/context-mode

ctx-purge

Purge the context-mode knowledge base.

ソースを見る
リポジトリの原文

見出し、例、コード、表、リンク、参照画像を含む原文を表示しています。

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).
  1. 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
  1. 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.
  1. 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.

Important

  • ctx_purge is the only way to delete session data. No other mechanism exists.
  • ctx_stats is read-only — shows statistics only.
  • /clear and /compact do NOT affect any context-mode data.
  • There is no undo. Re-index content if you need it again.
同じリポジトリから

関連する Skills

すべての Skills
mksglu
コミュニティ

context-mode

Use context-mode tools (ctxexecute, ctxexecutefile) instead of Bash/cat when processing large outputs. Triggers: "analyze logs", "summarize output", "process data", "parse JSON", "filter results", "extract errors", "check build output", "analyze dependencies", "process API response", "large file analysis", "page snapshot", "browser snapshot", "DOM structure", "inspect page", "accessibility tree", "Playwright snapshot", "run tests", "test output", "coverage report", "git log", "recent commits", "

導入数
2
GitHub Stars
2.5万
更新日
10月4日
mksglu
コミュニティ

context-mode-ops

Manage context-mode GitHub issues, PRs, releases, and marketing with parallel subagent army. Orchestrates 10-20 dynamic agents per task. Use when triaging issues, reviewing PRs, releasing versions, writing LinkedIn posts, announcing releases, fixing bugs, merging contributions, validating ENV vars, testing adapters, or syncing branches.

導入数
2
GitHub Stars
2.5万
更新日
10月4日
mksglu
コミュニティ

ctx-doctor

Run context-mode diagnostics. Checks runtimes, hooks, FTS5, plugin registration, npm and marketplace versions. Trigger: /context-mode:ctx-doctor

導入数
2
GitHub Stars
2.5万
更新日
10月4日
mksglu
コミュニティ

ctx-insight

Open the context-mode Insight dashboard in your default browser. Insight is the hosted analytics layer for AI-assisted engineering teams — per-engineer productive rate, retry waste, blocker detection, role-narrowed views. Trigger: /context-mode:ctx-insight

導入数
2
GitHub Stars
2.5万
更新日
10月4日