12 KiB
Codex Plugin Version Mismatch Investigation Plan
Date: 2026-05-06
Summary
Codex is still exposing claude-mem from:
/Users/alexnewman/.codex/plugins/cache/thedotmack/claude-mem/12.3.1
That cache entry is the source of the claude-mem:... skills loaded in this Codex session. The working tree and the Codex marketplace clone both advertise 12.7.2, but the enabled Codex plugin points at the old installed cache. This is not a model-memory issue.
The likely root cause is an incomplete migration from marketplace registration to a first-class Codex plugin install. The current installer registers the marketplace, but it does not verify that the actual enabled plugin cache was installed or upgraded to the current .codex-plugin bundle.
Evidence
-
Current repository metadata is
12.7.2:package.json.codex-plugin/plugin.jsonplugin/.codex-plugin/plugin.jsonplugin/package.json
-
Codex marketplace source is current:
/Users/alexnewman/.codex/config.tomlcontains[marketplaces.claude-mem-local]last_updated = "2026-05-06T23:13:59Z"last_revision = "bb3dbfdb5ae92b55b7e4686e4904995184261232"/Users/alexnewman/.codex/.tmp/marketplaces/claude-mem-local/package.jsonis12.7.2/Users/alexnewman/.codex/.tmp/marketplaces/claude-mem-local/.codex-plugin/plugin.jsonis12.7.2
-
Active enabled plugin state is still old:
/Users/alexnewman/.codex/config.tomlcontains[plugins."claude-mem@thedotmack"] enabled = true- The only
claude-memplugin cache under~/.codex/plugins/cache/thedotmack/claude-memis12.3.1 /Users/alexnewman/.codex/plugins/cache/thedotmack/claude-mem/12.3.1/package.jsonis12.3.1/Users/alexnewman/.codex/plugins/cache/thedotmack/claude-mem/12.3.1/.install-versionrecords{"version":"12.3.1", ...}
-
The active cache is not shaped like the new first-class Codex bundle:
- It has
.claude-plugin/plugin.json - It does not have
.codex-plugin/plugin.json - It does not have
hooks/codex-hooks.json - Its
.mcp.jsonstill uses the oldbuncommand with"${CLAUDE_PLUGIN_ROOT}/scripts/mcp-server.cjs"
- It has
-
Current Codex CLI capability is limited:
codex-cli 0.128.0codex plugin marketplaceexposesadd,upgrade, andremove- There is no CLI
plugin listorplugin installsubcommand in this build
-
Current installer code only registers a marketplace:
src/services/integrations/CodexCliInstaller.ts:188prints the marketplace rootsrc/services/integrations/CodexCliInstaller.ts:189runscodex plugin marketplace add <root>src/services/integrations/CodexCliInstaller.ts:200throughsrc/services/integrations/CodexCliInstaller.ts:203tells the user to open/pluginsand install manuallysrc/npx-cli/commands/install.ts:271throughsrc/npx-cli/commands/install.ts:281reports success as "hooks marketplace registered", not "plugin installed"
Working Theory
There are two independent states:
- Marketplace source state: current and registered as
claude-mem-local. - Installed plugin cache state: stale and enabled as
claude-mem@thedotmack.
Codex loads skills, hooks, and MCP metadata from the installed plugin cache, not directly from the marketplace source. Since the installed cache is still 12.3.1, every new Codex session sees claude-mem as 12.3.1, even though the marketplace clone is already at 12.7.2.
The claude-mem@thedotmack plugin ID also suggests this cache came from an older GitHub marketplace install path, while the current installer registers claude-mem-local. That mismatch needs to be handled explicitly during repair and install.
Phase 0: Reproduce And Baseline
What to do:
-
Capture a clean before-state snapshot:
codex --versionsed -n '1,220p' ~/.codex/config.tomlfind ~/.codex/plugins/cache -maxdepth 5 -type f \( -name 'plugin.json' -o -name 'package.json' -o -name '.mcp.json' -o -name 'codex-hooks.json' \) -printfind ~/.codex/plugins/cache/thedotmack/claude-mem -maxdepth 2 -type d -print
-
Confirm which paths Codex injects into the session skill list:
- Start a fresh Codex session.
- Inspect the available skills list for
claude-mem:paths. - Expected current bad path:
~/.codex/plugins/cache/thedotmack/claude-mem/12.3.1/skills.
Verification:
- The before-state snapshot shows the stale cache and current marketplace clone side by side.
- The fresh session still reports
12.3.1before remediation.
Anti-pattern guards:
- Do not delete
~/.codex/plugins/cacheblindly. - Do not edit unrelated
~/.codex/config.tomlproject trust settings. - Do not assume
codex plugin marketplace upgradeupgrades the installed plugin cache until verified.
Phase 1: Local Recovery Procedure
What to do:
-
Back up the current Codex plugin state:
cp ~/.codex/config.toml ~/.codex/config.toml.bak-$(date +%Y%m%d-%H%M%S)- Archive or copy
~/.codex/plugins/cache/thedotmack/claude-mem/12.3.1
-
Remove the stale enabled plugin state through supported UI where possible:
- Open Codex.
- Run
/plugins. - Disable or uninstall
claude-mem@thedotmackif it appears.
-
Register or refresh the current marketplace:
codex plugin marketplace upgrade claude-mem-local- If needed, re-add from the durable local marketplace root produced by the installer.
-
Install
claude-memfrom theclaude-mem (local)marketplace in/plugins. -
Restart Codex.
Verification:
~/.codex/plugins/cachecontains aclaude-memcache with.codex-plugin/plugin.json.- The active plugin cache has
version: 12.7.2. - The active plugin cache has
hooks/codex-hooks.json. - The active plugin cache
.mcp.jsonuses the portablesh -cwrapper from the current repo. - A fresh Codex session lists
claude-mem:skills from the new cache, not12.3.1.
Anti-pattern guards:
- Do not manually copy the repository into
~/.codex/plugins/cacheas the primary fix. Use it only as a diagnostic fallback. - Do not leave both
claude-mem@thedotmackand a new localclaude-memenabled if Codex treats them as distinct plugins. - Do not accept "marketplace upgraded" as proof. The cache path and loaded skill path are the source of truth.
Phase 2: Installer Fix
What to implement:
- Change the Codex installer outcome from "registered marketplace" to "registered marketplace and verified installability".
- Add a post-registration diagnostic that checks whether an enabled stale
claude-memplugin is already present. - If a stale cache is detected, print a direct remediation message that names the exact stale cache path and exact
/pluginsaction required. - If Codex exposes an install/enable CLI in a future version, use it. In
0.128.0, keep the/pluginsstep but verify and report the gap.
Code references:
src/services/integrations/CodexCliInstaller.ts:10forMARKETPLACE_NAME.src/services/integrations/CodexCliInstaller.ts:12throughsrc/services/integrations/CodexCliInstaller.ts:16for required marketplace files.src/services/integrations/CodexCliInstaller.ts:175throughsrc/services/integrations/CodexCliInstaller.ts:214for install flow.src/npx-cli/commands/install.ts:269throughsrc/npx-cli/commands/install.ts:282for task status text.tests/install-non-tty.test.tsfor existing installer behavior assertions.
Suggested implementation details:
-
Add a
diagnoseCodexPluginState()helper that reads:~/.codex/config.toml~/.codex/plugins/cache/**/claude-mem/**/.codex-plugin/plugin.json~/.codex/plugins/cache/**/claude-mem/**/.claude-plugin/plugin.json~/.codex/plugins/cache/**/claude-mem/**/.install-version
-
Classify state as:
not_installedinstalled_current_codexinstalled_stale_codexinstalled_legacy_claude_shapeduplicate_installs
-
Include current repo/package version in the expected state.
-
Treat
installed_legacy_claude_shapeas a warning or failure for Codex integration, because it is the exact observed bad state.
Verification:
- Unit tests cover stale
12.3.1legacy cache with.claude-pluginonly. - Unit tests cover current
12.7.2first-class cache with.codex-plugin. - Unit tests cover duplicate stale plus current installs.
- Installer output no longer says only "hooks marketplace registered" when the installed plugin cache is stale.
Anti-pattern guards:
- Do not parse TOML with regex if a TOML parser is already available in the dependency set.
- Do not bake in
12.7.2; read expected version from package metadata. - Do not rely on
~/.codex/.tmp/marketplaces/...as proof of plugin installation.
Phase 3: Repair Command Fix
What to implement:
- Extend
npx claude-mem repair --ide codex-clior equivalent repair flow to handle Codex first-class plugin state. - The repair should:
- Register or upgrade the local marketplace.
- Detect stale enabled
claude-mem@thedotmack. - Tell the user whether manual
/pluginsinstallation is still required. - Verify the active cache after restart or after the user completes
/plugins.
Code references:
src/npx-cli/commands/install.tsfor marketplace copy and IDE task orchestration.src/services/integrations/CodexCliInstaller.tsfor Codex-specific registration.src/npx-cli/commands/uninstall.tsfor uninstall symmetry.
Verification:
- Repair from a synthetic
12.3.1legacy cache reports the correct stale-cache diagnosis. - Repair from a current cache is idempotent.
- Repair does not remove unrelated Codex settings or non-claude-mem plugins.
Anti-pattern guards:
- Do not silently delete old caches without a backup or explicit command mode.
- Do not make repair depend on an interactive TUI if the install command supports non-TTY mode.
Phase 4: Documentation Fix
What to update:
-
Document that Codex currently has two steps:
- Marketplace registration via
npx claude-mem install. - Plugin install/enable via
/plugins.
- Marketplace registration via
-
Add troubleshooting for this exact mismatch:
- Symptom: Codex skill list shows
~/.codex/plugins/cache/thedotmack/claude-mem/12.3.1. - Cause: stale installed plugin cache, despite current marketplace source.
- Fix: uninstall old
claude-mem@thedotmack, install fromclaude-mem (local), restart Codex.
- Symptom: Codex skill list shows
Code/doc references:
docs/public/installation.mdxdocs/public/troubleshooting.mdxREADME.md
Verification:
- Docs mention the cache path as a diagnostic check.
- Docs do not imply that
codex plugin marketplace addalone installs the plugin.
Phase 5: End-To-End Verification
Manual verification checklist:
- Fresh install on a clean Codex profile.
- Upgrade from old
12.3.1cache. - Upgrade from current marketplace but stale installed cache.
- Duplicate install case with both
claude-mem@thedotmackand localclaude-mem.
Acceptance criteria:
- Fresh Codex session loads
claude-mem:skills from a current cache path. - Loaded plugin cache contains
.codex-plugin/plugin.json. - Loaded plugin cache contains Codex hooks at the path declared by
.codex-plugin/plugin.json. - MCP server starts through the current
.mcp.jsonwrapper. - Installer and repair output make stale-cache state explicit.
Open Questions
- Does the Codex
/pluginsUI use marketplace name, repository owner, or plugin author to derive the installed plugin cache namespace? - Does
codex plugin marketplace upgrade claude-mem-localintentionally avoid updating already-installed plugin caches? - Is there a hidden or upcoming non-interactive plugin install command that can replace the manual
/pluginsstep? - Should the installer remove or disable
claude-mem@thedotmackwhen installingclaude-mem-local, or should it only warn?