Cleanup

From mem9-ai/mem9 · View interactive version

Cleanup is an AI agent skill from the GitHub repository mem9-ai/mem9. Remove mem9-managed Codex files before reinstalling, resetting, or uninstalling mem9.

How to use this skill

Skill file

Mem9 Cleanup

Resolve ./scripts/cleanup.mjs relative to this skill directory.

If you need the current CLI surface, flags, or examples, run node ./scripts/cleanup.mjs --help first.

Use command-specific help when needed, for example node ./scripts/cleanup.mjs run --help.

Run this workflow:

  1. Inspect the current cleanup targets first:
set -euo pipefail
node ./scripts/cleanup.mjs inspect
  1. Use the JSON summary to confirm whether cleanup should cover only global Codex files or the current project's local override too.
  2. Remove mem9-managed global Codex files with:
set -euo pipefail
node ./scripts/cleanup.mjs run
  1. When the current repository's local override should be removed too, run:
set -euo pipefail
node ./scripts/cleanup.mjs run --include-project

Common flags:

run removes mem9-managed entries from $CODEX_HOME/hooks.json, $CODEX_HOME/mem9/hooks/, $CODEX_HOME/mem9/install.json, $CODEX_HOME/mem9/config.json, and $CODEX_HOME/mem9/state.json.

run --include-project also removes <project>/.codex/mem9/config.json.

Keep $MEM9_HOME/.credentials.json, $CODEX_HOME/config.toml, and mem9 debug logs untouched.

Do not print API keys or credential file contents.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.