Codex Memory Curator

Audit, prune, and secure your AI agent's long-term memory to prevent pollution and data leakage.

Install
cmdop skills install agensi-codex-memory-curator

Codex Memory Curator is a skill designed to maintain the long-term memory of AI agents operating in the Codex ecosystem. As agents accumulate durable context over time, their memory stores can degrade: stale rules persist, duplicate entries build up, and credentials or sensitive data may leak across repositories. This skill addresses those problems through a structured audit-and-prune workflow.

The skill works by inventorying every entry stored in ~/.codex/memories and config.toml using Node.js scripts built for non-destructive assessment. Each memory entry is classified into one of several action categories — KEEP, MOVE TO AGENTS.md, DELETE, and others — so that repo-specific rules are relocated into the appropriate project files rather than persisting in global memory, and genuine global preferences are retained where they belong.

Before any destructive operation is performed, the skill creates a timestamped backup and requires explicit confirmation, preventing accidental data loss. A redacted risk scanner runs over memory contents to flag credentials and sensitive data, and results are shown in redacted form so the raw values are not exposed during the audit.

This skill is appropriate when an agent’s context window has grown unwieldy, when memory appears to contain stale or conflicting rules, or when there is concern about sensitive data persisting across project boundaries. It is specific to the Codex ecosystem and its memory architecture; it does not apply to other agent frameworks or memory backends.

Use cases

  • Audit an agent's ~/.codex/memories directory to identify stale or duplicate entries
  • Scan agent memory for accidentally stored credentials or sensitive data before a security review
  • Relocate repo-specific rules from global memory into the correct AGENTS.md project file
  • Create a timestamped backup of agent memory before performing a cleanup operation
  • Shrink an agent's active context window by removing misplaced documentation from memory
  • Classify each memory entry as KEEP, MOVE, or DELETE to systematically prune accumulated state

When to use it

  • The agent is exhibiting conflicting behavior likely caused by stale or contradictory memory entries
  • Context windows are growing too large due to accumulated long-term memory
  • A security audit is needed to confirm no credentials are persisted in agent memory
  • Repo-specific configuration rules need to be migrated out of global memory into project files

When not to use it

  • The agent does not use the Codex memory architecture (~/.codex/memories)
  • Memory is stored in a different backend such as a vector database or external knowledge store
  • No Node.js runtime is available in the environment
  • The target is a non-Codex agent framework with its own memory management tooling