{"record":{"id":"99ad66a47269172f","repo":"thedotmack/claude-mem","slug":"uninstall-label-cleanup-failed","errorCode":null,"errorMessage":"[uninstall] ${label} cleanup failed:","messagePattern":"\\[uninstall\\] (.+?) cleanup failed:","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/npx-cli/commands/uninstall.ts","lineNumber":388,"sourceCode":"    }},\n    { label: 'Codex CLI', fn: async () => {\n      const { uninstallCodexCli } = await import('../../services/integrations/CodexCliInstaller.js');\n      return uninstallCodexCli();\n    }},\n    { label: 'Antigravity CLI hooks + MCP', fn: async () => {\n      const { uninstallAntigravityCliHooks } = await import('../../services/integrations/AntigravityCliHooksInstaller.js');\n      return uninstallAntigravityCliHooks();\n    }},\n  ];\n\n  for (const { label, fn } of ideCleanups) {\n    try {\n      const result = await fn();\n      if (result === 0) {\n        p.log.info(`${label}: removed.`);\n      }\n    } catch (error: unknown) {\n      console.warn(`[uninstall] ${label} cleanup failed:`, error instanceof Error ? error.message : String(error));\n    }\n  }\n\n  p.note(\n    [\n      `Your data directory at ${styleText('cyan', '~/.claude-mem')} was preserved.`,\n      'To remove it manually: rm -rf ~/.claude-mem',\n    ].join('\\n'),\n    'Note',\n  );\n\n  // Capture BEFORE the data dir note becomes stale advice: consent and the\n  // install ID still live in ~/.claude-mem, which uninstall preserves.\n  await captureCliEvent('uninstall_completed', {}, { person: true });\n\n  p.outro(styleText('green', 'claude-mem has been uninstalled.'));\n}\n","sourceCodeStart":370,"sourceCodeEnd":406,"githubUrl":"https://github.com/thedotmack/claude-mem/blob/e2d1df569a8f04075d40e92461128ece7cf04c82/src/npx-cli/commands/uninstall.ts#L370-L406","documentation":"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.","triggerScenarios":"`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.","commonSituations":"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.","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"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"for (const { label, fn } of ideCleanups) {\n  try {\n    const result = await fn();\n    if (result === 0) p.log.info(`${label}: removed.`);\n  } catch (error) {\n    // per-label isolation: one IDE's failure must not abort the remaining cleanups\n    console.warn(`[uninstall] ${label} cleanup failed:`, error instanceof Error ? error.message : String(error));\n  }\n}","preventionTips":["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"],"tags":["uninstall","ide-integration","dynamic-import","config-cleanup"],"backgroundTag":"file-write-permission-denied","analyzedSha":"e2d1df569a8f04075d40e92461128ece7cf04c82","analyzedAt":"2026-08-20T23:58:13.836Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}