codex icon indicating copy to clipboard operation
codex copied to clipboard

Add memory functionality similar to Claude code

Open jasonwei1002 opened this issue 1 year ago • 5 comments

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

jasonwei1002 avatar Sep 02 '25 06:09 jasonwei1002

Global memory would be great. Here is a proposal:

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

Previous proposal

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.

michalkos avatar Sep 02 '25 07:09 michalkos

You've perfectly articulated what I wanted to say👍

jasonwei1002 avatar Sep 02 '25 07:09 jasonwei1002

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

newptcai avatar Sep 04 '25 07:09 newptcai

AGENTS.md is the correct answer

https://agents.md/

gpeal avatar Sep 04 '25 15:09 gpeal

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.

styler-ai avatar Oct 03 '25 12:10 styler-ai