Add memory functionality similar to Claude code

Resolved 💬 5 comments Opened Sep 2, 2025 by jasonwei1002 Closed Sep 4, 2025
💡 Likely answer: A maintainer (gpeal, contributor) responded on this thread — see the highlighted reply below.

What feature would you like to see?

Hope there is a maintainable global memory file for easy reuse

Are you interested in implementing this feature?

_No response_

Additional information

_No response_

View original on GitHub ↗

5 Comments

michalkos · 12 months ago

Global memory would be great. Here is a proposal:

EDIT: ~/.codex/AGENTS.md is actually already working!

<details><summary>Previous proposal</summary>

Proposal: Implementing AGENTS.md as Global Memory in ~/.codex/

To address the need for persistent, maintainable memory in Codex CLI (similar to Claude code), I propose introducing a global AGENTS.md file located in the user's home directory under ~/.codex/. This file would serve as a centralized, human-editable memory resource, allowing agents and tools to reference, update, and reuse context across projects.

Key Points

  • File Location: ~/.codex/AGENTS.md

This location ensures user-level persistence and avoids polluting individual repositories.

  • Usage:
  • On agent initialization, Codex loads and parses AGENTS.md to build its working memory.
  • Agents can optionally append information during sessions using /memory slash command.
  • Users can manually edit the file.

Benefits

  • Consistency: Maintains agent context across projects.

Example AGENTS.md Structure

# Agent Global Memory

## Preferences
- Language: English
- Code style: Functional

## Custom Instructions
- Always suggest performance optimizations.

</details>

jasonwei1002 · 12 months ago

You've perfectly articulated what I wanted to say👍

newptcai · 11 months ago

In the documentation ~/.codex/AGENTS.md is mentioned. But my experiments show that it does not seem to work.

gpeal contributor · 11 months ago

AGENTS.md is the correct answer

https://agents.md/

styler-ai · 10 months ago

I disagree with my commentors before. What we need for codex is something like cline memory bank read here https://docs.cline.bot/prompting/cline-memory-bank this should be automatically setup and the folder should be configurable in settings.