memory — OpenAI Codex CLI¶
Recall a small, relevance-gated set of private local facts and review their staleness. Use when durable project context may help but context quality and privacy must stay bounded.
- Source: codex/skills/memory/SKILL.md
- Also available on: Claude Code
In practice¶
What it does¶
On Codex, this card is deliberately recall-only — it documents pulling a small, relevance-gated set of private local facts and checking their staleness, not adding, updating, or removing them, which stays a capability on the Claude harness for now. That's a scope decision, not a missing port.
When to reach for it¶
- Durable project context might help and you want it bounded and private, not dumped wholesale.
- Checking whether stored facts have gone stale before relying on them.
- Seeing the shape of a recall without touching a real store.
- Not for adding, updating, or removing a fact from this harness — the card documents recall and review only.
Worked example¶
python3 bin/memory_recall.py --query "<5-15 salient keywords>" --memory-dir <memory-dir>
python3 bin/memory_store.py review --memory-dir <memory-dir> --now <YYYY-MM-DD>
Inject only the facts recall actually returns — never the whole store or its index,
and never past the relevance gate or the engine's own context budget. --demo shows
the same shape without touching a real store, useful for a first look.
Failure modes & fallbacks¶
- Recall returns nothing. That's the gate working as designed, not a failure — proceed without memory rather than loosening the query.
- A fact's freshness looks doubtful.
reviewis exactly the read-only check for that; it never writes anything on its own. - The plugin root can't be proven. Stop and point at doctor rather than guessing a path.
Cost & safety¶
Recall and review are read-only. There's no automatic write, no background watcher, and no network sync anywhere in this skill; adding, updating, or removing a fact is a separate, user-authorized operation that lives on a different harness's card today. Every store operation here requires an explicit memory directory — deterministic examples pin a fixed date too, so nothing here ever touches a real store by accident.
Related¶
- Deep dive: memory skill — the design behind the relevance gate and budget, and where the fuller add/update/remove surface lives.
- journal — a dated day's record, versus this skill's durable, cross-session facts.
- Parity matrix — where this skill's Claude sibling adds more, and Copilot has none yet.
The skill card — what the model reads¶
This is the SKILL.md body the model reads, transformed for this page: the source's own leading title, if it had one, is removed; every remaining heading is demoted one level to nest under this section; and relative links are rewritten to site or GitHub URLs. ${CLAUDE_PLUGIN_ROOT} and {{POLYTROPOS_ROOT}} are install-time path variables, left intact exactly as the model sees them. The unmodified original is codex/skills/memory/SKILL.md.
Resolve the plugin root before running commands¶
Set POLYTROPOS_ROOT from this file's real location: in plugin mode, this file is
<root>/codex/skills/memory/SKILL.md, so ascend to <root>; in a managed copied install,
use the installer-resolved POLYTROPOS_ROOT="{{POLYTROPOS_ROOT}}". Reject a literal placeholder.
Before shelling out, verify $POLYTROPOS_ROOT/data/pricing.codex.json,
$POLYTROPOS_ROOT/bin/memory_recall.py, and $POLYTROPOS_ROOT/bin/memory_store.py exist. If proof
fails, stop and direct the user to python3 bin/harness_select.py doctor --harness codex; never
run a guessed or stale path.
Memory is pull-only. Derive a short task query of salient keywords, then ask the recall engine for gated, budget-capped winners:
python3 "$POLYTROPOS_ROOT/bin/memory_recall.py" --query "<5-15 salient keywords>" --memory-dir <memory-dir>
python3 "$POLYTROPOS_ROOT/bin/memory_recall.py" --demo
python3 "$POLYTROPOS_ROOT/bin/memory_store.py" review --memory-dir <memory-dir> --now <YYYY-MM-DD>
Inject only the facts returned by recall. Never dump or bulk-read the store/index, bypass the
relevance gate, or expand the engine's context budget. Preserve each winner's source, confidence,
expiry, contradiction, and staleness semantics. Store operations always require an explicit
--memory-dir; deterministic examples and tests also pass --now or use the synthetic demo.
There is no automatic write, background watcher, network sync, or pricing coupling. Adding, updating, verifying, or removing a fact is a separate user-authorized store operation; ordinary recall and review remain read-only.