Have a mind like a steel trap. 长期记忆,断点中继。
Looking for other CLI assistants? Check out the sister extensions: Claude Recall & Gemini Recall
Turn Codex CLI into an installable long-term collaboration skill with durable memory and session continuity.
This installable skill is for people who want Codex CLI to do more than answer one-off questions. It emphasizes long-term memory, growing collaboration chemistry over time, session handoff continuity, and fast recall of prior context. These prompts help Codex:
- keep a stable collaboration style
- initialize local project memory structure
- avoid unnecessary rewrites
- bootstrap user preferences in a lightweight way
The pack is intentionally split into three variants, so you can choose how cautious or proactive Codex should be in your environment.
Raw prompts often overfit to an idealized agent model. In practice, Codex CLI behaves better when instructions are:
- explicit about file operations
- careful about existing content
- realistic about what global config can and cannot control
- lightweight enough to avoid blocking normal work
These prompts are written around that reality.
This prompt transforms Codex CLI from a powerful but amnesic one-shot tool into a long-term collaborator that builds rapport with you.
- Long-term Memory Setup: Automatically establishes persistent global rules (
~/.codex/) and project-specific memory (.assistant/). - Preference Accumulation: Remembers how you like things done—your role, coding style, workflow, and recurring instructions.
- Session Handoff Continuity: Keeps work resumable across interruptions, so the next session can continue from the right breakpoint instead of restarting from scratch.
- Global Memory Promotion: As it discovers your habits and reusable knowledge during active projects, it can automatically promote them to your global profile.
- Project-Specific Customization: Every project can have its own tailored rules and context that override the global defaults.
- Fast Recall: Helps Codex quickly recall your background, working style, recent decisions, and unfinished context when you re-enter a workspace.
- Layered Bootstrap Interview: The unified prompt now uses a compact 3-step interview that captures naming, style, assistant role, ambiguity handling, work types, and memory boundaries without blocking real work.
- Global Quick Mode: When run from
$HOME, Codex updates only~/.codex/AGENTS.mdand does not ask whether globally written information should be synced to global memory. - Historical Project Scan: First-time setup can now scan older
.assistant/workspaces, extract project/session summaries, and register them into the global projects index. - Task-Level Resume Checkpoints: For non-trivial ongoing work, Codex can maintain a module-local
PROGRESS.mdso a new process can quickly resume from the exact milestone or acceptance step instead of inferring progress from scratch.
Codex CLI and OpenClaw are strong in different ways.
Codex CLI is naturally good at instruction layering and execution. Its AGENTS.md model is useful for defining behavior by scope: global defaults, repository rules, and local overrides. That makes it strong at policy and workflow control, but not inherently strong at long-lived structured memory. Codex AGENTS.md guide
OpenClaw takes a different approach. Its memory model treats Markdown files as durable working memory, with daily logs and longer-term memory living in the workspace as explicit artifacts. That makes it much better at preserving collaboration context over time. OpenClaw memory docs
This repository borrows that memory philosophy and adapts it to Codex CLI.
The goal is not to pretend Codex CLI has native persistent memory in the same sense. The goal is to use the file system as an external memory layer, so Codex can behave less like a stateless tool and more like a repeatable long-term collaborator.
- Rules and preferences stop living only in chat history.
- Project decisions can survive across sessions.
- Temporary notes and stable preferences can be separated cleanly.
- Codex can re-enter a workspace with better continuity.
- NEW: Global preferences, style, and memory are now tracked cross-project via
~/.codex/AGENTS.md. - NEW: A Global Projects Index tracks your active workspaces and session history.
- NEW: The unified prompt includes a "Memory Promotion Flow" to seamlessly elevate recurring project habits into global defaults.
The improvement is not about making Codex sound warmer. It is about making collaboration feel continuous.
With only raw prompts, you often have to restate:
- how you want answers structured
- what role you play in the workspace
- which tradeoffs the project already chose
- where the last session stopped
With a memory layout such as .assistant/STYLE.md, .assistant/WORKFLOW.md, .assistant/MEMORY.md, and memory/projects/*.md, those details become editable project assets instead of fragile conversational leftovers.
For active project work, a nearby PROGRESS.md adds one more layer: a very small task-local checkpoint file that says what was already finished, what is currently in progress, and what should happen next.
That makes Codex more likely to:
- respond in your preferred format
- avoid repeating already-settled project debates
- preserve the way you like work to be pushed forward
AGENTS.md is best for stable rules, but real collaboration also includes evolving preferences, recurring habits, project-specific decisions, and temporary context.
The enhanced Unified Prompt splits AGENTS.md into four distinct global zones:
<GLOBAL_USER_PROFILE>: Your identity across all projects.<GLOBAL_STYLE>: Your default communication preferences.<GLOBAL_MEMORY>: Cross-project reusable technical knowledge.<GLOBAL_PROJECTS_INDEX>: A registry of all active projects and recent sessions.
A good external memory layer lets Codex grow with the user by gradually capturing:
- stable style preferences
- recurring workflows
- project constraints and decisions
- unfinished work from recent sessions
This is a better match for long-term use than trying to stuff everything into one unstructured rules file.
-
Style becomes stable across sessions.
Instead of repeating "be concise, give the conclusion first, then risks", those preferences can live inSTYLE.md. -
Project decisions stop resetting.
If a project already decided not to split a service yet, that can live inmemory/projects/architecture.mdinstead of being re-debated from scratch. -
Workflow becomes personalized.
If you prefer "inspect first, explain the edit briefly, then change files, then report verification", that can live inWORKFLOW.md. -
Temporary context stops polluting long-term rules.
Short-lived notes such as "this API doc is still unverified" belong inmemory/daily/YYYY-MM-DD.md, not in permanent memory. -
Cross-Project Synergy (New).
If Codex notices you always prefer ESLint over Prettier in 3 different projects, it will proactively ask: "Should I promote this preference to your global AGENTS.md?" -
Lazy Loading (New).
Codex now intentionally lazy-loads memory. It readsSYSTEM.mdand yourinbox.mdfirst, only fetching deeper archival memory when the context actually demands it, saving tokens and improving speed. -
Task Resumption (New).
If work stops halfway through a feature, article, edit pass, or production task, a module-localPROGRESS.mdcan tell the next Codex process what is done and what the next concrete step is.
Use the generic template by default for content, video, research, operations, design, or mixed project work:
status: in_progress
task: Produce launch video cut
module_path: content/video-launch/
project_type: video-editing
# 任务进度
## 已完成
- [x] 确认视频目标、时长和发布渠道
- [x] 整理可用素材与配音版本
## 进行中
- [ ] 精剪主版本时间线并对齐字幕
## 待做
- [ ] 输出 16:9 主版本
- [ ] 裁切 9:16 短视频版本
- [ ] 完成最终审校并导出交付文件
## 关键决策
- 主版本控制在 90 秒内,优先保留产品演示镜头
- 字幕风格统一使用品牌模板,避免重新设计一套样式
## 已知问题
- 第三段配音底噪偏重,可能需要降噪或重录
## 关键文件 / 素材
- raw/interview-a-roll/
- edits/launch-main.prproj
- assets/subtitles/final-cn.srtKeep the development-specific template for software implementation work:
status: in_progress
task: Add task-level progress recovery
module_path: packages/assistant-memory/
# 开发进度
## 已完成
- [x] 明确 `PROGRESS.md` 使用模块局部文件而不是 `.assistant/`
- [x] 加入恢复口令:继续上次进度 / 恢复进度
- [x] 定义恢复时的候选定位顺序
## 进行中
- [ ] 把恢复逻辑接入当前模块的初始化流程
## 待做
- [ ] 补充恢复话术模板
- [ ] 增加多候选 `PROGRESS.md` 的确认逻辑
- [ ] 完成一次中断恢复流程验证
## 关键决策
- `PROGRESS.md` 放在实际模块目录,避免所有任务共用一份中心状态文件
- 恢复时只读取最相关的 1-2 个候选,减少 token 消耗
## 已知问题
- 当前模块还没有验证“多个候选进度文件”时的选择行为Use the generic template for milestone-based work. Use the development template when the task is driven by explicit acceptance items and code verification. For explicit recovery, the user can say 继续上次进度, 恢复进度, resume progress, or continue from progress.
When recovering, the assistant should locate the most relevant PROGRESS.md in this order: current working directory, most recently modified module, user-named module, then best keyword-matching module. It should read only the top 1-2 candidates instead of scanning every progress file in the repo.
The recommended resume wording is:
我找到了这份进度记录:
- 已完成:...
- 进行中:...
- 下一步:...
要我按这份进度继续吗?
This approach does not replace Codex CLI's core behavior.
It adds a structured external memory layer on top of what Codex already does well:
- Codex provides instruction loading and execution
- the file system provides durable collaboration memory
- this prompt pack connects the two
That is the real point of the project: not just making Codex act smarter, but making it easier to work with over time.
-
SKILL.md
The installable root skill for Codex. -
agents/openai.yaml
UI metadata for Codex skill installation and invocation.
You can install this repository directly as a Codex skill from GitHub.
Example:
python ~/.codex/skills/.system/skill-installer/scripts/install-skill-from-github.py \
--repo d-wwei/codex-recall \
--path .After installation, restart Codex.
- Install the skill.
- Restart Codex.
- In a target workspace, invoke it explicitly, for example:
Use $codex-companion-starter to initialize this workspace for long-term collaboration.
- Let Codex inspect the workspace, update config, and start lightweight bootstrap if appropriate.
- stronger first-round interview for long-term user profiling
- explicit global quick mode with no redundant global-sync question
- fuller historical project and session scanning flow
- better alignment between bootstrap questions, memory promotion, and delivery reporting
- clearer guidance for incremental updates instead of overwriting existing config
- task-level
PROGRESS.mdcheckpoints for interrupted implementation work
SKILL.md
agents/
openai.yaml
This repository now follows the standard Codex skill shape, so the repo itself can be installed instead of requiring a nested skill/ path.
- Default preference layer, not hard control layer
- Incremental edits over destructive rewrites
- Project-local memory over fake global omniscience
- Lightweight bootstrap over long onboarding forms
- Realistic compatibility with Codex CLI behavior
~/.codex/AGENTS.mdshould be treated as a default preference layer, not a permanent hard control mechanism..assistant/is a local project convention for memory and collaboration context, not a built-in Codex CLI protocol.- Actual behavior still depends on runtime instructions, tool permissions, and higher-priority context.
Because AGENTS.md is best at behavior rules, not at storing evolving collaboration context.
If you put everything into one file, it becomes a mix of:
- hard rules
- style preferences
- project history
- temporary notes
That is harder to maintain and easier to stale out. A small memory structure keeps those concerns separated.
It can, if overdesigned.
That is why this prompt pack keeps the structure intentionally small and encourages incremental filling instead of full upfront documentation. The goal is not bureaucracy. The goal is just enough local memory to reduce repeated friction.
It is a good fit for people who use Codex CLI repeatedly in the same projects and want more continuity across sessions.
It is less useful if you only use Codex for quick one-off prompts and do not want any local workflow structure.
No.
This project does not replace Codex CLI's native behavior. It borrows one useful idea from OpenClaw: treating the file system as a durable memory layer. The result is still Codex CLI, just with a more structured collaboration surface.
This project is useful if you want Codex CLI to behave more like:
- a repeatable project assistant
- a workspace-aware collaborator
- a tool that can preserve lightweight context across tasks
It is probably not useful if you only want quick one-off prompts with no local structure.
If Codex behaves too aggressively in your environment, fall back to safe.
If it is too conservative and does not make enough progress, move to strong.