claudemd-uninstall

claudemd-uninstall is a command for Claude Code from sdsrss/claudemd. It costs 99 tokens per session (745 once invoked), scanned B, original, MIT.

A pre-uninstall cleanup command for the claudemd plugin. It removes the plugin's saved state and logs before the plugin itself is uninstalled, while keeping specification files by default.

In plain words
What is it for?
Run it before `/plugin uninstall claudemd@claudemd` to clear saved state and logs, optionally restore older CLAUDE files, or permanently delete specification files with confirmation.
Why use it?
Claude Code does not run cleanup automatically before uninstalling this plugin, so uninstalling it first can leave files behind with no plugin script available to remove them.

Command for Claude Code

Written for Claude Code: ${CLAUDE_PLUGIN_ROOT} variable. Also seen: reads .claude/ paths; mentions Claude Code.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the claudemd plugin — 16 commands, 6 hooks shipped together

Good fit Run it before /plugin uninstall claudemd@claudemd to clear saved state and logs, optionally restore older CLAUDE files, or permanently delete specification files with confirmation.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add sdsrss/claudemd
Claude Code
/plugin install claudemd

Made for: Claude Code.

Or install claudemd, the plugin that ships this one along with the rest of its 16 commands, 6 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for claudemd-uninstall

README.md
[![agentmods](https://agentmods.dev/badge/commands/sdsrss/claudemd/claudemd-uninstall.svg)](https://agentmods.dev/commands/sdsrss/claudemd/claudemd-uninstall)
Your own site
<a href="https://agentmods.dev/commands/sdsrss/claudemd/claudemd-uninstall"><img src="https://agentmods.dev/badge/commands/sdsrss/claudemd/claudemd-uninstall.svg" alt="Measured on agentmods" height="20"></a>
Per session 99 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 745 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00099 $0.00745
Opus 5 $0.00049 $0.00373
Sonnet 5 $0.00020 $0.00149
Haiku 4.5 $0.00010 $0.00075

Measured today against content hash 1c562bd76ff0, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade B, and why

claudemd-uninstall scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

Surface the script's JSON output to the user: `specAction`, plus — when present — `warning` (`already-uninstalled` or `restore-empty`), `settingsWarning`, and a `statusline.action` of `error`. On a restore, `restored` li
commands/claudemd-uninstall.md · 28 lines

What it actually says

Usage:

  • Default (keep spec, keep state + log): node ${CLAUDE_PLUGIN_ROOT}/scripts/uninstall.js

  • Also drop ~/.claude/.claudemd-state/ and the rule-hits log — opt-in, and NOT recoverable (the log is the §13.1 demote-review corpus): CLAUDEMD_PURGE=1 node ${CLAUDE_PLUGIN_ROOT}/scripts/uninstall.js

  • Restore your pre-claudemd ~/.claude/CLAUDE*.md from the most recent backup: CLAUDEMD_SPEC_ACTION=restore node ${CLAUDE_PLUGIN_ROOT}/scripts/uninstall.js This restores; it does not remove. CLAUDE-extended.md, CLAUDE-changelog.md and OPERATOR.md — spec files claudemd added that you never had — are left in place, because removing spec files is CLAUDEMD_SPEC_ACTION=delete and that path is gated behind CLAUDEMD_CONFIRM=1. Claude Code does not auto-load those three, so they are inert; delete them by hand if you want them gone.

  • Full removal (delete spec files; requires hard-AUTH confirm): CLAUDEMD_SPEC_ACTION=delete CLAUDEMD_CONFIRM=1 node ${CLAUDE_PLUGIN_ROOT}/scripts/uninstall.js

After this command finishes, run /plugin uninstall claudemd@claudemd to remove the plugin cache itself.

Two-step rationale: ${CLAUDE_PLUGIN_ROOT} and scripts/uninstall.js only exist while the plugin is still installed. /plugin uninstall deletes them along with the cache, so the cleanup MUST run first. Reversing the order leaves the manifest, ~/.claude/.claudemd-state/, and ~/.claude/logs/claudemd.jsonl orphaned with no in-tree tool to remove them.

Note: hooks remain registered until you also run /plugin uninstall. This command only clears the user-global state; the plugin's hooks/hooks.json is the authoritative registration site, removed when the cache is deleted.

Surface the script's JSON output to the user: specAction, plus — when present — warning (already-uninstalled or restore-empty), settingsWarning, and a statusline.action of error. On a restore, restored lists the files actually copied back; warning: "restore-empty" means that list is empty and the spec files are still in place — report that as a FAILED restore and point at ls -l on the backup dir, because specAction: "restore" is printed either way. The last two mean ~/.claude/settings.json could not be parsed, so anything claudemd owns inside that file (legacy hook entries, the statusLine) was left in place: say so and tell the user to fix the JSON and re-run. specAction: "keep" on its own does NOT mean the uninstall was complete.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. today Changed · +1 lines 1c562bd76ff0
  2. 2d ago Changed · +3 lines · +20 tokens per session 127504977182
  3. 7d ago First seen · 24 lines · 79 tokens per session scan B e2d6d735623a

Subscribe to this mod's changes

claudemd-uninstall is a command published in the GitHub repository sdsrss/claudemd (2 stars, last pushed yesterday), licensed MIT. It adds 99 tokens to every session and 745 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.