| name | codemem |
| description | Use codemem memory tools for durable project memory: search relevant memory, remember explicit user requests, record decisions and milestones, and avoid storing secrets or transient chatter. |
Codemem
Use codemem when durable memory would help the current Codex session or a later one.
Start of Work
- If prior project context is likely relevant, call
memory_learn if you are unfamiliar with codemem, then search with memory_search_index, memory_search, memory_recent, or memory_timeline.
- Prefer narrow project-scoped queries. Do not dump large memory results into the conversation unless the user asks.
Context vs Inventory
The injected hook context is a relevance pack for the current prompt, not a full memory inventory. Do not infer the total memory count from injected context.
When the user asks what you remember, whether memories exist for a project, or asks to list memory, use the codemem MCP tools instead of answering only from injected hook context:
- Use
memory_recent for recent project memories.
- Use
memory_search or memory_search_index for topic/project searches.
- Report the returned memory ids and titles when the user asks for counts or proof.
Remembering
Call memory_remember only for information that should survive this turn:
- The user explicitly says to remember, note, or store something.
- A durable project preference, convention, or operational fact is discovered.
- A non-obvious decision, migration outcome, release result, or verified root cause is established.
- A follow-up is important and would be hard to reconstruct from git history alone.
Do not record every turn. Do not store secrets, credentials, tokens, customer data, private personal details, or noisy transient status. Prefer concise titles, clear bodies, and useful tags.
Corrections
- If a memory is wrong, stale, sensitive, or no longer useful, use
memory_forget only when the user asks or when removal is clearly safer than keeping it.
- If a memory needs more detail, add a better memory instead of repeatedly editing conversation text.