Agent skill

Context Mode Knowledge Purge

by mksglu in mksglu/context-mode

Permanently deletes a project's or a single session's indexed context-mode knowledge base, after confirming the scope and warning what will be lost.

Custom licenceAuto-check passedKnowledge Management

Install Context Mode Knowledge Purge

skills CLI
$ npx skills add mksglu/context-mode --skill ctx-purge -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install mksglu/context-mode ctx-purge --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/mksglu/context-mode.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/ctx-purge .claude/skills/ctx-purge && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
ctx-purge
GitHub stars
26k
Token cost
~671 tokens
SKILL.md length
316 words
Files
1
Skills in repo
11
Repo updated
First seen
Licence
Custom licence

At a glance

Permanently deletes a project's or a single session's indexed context-mode knowledge base, after confirming the scope and warning what will be lost.

  • Works in 4 steps: Decide the scope first with the user → Warn the user about scope:'project'.… → Call the mcpcontext-modectx_purge MCP… → …
  • Wiping one polluted session's indexed data without affecting others
  • SKILL.md covers Instructions, Schema rules, When to Use and Important
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

This skill wipes session data for a context-mode project in one of two scopes: a project-scope purge that deletes the entire knowledge base, every session's database rows, the events markdown file, and all stats, or a session-scope purge that deletes only one named session's rows and search index chunks while leaving sibling sessions and project-wide stats untouched. It always asks the user to decide the scope first, and for a project-scope purge it explicitly warns that everything will be deleted.

The actual deletion runs through one MCP tool call that always requires an explicit confirm flag, with a scoped form that implies session scope from a given session id, and a project form that is the explicit destructive default. Passing a session id together with scope set to project is rejected as a contradiction, and setting scope to session without a session id throws an error rather than silently picking one.

After the call it reports exactly what was deleted, and for a scoped purge confirms that other sessions and project-wide stats were preserved; the skill notes this is the only way to delete this data, that a separate stats command is read-only, and that neither clearing nor compacting the conversation touches any of this stored data.

When your agent uses it

  • Wiping one polluted session's indexed data without affecting others
  • Starting completely fresh on a project whose knowledge base is stale
  • Clearing all context-mode data before switching to an unrelated project

Example prompts

  • “Purge just this session's context-mode data, it's polluted.”
  • “Wipe the entire project's knowledge base, I'm starting over.”
  • “Clear context-mode data before I switch to the other project.”

Requirements

  • The context-mode MCP server's ctx_purge tool

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Decide the scope first with the user
  2. Warn the user about scope:'project'. Everything will be deleted
  3. Call the mcpcontext-modectx_purge MCP tool with the chosen parameters
  4. Report the result to the user — the response lists exactly what was deleted and (for scoped purges) confirms that other sessions and…

What it can do on your machine

Read from SKILL.md and the folder at commit 0dfbe8d. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Context Mode Knowledge Purge loads about 671 tokens when it runs. Until then it costs about 47 tokens; SKILL.md has 316 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~47
When it runs · the whole SKILL.md, loaded when a task matches
~671

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

Its licence (Custom licence) doesn't allow us to republish the file, so here is its outline and opening line. It has 316 words (~671 tokens).

