Init.md Gives Codex Agents Persistent .md Memory
Get the Tech newsletter
Daily tech — startups, AI labs, chips, the launches that shape the next decade. Free.
- ReadMe turns local markdown files into a queryable 'codebase' of user context, letting Codex agents look up relevant history about the user before answering questions.
- Installation runs
codex exec --dangerously-bypass-approvals-and-sandbox --ephemeral - < Init.mdor by pasting Init.md into the Codex CLI/App, after which the agent scans directories like~/.codex/sessions/,~/.claude/sessions/,~/Downloads/, and~/Projects/. - The tool builds a hierarchical memory tree at
~/.codex/user_context/organized by year → quarter → month → day (e.g.,2026_agentic_rag_memory_systems/2026-Q2_prompt_programs_context_retrieval/2026-04_bootstrap_and_consolidation/2026-04-13_hierarchical_memory_rewrite.md). - It writes a hint block into
~/.codex/AGENTS.mddirecting the agent to the~/.codex/user_context/directory for additional user-specific context. - A demo query — 'What have I been working on in the past 3 months?' — returns a synthesized summary: the user has been 'converging on agentic infrastructure: memory systems, context retrieval, and public-facing artifacts.'
- Automatic daily refresh is available by installing a host-level scheduler (cron by default) that re-runs Update.md against the repository, with the source warning against wrapper scripts and in-line execution during validation.
Why it matters: Most LLM agents start every session from zero, so they can't remember who you are or what you shipped last week. This tool bakes that recall into plain .md files in your home directory — cheap, git-diffable, human-readable — and ties it to Codex's existing session log so context accumulates across conversations. For developers already living in CLI agents, it's a workaround for the missing 'long-term memory' feature that frontier vendors haven't shipped.
