ctx-purge
できること
このスキルは、context-mode がプロジェクト用に保存した検索インデックスとセッションデータを消去します。古いインデックスを消したい人や、やり直したい人向けです。
使う場面
- ✓過去の1つのセッションからインデックス済みの内容を削除したいとき。
- ✓プロジェクトの検索インデックスが散らかり、すべて消去したいとき。
- ✓プロジェクトを再インデックスする前に、まっさらな状態から始めたい場合。
スキルのリンク
https://github.com/mksglu/context-mode/blob/main/skills/ctx-purge/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“このプロジェクトの context-mode インデックスを消去して、最初からやり直せるようにしてください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
このスキルは最初に、1つのセッションを消去するか、プロジェクト全体を消去するかを尋ね、削除される内容について警告します。対象の範囲を確認した後にだけ、消去を実行します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)を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.
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.
よくある質問
消去を元に戻せますか?
いいえ。消去するとデータは完全に削除され、復元できません。
プロジェクトの範囲とセッションの範囲の違いは何ですか?
プロジェクトの範囲はすべてを消去しますが、セッションの範囲はそのセッションの行だけを削除し、ほかは残します。
利用統計はリセットされますか?
プロジェクトの消去では統計も消去されますが、セッションの消去ではプロジェクトの統計は残ります。
詳細
作者による元の説明
Purge the context-mode knowledge base. Permanently deletes all indexed content and resets session stats. This is destructive and cannot be undone. Trigger: /context-mode:ctx-purge
repo: mksglu/context-mode
人気
- GitHubのスター
- 33k
- ランキング
- #8514
- ライセンス
- —
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
context-mode
33kエージェントが、データ量の多い作業を context-mode のツールで読み取り、検索、実行できるよう支援します。大きな出力が会話の本体に入らないようにします。
context-mode
33kエージェントが、データ量の多い作業をサンドボックスで実行し、最終的な答えだけを表示できるよう支援します。生のファイルやWebページで会話が埋まらないようにします。
context-mode
33kエージェントが、ログ、JSON、ビルド結果など出力が大きくなりうる場合に、通常のシェルコマンドではなく context-mode のツールを使えるよう支援します。
ctx-doctor
33kcontext-mode の診断を実行し、ランタイム、フック、検索ストレージ、プラグインの設定、バージョンを確認して、合格か不合格かを明確に示します。
似ているスキル
add-model-provider
394k安全なセットアップコマンドで新しいAIモデルプロバイダーをOpenClawに接続し、APIキーを平文で残さず、ライブテストを行うようエージェントを支援します。
acp-router
394kClaude CodeやCursorなどのコーディングアシスタントに、OpenClaw経由でタスクを渡し、その作業がそのツール内で行われるようエージェントを支援します。
browser-automation
394kログイン、タブ、応答しなくなったページからの復旧を含め、Webページを段階的に操作するようエージェントに教えます。