codex icon indicating copy to clipboard operation
codex copied to clipboard

/status doesn't mention global AGENTS.md

Open nicholaswmin opened this issue 3 months ago • 13 comments

Steps

  • launch codex CLI with global ~/.codex/AGENTS.md/$CODEX_HOME/AGENTS.md present
  • run /status

Expected

  • global AGENTS.md listed in AGENTS files row

Actual

  • reports AGENTS files: (none)

nicholaswmin avatar Sep 17 '25 14:09 nicholaswmin

it works fine in mine.

alexprotonotarios avatar Sep 17 '25 15:09 alexprotonotarios

@alexprotonotarios what's "mine"? version? OS?

nicholaswmin avatar Sep 17 '25 15:09 nicholaswmin

@alexprotonotarios what's "mine"? version? OS?

macOS version 0.36

alexprotonotarios avatar Sep 17 '25 15:09 alexprotonotarios

That's really weird bearing in mind the code doesn't exist yet.

The status line’s AGENTS list just iterates the results of discover_project_doc_paths(...), which only walks the repo tree.

This is about showing up in the /status report for a global AGENTS.md,
not any AGENTS.md.

nicholaswmin avatar Sep 17 '25 15:09 nicholaswmin

I have the same behavior (Windows 11 Pro / Ubuntu 24.04 WSL2). I had already considered whether it would make sense to change this. But I think that's how it's supposed to be?

wbdb avatar Sep 17 '25 21:09 wbdb

No it doesn't make any sense not to print an AGENTS.md that is picked up and composed as context. Maybe if it was entirely replaced by closer memory files, sure; but that's not the case (the AGENTS.md isn't a protocol but the convention is clear about the closer-one-wins mechanics; its only if there is a conflict, otherwise they compose)

FYI,

  • it's used as context if it exists at $CODEX_HOME/AGENTS.md
  • it consumes context and the UI reflects this
  • It is just not mentioned in /status - only.

to me this looks like a crystal clear oversight, nothing more.

The patch I submitted just ensures that /status mentions it as well; it's ready if you wanna give it a spin in: https://github.com/openai/codex/pull/3796

nicholaswmin avatar Sep 17 '25 21:09 nicholaswmin

I came up with the idea because the top item was called Workspace. But yes, it is taken into account, which I then tested, and I also think it should be displayed.

wbdb avatar Sep 17 '25 21:09 wbdb

A global agents.md file has been added now? How do I use this? I have had an AGENTS.md file in my .codex folder on windows for a while, how do i make sure this is loaded?

hi-fox avatar Sep 18 '25 23:09 hi-fox

~/.codex/AGENTS.md “Reply to me with a short joke before every message.”

It's loading :D

More precisely: Config::load_from_base_config_with_overrides calls Config::load_instructions, which reads codex_home/AGENTS.md (by default ~/.codex/AGENTS.md) and stores the content in config.user_instructions (codex-rs/core/src/config.rs:858 and codex-rs/core/src/config.rs:1060).

wbdb avatar Sep 19 '25 00:09 wbdb

The $HOME/.codex/AGENTS.md file is read, but /status doesn't actually tell the user, which makes a situation ripe for confusion as comments above indicate. I had to actually read the codex code today to convince myself that its content probably is being used.

bos avatar Sep 24 '25 02:09 bos

Well I've issued a PR: https://github.com/openai/codex/pull/3796 but it's in desperate need of a test drive.

also yes @bos is correct, the file is read.

nicholaswmin avatar Sep 24 '25 10:09 nicholaswmin

I tried Codex for the first time today, wrote my ~/.codex/AGENTS.md file, ran /status expecting AGENTS.md to be mentioned there, spent 10 mins looking through this repo's issues channel, found a bunch of related issues (that turned out to be misleading after all), proceed to ask Codex why it hasn't loaded AGENTS.md, and it says this:


Ironically, it is in this moment that I realize that Codex has actually read my AGENTS.md file. My prompt contain this no-BS rule:

**USE BRUTAL HONESTY**: Don't try to be polite or agreeable. Be direct, challenge assumptions, and point out flaws

But yeah, this was extremely confusing and the /status command should mention ~/.codex/AGENTS.md file.

PaulRBerg avatar Oct 03 '25 19:10 PaulRBerg

@seratch this isn't a question; it's a bug

nicholaswmin avatar Oct 04 '25 19:10 nicholaswmin