ctx-purge
Skill này làm gì
Skill này xóa chỉ mục tìm kiếm và dữ liệu phiên mà context-mode đã lưu cho một dự án. Skill dành cho người muốn xóa nội dung đã lập chỉ mục cũ hoặc bắt đầu lại từ đầu.
Khi nào nên dùng
- ✓Khi ai đó muốn xóa nội dung đã lập chỉ mục từ một phiên cũ.
- ✓Khi chỉ mục của dự án quá lộn xộn và cần xóa hết.
- ✓Khi ai đó muốn bắt đầu sạch trước khi lập chỉ mục lại dự án.
Liên kết skill
https://github.com/mksglu/context-mode/blob/main/skills/ctx-purge/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Xóa chỉ mục context-mode của dự án này để tôi bắt đầu lại từ đầu.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Skill trước hết hỏi bạn muốn xóa một phiên hay cả dự án, rồi cảnh báo về những gì sẽ bị xóa. Skill chỉ chạy việc xóa sau khi bạn xác nhận phạm vi.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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.
Câu hỏi thường gặp
Tôi có thể hoàn tác việc xóa không?
Không. Việc xóa vĩnh viễn dữ liệu nên không thể khôi phục.
Khác biệt giữa phạm vi dự án và phạm vi phiên là gì?
Phạm vi dự án xóa mọi thứ, còn phạm vi phiên chỉ xóa các dòng của phiên đó và giữ lại phần còn lại.
Nó có đặt lại thống kê sử dụng không?
Xóa cả dự án cũng xóa luôn thống kê, còn xóa theo phiên thì giữ thống kê của dự án.
Chi tiết
Mô tả gốc của tác giả
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
Độ phổ biến
- Sao GitHub
- 33k
- Vị trí xếp hạng
- #8514
- Giấy phép
- —
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
context-mode
33kDạy agent dùng các công cụ context-mode để đọc, tìm kiếm và chạy tác vụ nặng dữ liệu, giữ đầu ra lớn ngoài cuộc trò chuyện chính.
context-mode
33kDạy agent chạy công việc nặng dữ liệu trong hộp cát và chỉ in câu trả lời, để tệp thô và trang web không làm ngập cuộc trò chuyện.
context-mode
33kDạy agent dùng công cụ context-mode thay cho lệnh shell thông thường khi đầu ra có thể lớn, như log, JSON hoặc kết quả build.
ctx-doctor
33kChạy chẩn đoán context-mode để kiểm tra runtime, hook, kho tìm kiếm, plugin và phiên bản, rồi hiển thị báo cáo đạt hoặc không đạt.
Skill tương tự
add-model-provider
394kGiúp agent của bạn kết nối nhà cung cấp mô hình AI mới với OpenClaw bằng lệnh an toàn, giữ API key khỏi văn bản thuần và chạy thử.
acp-router
394kGiúp agent của bạn gửi một tác vụ đến trợ lý lập trình như Claude Code hoặc Cursor qua OpenClaw, để công việc chạy ngay trong công cụ đó.
browser-automation
394kHướng dẫn agent của bạn điều khiển trang web từng bước, gồm đăng nhập, tab và cách khôi phục khi trang ngừng phản hồi.