@Saccc_c: https://x.com/Saccc_c/status/2058396860784505295
Summary
This article introduces how to give Codex persistent memory by configuring the AGENTS.md and Memories features, thereby improving communication efficiency and operation security.
View Cached Full Text
Cached at: 05/24/26, 04:15 AM
How to Make Codex Understand You Better: Master These Memory Techniques for a 90% Productivity Boost
After using the Codex App for a while, you’ve likely run into some familiar frustrations: having to repeat basic preferences every time you start a new conversation, or accidentally triggering system commands you didn’t mean to.
The root cause of these common headaches is that your Codex lacks stable long-term memory. To truly eliminate this inefficient back-and-forth, you need to build a complete memory system for it.
This article will show you how to configure AGENTS.md and the Memories feature to give Codex persistent memory — enabling it to truly understand your intent and boost your efficiency.
1. AGENTS.md
1.1 What It Is
AGENTS.md is a rules file you write in advance. Codex reads it automatically every time it starts up.
Without AGENTS.md, Codex starts with a blank slate every time — it doesn’t know your work habits, your project context, or the boundaries of what it should and shouldn’t do.
Once you configure those rules, the context becomes permanent. You’ll never have to repeat the same instructions again.
1.2 How to Configure and Use It
1️⃣ Global level – stored in ~/.codex/AGENTS.md on your local machine. It applies to all your projects, perfect for general personal preferences and universal rules.
In the Codex App, this corresponds to the “Custom Instructions” section in the Personalization settings.
Here’s a basic template you can copy and paste into that location, then adjust as needed:
(insert image placeholder)
2️⃣ Project level – stored in the project directory. Customize rules based on that project’s theme and characteristics.
A good project-level AGENTS.md should typically cover:
- Project background and structure – what the project is, where important directories are
- Execution methods – how to start, run, or operate the project
- Norms and constraints – standards to follow, and clear things not to do
- Completion criteria – how to determine that a task is done
1.3 AGENTS.md Best Practices
Setting up a basic AGENTS.md is just the first step. The following principles determine the ceiling of your memory system:
1️⃣ Layer your rules with clear responsibilities
Codex’s AGENTS.md follows a proximity principle: subdirectory > root > global. In other words, rules in the current working directory take the highest priority.
This means project-level rules can directly override similar global settings. If you lump all rules together, high-priority local rules can easily pollute or break the global logic.
Therefore, a good rule memory system should follow the separation of concerns principle:
- Global layer: only general rules like language preference, safety boundaries, and basic behavior habits
- Project layer: norms specific to that project, such as build commands, code conventions, and module descriptions
Each has its own job without interfering with the other, so no conflicts arise when they merge.
2️⃣ Start simple, iterate as needed
You don’t need to write a complete AGENTS.md all at once. Start with the most essential rules. When Codex repeatedly makes the same mistake, have it review the issue and update the rules, for example:
“You just made the same mistake as last time. Please summarize the reason and add the relevant experience to AGENTS.md.”
This way, rules always come from real friction points, and AGENTS.md evolves naturally with usage.
3️⃣ Keep it concise; split complex content into separate files
As you use Codex more, AGENTS.md can grow quite long. Instead of stuffing everything into one file, split topic-specific content into standalone files and reference them from the main file.
For example, put your project architecture description into a separate ARCHITECTURE.md, and just add a single reference line in AGENTS.md:
“For the core architecture and directory conventions of this project, see the ARCHITECTURE.md file in the current directory.”
2. The Memories Feature
Beyond manually configuring rules, Codex also supports an active memory feature. Enable it in Settings → Personalization → Memories as shown below:
(insert image placeholder)
Once enabled, Codex will automatically summarize useful information and key preferences from your conversations into memory. If you want to see what Codex has remembered, open the Memory.md file located in ~/.codex/memory. Here’s what mine looks like:
(insert image placeholder)
Final Thoughts
Building a memory system is an evolving process. Trust me — if you keep refining your action rules and accumulating memories, Codex will soon become the productivity tool that truly understands you and feels effortless to use.
Similar Articles
@Luckyjudy666: 8 Tips to Make Codex Your Personal Assistant 1. Build a Shared Memory for Codex Core rules go in Agents.md, project background in Obsidian, repeated processes as skills, personal preferences and common questions in Memories. Otherwise, Codex is like a new colleague every time, having to explain everything from scratch...
This article shares 8 tips for using the Codex AI assistant effectively, including building shared memory, remote task execution, scheduled automation, file organization, and teaching new software operations, all aimed at improving work efficiency.
@servasyy_ai: How to make multiple agents truly learn from and help each other? Many agents now have their own memories, but the problem is: these memories are not connected. The pitfalls Codex remembers, Claude doesn't know; the methods Hermes summarizes, OpenClaw can't use. In the end each…
Discusses how to establish shared memory among multiple AI agents to avoid repeating mistakes, and introduces a solution by modifying the MemOS CLI to only record key information and search when necessary.
@Saccc_c: Codex's Memories feature is a setting you must enable; it gives Codex active memory. How to enable: Settings → Personalization → Memory → Enable Memory (Figure 1). After enabling and letting it run for some time, you can open memory.m...
Introduces Codex's Memories feature, which gives Codex active memory, along with instructions on how to enable it and how to view the memorized content.
@wquguru: https://x.com/wquguru/status/2069641926752780384
This article comprehensively reviews the complete architectural layering of AI Agent Memory as of mid-2026, including rule files, persistent profiles, historical recall, and evidence chains. It explains the storage methods, loading timings, and governance principles of different memory layers, emphasizing the key role of memory in helping agents achieve cross-session compounding work.
@Saccc_c: Codex Advanced Memory Techniques: Building Cross-Project Shared Memory with Obsidian Knowledge Base Basic configuration is two steps: 1. Copy the prompt from Figure 1 to Codex, letting it create a memory folder in Obsidian 2. Copy the instructions from Figure 2 and add them to the custom instructions in settings, as part of the global AGENTS.md…
Introduces how to use the Obsidian knowledge base to build cross-project shared memory for Codex, automatically depositing valuable context by copying prompts and global instructions.