thedotmack/claude-mem · warning
[uninstall] ${label} cleanup failed:
Error message
[uninstall] ${label} cleanup failed: What it means
Uninstall runs a list of IDE integration cleanup steps (Windsurf hooks, OpenCode plugin, OpenClaw plugin, Codex CLI, Antigravity CLI hooks + MCP). Each step is a dynamic import plus an uninstall function; any throw is caught per-label and warned while the remaining steps continue. Roots vary: unreadable or unwritable IDE config files, malformed IDE settings, or the integration module itself missing from a partial install.
Source
Thrown at src/npx-cli/commands/uninstall.ts:388
}},
{ label: 'Codex CLI', fn: async () => {
const { uninstallCodexCli } = await import('../../services/integrations/CodexCliInstaller.js');
return uninstallCodexCli();
}},
{ label: 'Antigravity CLI hooks + MCP', fn: async () => {
const { uninstallAntigravityCliHooks } = await import('../../services/integrations/AntigravityCliHooksInstaller.js');
return uninstallAntigravityCliHooks();
}},
];
for (const { label, fn } of ideCleanups) {
try {
const result = await fn();
if (result === 0) {
p.log.info(`${label}: removed.`);
}
} catch (error: unknown) {
console.warn(`[uninstall] ${label} cleanup failed:`, error instanceof Error ? error.message : String(error));
}
}
p.note(
[
`Your data directory at ${styleText('cyan', '~/.claude-mem')} was preserved.`,
'To remove it manually: rm -rf ~/.claude-mem',
].join('\n'),
'Note',
);
// Capture BEFORE the data dir note becomes stale advice: consent and the
// install ID still live in ~/.claude-mem, which uninstall preserves.
await captureCliEvent('uninstall_completed', {}, { person: true });
p.outro(styleText('green', 'claude-mem has been uninstalled.'));
}
View on GitHub (pinned to e2d1df569a)
Solutions
- Identify the failing integration from the label in the message and close that IDE
- Fix permissions or validity of that IDE's config file; the error text in the message names the exact path or code
- Re-run `npx claude-mem uninstall`; completed steps are idempotent and cheap to re-run
- Remove that integration's claude-mem entries manually if the step keeps failing
Defensive patterns
Strategy: try-catch
Try / catch
for (const { label, fn } of ideCleanups) {
try {
const result = await fn();
if (result === 0) p.log.info(`${label}: removed.`);
} catch (error) {
// per-label isolation: one IDE's failure must not abort the remaining cleanups
console.warn(`[uninstall] ${label} cleanup failed:`, error instanceof Error ? error.message : String(error));
}
} Prevention
- Close every IDE claude-mem integrated with (Windsurf, OpenCode, Codex, Antigravity) before uninstalling
- Run one uninstall at a time; concurrent runs race on the same config files
- Do not delete source files manually before uninstall; the dynamic imports need them present
When it happens
Trigger: `npx claude-mem uninstall` when one IDE's config (for example the Windsurf settings JSON, opencode config, Codex TOML, or Antigravity MCP config) is read-only, locked, or invalid; or when the dynamic import of the *Installer.js module fails because files were already partially deleted.
Common situations: Uninstalling while the target IDE is running and rewriting its config; IDE configs synced with restrictive permissions; running two uninstalls concurrently; manually deleting source files before uninstalling.
Understand the failure class
Background: "Permission denied" / "Failed to write" file errors: why a library can't write its files to disk (EACCES, EPERM, ENOSPC) and how to fix them — this error's family across 43 libraries.
Related errors
- [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
- [uninstall] Could not read ${filePath}:
- [uninstall] Could not rewrite ${filePath}:
AI-assisted analysis of thedotmack/claude-mem@e2d1df569a (2026-08-20).
Data as JSON: /api/errors/99ad66a47269172f.
Report an issue: GitHub.