plans/2026-06-24-codex-restart-handoff.md
You are Codex in the thedotmack/claude-mem repo. Continue from the current
working tree; do not restart analysis from scratch and do not revert user or
previous-agent changes.
The user wants claude-mem working correctly in Codex first, then wants the
recovery-release plan executed to bring users back. Ignore the Gemini-generated
artifacts unless the user explicitly asks for them again.
Immediate user context:
claude-mem works.Current repo/worktree:
/Users/alexnewman/.superset/worktrees/df8069a7-eb08-4626-9d3d-918d1e12eb9f/night-parsnip
Expected relevant working tree changes:
M plugin/hooks/codex-hooks.json
M plugin/scripts/worker-service.cjs
M scripts/build-hooks.js
M src/services/worker-service.ts
M tests/infrastructure/plugin-distribution.test.ts
M tests/infrastructure/worker-json-status.test.ts
?? plans/2026-06-24-release-recovery-plan.md
?? plans/2026-06-24-codex-restart-handoff.md
The untracked release plan is intentional. Preserve it.
Codex compatibility root cause:
plugin/hooks/codex-hooks.json had an unsupported root-level
description key. Codex 0.140+ rejects unknown hook-config root keys, so
hooks looked installed/enabled but did not load correctly.suppressOutput, which
Codex rejects on current hook output contracts.Implemented repo changes:
plugin/hooks/codex-hooks.json
description; root keys are now only ["hooks"].CLAUDE_MEM_CODEX_HOOK=1 to every Codex hook command.scripts/build-hooks.js
CLAUDE_MEM_CODEX_HOOK=1.src/services/worker-service.ts
buildStatusOutput() includes suppressOutput by default for Claude.worker-service start omits suppressOutput when
CLAUDE_MEM_CODEX_HOOK=1.plugin/scripts/worker-service.cjs
tests/infrastructure/plugin-distribution.test.tstests/infrastructure/worker-json-status.test.tsLocal installed plugin copies were also patched so the user's restarted Codex session should work immediately:
/Users/alexnewman/.claude/plugins/marketplaces/thedotmack/plugin
/Users/alexnewman/.codex/plugins/cache/claude-mem-local/claude-mem/13.8.0
Both local copies were verified:
rootKeys=["hooks"]
commandCount=7
missingCodexEnv=0
Installed-cache smoke results:
Codex env:
{"continue":true,"status":"ready"}
Default/Claude env:
{"continue":true,"status":"ready","suppressOutput":true}
codex doctor --summary --ascii after the patch:
Configuration config loaded
16 ok | 1 idle | 2 notes | 1 warn | 0 fail degraded
The remaining doctor warning was unrelated stale thread state:
threads: rollout files are missing from the state DB
These passed after the Codex fix:
bun test tests/infrastructure/plugin-distribution.test.ts tests/infrastructure/worker-json-status.test.ts tests/hook-lifecycle.test.ts
npm run typecheck:root
npm run lint:spawn-env
npm run lint:hook-io
Focused test result:
124 pass
3 skip
0 fail
403 expect() calls
Use this as the release execution source of truth:
plans/2026-06-24-release-recovery-plan.md
That plan cross-references the PostHog report and GitHub issues/PRs. It defines the recovery-release blockers:
The Codex hook compatibility blocker is already implemented locally and should be treated as the first completed release slice, subject to final review/commit.
First confirm the restarted Codex session can load the plugin:
codex doctor --summary --ascii
codex plugin list
Expected:
claude-mem@claude-mem-local is installed and enabled.codex doctor shows config loaded and no plugin/hook config failure.Then verify the local cache still has the patched hook file:
node - <<'NODE'
const fs = require('fs');
const paths = [
'/Users/alexnewman/.claude/plugins/marketplaces/thedotmack/plugin/hooks/codex-hooks.json',
'/Users/alexnewman/.codex/plugins/cache/claude-mem-local/claude-mem/13.8.0/hooks/codex-hooks.json',
];
function commands(hooks) {
return Object.values(hooks).flatMap(groups =>
groups.flatMap(group => (group.hooks || []).map(hook => hook.command || ''))
);
}
for (const p of paths) {
const json = JSON.parse(fs.readFileSync(p, 'utf8'));
const cmds = commands(json.hooks);
console.log(p);
console.log('rootKeys=' + JSON.stringify(Object.keys(json)));
console.log('commandCount=' + cmds.length);
console.log('missingCodexEnv=' + cmds.filter(c => !c.includes('CLAUDE_MEM_CODEX_HOOK=1')).length);
}
NODE
Then smoke the installed worker-service output shape:
node - <<'NODE'
const { spawnSync } = require('child_process');
const runner = '/Users/alexnewman/.codex/plugins/cache/claude-mem-local/claude-mem/13.8.0/scripts/bun-runner.js';
const worker = '/Users/alexnewman/.codex/plugins/cache/claude-mem-local/claude-mem/13.8.0/scripts/worker-service.cjs';
for (const [label, env] of [
['codex', { ...process.env, CLAUDE_MEM_CODEX_HOOK: '1' }],
['default', { ...process.env }],
]) {
const result = spawnSync(process.execPath, [runner, worker, 'start'], { env, encoding: 'utf8' });
console.log(label + ': exit=' + result.status + ' stdout=' + result.stdout.trim() + ' stderr=' + result.stderr.trim());
}
NODE
Expected:
codex: exit=0 stdout={"continue":true,"status":"ready"} stderr=
default: exit=0 stdout={"continue":true,"status":"ready","suppressOutput":true} stderr=
Review the six modified files and the generated bundle diff. Do not throw away
plugin/scripts/worker-service.cjs; it is the distributed artifact for users.
Run:
git diff --stat
git diff -- plugin/hooks/codex-hooks.json scripts/build-hooks.js src/services/worker-service.ts tests/infrastructure/plugin-distribution.test.ts tests/infrastructure/worker-json-status.test.ts
Then rerun:
bun test tests/infrastructure/plugin-distribution.test.ts tests/infrastructure/worker-json-status.test.ts tests/hook-lifecycle.test.ts
npm run typecheck:root
npm run lint:spawn-env
npm run lint:hook-io
If the user wants a commit, commit only the Codex compatibility fix plus the handoff/recovery plan files if they want those included. Do not include unrelated generated churn.
Suggested commit message:
fix(codex): ship strict plugin hooks and Codex-safe worker status
Use the plan file:
plans/2026-06-24-release-recovery-plan.md
Target branch from the plan:
release/recovery-2026-06-24
Before creating or switching branches, inspect current branch and status. Do not drop local changes.
git branch --show-current
git status --short
If continuing in this worktree, keep the release branch scoped to recovery blockers only.
Codex compatibility is plan-19 / Phase 1A and is already implemented locally. Next priorities from the recovery plan:
setup_required, not retry spam.uvx disables vector search, but SQLite capture/search
continues.Bun.randomUUIDv5 in src/services/telemetry/backfill.ts.uvx --from chroma-mcp==<pin> chroma-mcp.Do not spend time on new providers, broad refactors, or feature bundles unless they directly unblock one of the recovery blockers.
The plan was built from:
Attached PostHog report:
/Users/alexnewman/.superset/host/e7c5cb1f-3f94-4b7b-b6b7-37a97d3b4a51/attachments/08a4bcfe-650a-4094-a534-815c15b67701/08a4bcfe-650a-4094-a534-815c15b67701.json
GitHub snapshots:
/tmp/claude_mem_open_issues_full.json
/tmp/claude_mem_open_prs.json
High-impact report categories:
uvx not found.Bun.randomUUIDv5 not a function.-32000 Connection closed.Codex-specific blockers:
PRs to consolidate from the plan:
uvx --from.rg for search.apply_patch for manual file edits.