AI Disruption

AI Disruption

Claude Code vs. Codex Memory Explained

Compare Claude Code and Codex memory systems: Markdown storage, progressive disclosure, auto extraction, and dsh-memory plugin tested on LoCoMo.

Meng Li's avatar
Meng Li
Sep 18, 2026
∙ Paid

“AI Disruption” Publication 10,500 Subscriptions 20% Discount Offer Link.


I’ve been deep in Agent development lately and turned some of my notes into articles to share.

This time I’ll talk about Memory in Claude Code and Codex. The two main questions are: how memory is organized, and how memory is read and written.

Claude Code is based on the leaked source from early this year, plus the 2.1.263 Memory system prompt used in this article. Background extraction and Dream should only be treated as references to an older version. Codex is based on the rust-v0.153.4 source.

Both designs share a very intuitive idea: organize memory in Markdown, with progressive disclosure. That way, each conversation can find past experience without stuffing the entire history back into context, which enables cross-session memory.

At the end of the article, I’ll introduce dsh-memory, a plugin I built for DeepSeek Harness by combining both approaches. It uses Markdown as the memory store, implements simple progressive disclosure, and has been evaluated on LoCoMo.

Codex

Thanks to Codex being open source, I personally find it more useful to study than Claude Code, so I’m putting it first.

System prompt

Two parts of Codex’s system prompt are directly related to Memory:

  • Memory read rules: when to look up memory, where to look first, when old information needs to be verified, and how to cite sources after using memory.

  • memory_summary.md provides user preferences, common lessons, and memory navigation. The source trims injected content to about 2,500 tokens. The full MEMORY.md and historical summaries are not loaded automatically together. (Memory organization and progressive disclosure are covered in more detail later.)

User's avatar

Continue reading this post for free, courtesy of Meng Li.

Or purchase a paid subscription.
© 2026 Meng Li · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture