thedotmack/claude-mem · warning
[uninstall] Could not remove ${pluginDataDir}:
Error message
[uninstall] Could not remove ${pluginDataDir}: What it means
At the end of the stray-path sweep, uninstall runs rmSync(recursive, force) on ~/.claude/plugins/data/claude-mem-thedotmack (plugin data). If the removal throws, it warns and uninstall continues, so the plugin data directory survives. This is separate from ~/.claude-mem (user memory data), which uninstall intentionally preserves.
Source
Thrown at src/npx-cli/commands/uninstall.ts:232
if (!entry.startsWith('mcp-logs-plugin-claude-mem-')) continue;
const logPath = join(projectPath, entry);
try {
rmSync(logPath, { recursive: true, force: true });
removedCount++;
} catch (error: unknown) {
console.warn(`[uninstall] Could not remove ${logPath}:`, error instanceof Error ? error.message : String(error));
}
}
}
}
const pluginDataDir = join(home, '.claude', 'plugins', 'data', 'claude-mem-thedotmack');
if (existsSync(pluginDataDir)) {
try {
rmSync(pluginDataDir, { recursive: true, force: true });
removedCount++;
} catch (error: unknown) {
console.warn(`[uninstall] Could not remove ${pluginDataDir}:`, error instanceof Error ? error.message : String(error));
}
}
return removedCount;
}
export async function runUninstallCommand(): Promise<void> {
p.intro(styleText(['bgRed', 'white'], ' claude-mem uninstall '));
if (!isPluginInstalled()) {
p.log.warn('claude-mem does not appear to be installed.');
if (process.stdin.isTTY) {
const shouldCleanup = await p.confirm({
message: 'Clean up any remaining registration data anyway?',
initialValue: false,
});
View on GitHub (pinned to e2d1df569a)
Solutions
- Close Claude Code so the plugin unloads, then re-run `npx claude-mem uninstall`
- Fix ownership: sudo chown -R $(whoami) ~/.claude/plugins/data
- Remove it manually: rm -rf ~/.claude/plugins/data/claude-mem-thedotmack
Defensive patterns
Strategy: validation
Validate before calling
import { accessSync, constants } from 'node:fs';
const dataDir = `${process.env.HOME}/.claude/plugins/data/claude-mem-thedotmack`;
try { accessSync(dataDir, constants.W_OK); }
catch { /* close Claude Code so the plugin unloads, then re-run uninstall */ } Type guard
function isErrnoException(error: unknown): error is NodeJS.ErrnoException {
return error instanceof Error && typeof (error as NodeJS.ErrnoException).code === 'string';
} Prevention
- Close Claude Code before uninstalling so the plugin data dir is not locked
- Never let the plugin write data under sudo; fix with sudo chown -R $(whoami) ~/.claude/plugins/data
- Distinguish this dir from ~/.claude-mem, which uninstall intentionally preserves
When it happens
Trigger: `npx claude-mem uninstall` when the plugin data directory is locked by a running Claude or plugin process (EBUSY/EPERM on Windows) or contains root-owned files.
Common situations: Uninstalling while Claude Code still has the plugin loaded; plugin data written under sudo; antivirus scanning the directory during removal.
Related errors
- [uninstall] Could not remove ${candidate}:
- [uninstall] Could not remove ${logPath}:
- [uninstall] Could not read selected runtime from settings, d
- [uninstall] Could not read settings for server runtime clean
- [uninstall] Could not write settings during server runtime c
AI-assisted analysis of thedotmack/claude-mem@e2d1df569a (2026-08-20).
Data as JSON: /api/errors/12ec4881d9ccbb0d.
Report an issue: GitHub.