“Permanently deletes session data for this project. Two scopes are supported (issue #520):”

— opening of SKILL.md by mksglu, Custom licence
name
ctx-purge
user-invocable
true

Read the full SKILL.md on GitHub

Files

Just SKILL.md in skills/ctx-purge of mksglu/context-mode.

Open the folder on GitHubat commit 0dfbe8d

Compare with similar skills

Context Mode Knowledge Purge next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Context Mode Knowledge Purge compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Context Mode Knowledge Purge this skillmksglu/context-mode26k—~671Automated safety check: PassCustom licence
Auto Memorytractorjuice/arc-kit2.3k—~1.7kAutomated safety check: PassCustom licence
Gnogmickel/gno1151 repos~1.6kAutomated safety check: PassMIT
Engraphdevwhodevs/engraph171—~792Automated safety check: PassMIT
OutlineVortiago/mcp-outline156—~818Automated safety check: PassMIT
Kb Workflowwillynikes2/knowledge-base-server183—~1.1kAutomated safety check: PassMIT

Similar skills

  • Auto Memory

    tractorjuice/arc-kit

    This skill should be used when the user asks to 'set up memory', 'create memory files', 'create MEMORY.md', 'set up topic files', 'improve memory organization', 'what should I remember', 'how to…

    2.3k GitHub stars~1.7k tokensUpdated 2 days ago
    Knowledge ManagementAuto-check passed
  • Gno

    gmickel/gno

    Search local documents, files, notes, and knowledge bases. An agent skill from gmickel/gno.

    115 GitHub starsUsed in 1 repo~1.6k tokens
    Knowledge ManagementAuto-check passed
  • Engraph

    devwhodevs/engraph

    Index and search document collections using hybrid semantic + graph + full-text search.

    171 GitHub stars~792 tokensUpdated 4 mo ago
    Knowledge ManagementAuto-check passed
  • Outline

    Vortiago/mcp-outline

    Conventions and efficient workflows for Outline knowledge bases via mcp-outline tools.

    156 GitHub stars~818 tokensUpdated 2 mo ago
    Knowledge ManagementAuto-check passed
  • Kb Workflow

    willynikes2/knowledge-base-server

    Use before starting any non-trivial task to search the knowledge base for context, and after completing work to capture findings.

    183 GitHub stars~1.1k tokensUpdated 6 days ago
    Knowledge ManagementAuto-check passed
  • Open Knowledge

    inkeep/open-knowledge

    Authoritative agent-runtime contract for working inside an OpenKnowledge project — a markdown-CRDT knowledge base exposed over MCP.

    4.5k GitHub stars~4.7k tokensUpdated yesterday
    Knowledge ManagementAuto-check passed

More from mksglu/context-mode

All 11 skills in this repo
  • Context Mode Output Sandbox

    mksglu/context-mode

    Routes large command, file, API and browser output through context-mode tools so only the needed result enters the agent's context, instead of dumping it via Bash.

    26k GitHub stars~4.1k tokensUpdated yesterday
    Auto-check passed
  • Routing rules for using context-mode MCP tools in Antigravity CLI: sandboxed code runs, file analysis, indexed search and web fetches that keep large output out of the conversation.

    26k GitHub stars~850 tokensUpdated yesterday
    Auto-check passed
  • Context Mode Ops

    mksglu/context-mode

    Runs maintenance for the context-mode project with parallel subagents: issue triage, PR review, releases, bug fixes, announcements and branch syncing.

    26k GitHub stars~6k tokensUpdated yesterday
    Auto-check passed
  • Context Mode Indexer

    mksglu/context-mode

    Indexes a local file or project directory into context-mode's FTS5 knowledge base so later searches return focused snippets instead of rereading whole files.

    26k GitHub stars~328 tokensUpdated yesterday
    Auto-check passed
  • Context Mode Doctor

    mksglu/context-mode

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

    26k GitHub stars~262 tokensUpdated yesterday
    Auto-check passed
  • Context Mode Search

    mksglu/context-mode

    Search context-mode's persistent FTS5 knowledge base for previously indexed local project content, documentation, or session memory. Trigger…

    26k GitHub stars~250 tokensUpdated yesterday
    Auto-check passed

Questions about Context Mode Knowledge Purge

What does Context Mode Knowledge Purge do?

Permanently deletes a project's or a single session's indexed context-mode knowledge base, after confirming the scope and warning what will be lost. This skill wipes session data for a context-mode project in one of two scopes: a project-scope purge that deletes the entire knowledge base, every session's database rows, the events markdown file, and all stats, or a session-scope purge that deletes only one named session's rows and search index chunks while leaving sibling sessions and project-wide stats untouched. It always asks the user to decide the scope first, and for a project-scope purge it explicitly warns that everything will be deleted.

When should I use Context Mode Knowledge Purge?

Context Mode Knowledge Purge fits situations like: wiping one polluted session's indexed data without affecting others; starting completely fresh on a project whose knowledge base is stale; clearing all context-mode data before switching to an unrelated project.

How do I install Context Mode Knowledge Purge in Claude Code?

Run `npx skills add mksglu/context-mode --skill ctx-purge -a claude-code`. Or copy the skill folder (skills/ctx-purge in mksglu/context-mode) into .claude/skills/ctx-purge in your project. Claude Code loads it when a task matches its description.

How do I install Context Mode Knowledge Purge in Codex?

Run `npx skills add mksglu/context-mode --skill ctx-purge -a codex`. Or copy the skill folder (skills/ctx-purge in mksglu/context-mode) into .agents/skills/ctx-purge in your project. Codex loads it when a task matches its description.

Can I use Context Mode Knowledge Purge in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add mksglu/context-mode --skill ctx-purge -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/ctx-purge, .gemini/skills/ctx-purge, .github/skills/ctx-purge and .opencode/skills/ctx-purge in your project.

What does Context Mode Knowledge Purge need to run?

SKILL.md names no scripts, command-line tools or credentials: Context Mode Knowledge Purge is instructions for the agent only. Our summary lists: The context-mode MCP server's ctx_purge tool.

Does Context Mode Knowledge Purge access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Context Mode Knowledge Purge safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Context Mode Knowledge Purge use?

Context Mode Knowledge Purge has a licence file (the repository's licence) that doesn't match a standard licence. Read it on GitHub before reusing the skill.

How many tokens does Context Mode Knowledge Purge use?

About 671 tokens (SKILL.md is roughly 2.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Context Mode Knowledge Purge?

Skills that share tags, products or a category with Context Mode Knowledge Purge: Auto Memory (tractorjuice/arc-kit, 2.3k stars), Gno (gmickel/gno, 115 stars), Engraph (devwhodevs/engraph, 171 stars) and Outline (Vortiago/mcp-outline, 156 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Context Mode Knowledge Purge?

mksglu (a GitHub user) maintains it in mksglu/context-mode, which has 26,014 GitHub stars. The repository holds 11 skills in this directory. The repository was last updated on October 10, 2026.

Source: mksglu/context-mode on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.