{"record":{"id":"3fdcddc9a97793a6","repo":"thedotmack/claude-mem","slug":"native-codex-hooks-registered-but-failed-to-dis","errorCode":null,"errorMessage":"  Native Codex hooks registered, but failed to disable legacy transcript AGENTS.md context in ${CODEX_TRANSCRIPT_WATCH_CONFIG_PATH}.","messagePattern":"  Native Codex hooks registered, but failed to disable legacy transcript AGENTS\\.md context in (.+?)\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/services/integrations/CodexCliInstaller.ts","lineNumber":464,"sourceCode":"    console.error(`\\nInstallation failed: ${message}`);\n    return 1;\n  }\n}\n\nfunction performCodexInstall(marketplaceRootOverride?: string): number {\n  assertCodexMarketplaceSupported();\n  const marketplaceRoot = resolvePluginMarketplaceRoot(marketplaceRootOverride);\n\n  console.log(`  Registering Codex plugin marketplace: ${marketplaceRoot}`);\n  registerCodexMarketplace(marketplaceRoot);\n  enableCodexPluginConfig();\n  runCodex(['plugin', 'add', CODEX_PLUGIN_ID]);\n  console.log('  Installed Codex plugin cache.');\n  if (!cleanupLegacyCodexAgentsMdContext()) {\n    console.warn(`  Native Codex hooks registered, but failed to remove legacy AGENTS.md context from ${CODEX_AGENTS_MD_PATH}.`);\n  }\n  if (!cleanupLegacyCodexTranscriptAgentsContext()) {\n    console.warn(`  Native Codex hooks registered, but failed to disable legacy transcript AGENTS.md context in ${CODEX_TRANSCRIPT_WATCH_CONFIG_PATH}.`);\n  }\n\n  console.log(`\nInstallation complete!\n\nCodex marketplace: ${MARKETPLACE_NAME}\nPlugin source:     ${marketplaceRoot}\n\nNext steps:\n  1. Open Codex CLI in your project\n  2. Restart any running Codex sessions so native hooks are loaded\n\nFor a fresh setup, the supported entry point is:\n  npx claude-mem@latest install\n`);\n  return 0;\n}\n","sourceCodeStart":446,"sourceCodeEnd":482,"githubUrl":"https://github.com/thedotmack/claude-mem/blob/e2d1df569a8f04075d40e92461128ece7cf04c82/src/services/integrations/CodexCliInstaller.ts#L446-L482","documentation":"Companion warning to the AGENTS.md cleanup: `cleanupLegacyCodexTranscriptAgentsContext` failed to disable the legacy transcript AGENTS.md context in CODEX_TRANSCRIPT_WATCH_CONFIG_PATH, so a legacy watcher may still inject context even though native hooks are registered and active.","triggerScenarios":"The transcript-watch config file exists and the installer cannot parse or rewrite it to disable the legacy watcher (permissions, unexpected format, concurrent write), so the function returns false.","commonSituations":"Hand-edited or permission-restricted watch config, config format changed by another tool.","solutions":["Open the transcript watch config named in the warning (CODEX_TRANSCRIPT_WATCH_CONFIG_PATH) and disable the AGENTS.md watcher entry manually.","Fix permissions on the file and re-run install.","Verify afterwards that only native hooks inject context."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"import { readFileSync, existsSync } from 'node:fs';\n\nconst watchConfig = `${process.env.HOME}/.codex/config.toml`; // CODEX_TRANSCRIPT_WATCH_CONFIG_PATH\nconst legacyWatcherActive = existsSync(watchConfig) && /transcript|agents/i.test(readFileSync(watchConfig, 'utf8'));","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep Codex config files writable.","Let the installer finish legacy cleanup; avoid editing configs mid-install."],"tags":["codex","legacy-cleanup","config","transcript-watch"],"backgroundTag":"legacy-config-cleanup-failed","analyzedSha":"e2d1df569a8f04075d40e92461128ece7cf04c82","analyzedAt":"2026-08-20T23:58:13.836Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}