codex - 💡(How to fix) Fix Global AGENTS.md does not appear to be loaded when a repo AGENTS.md is present [2 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#18189Fetched 2026-04-17 08:31:36
View on GitHub
Comments
2
Participants
3
Timeline
5
Reactions
0
Timeline (top)
labeled ×3commented ×2

A session honored the repository-local AGENTS.md but did not appear to load or apply the global ~/.codex/AGENTS.md.

Root Cause

A session honored the repository-local AGENTS.md but did not appear to load or apply the global ~/.codex/AGENTS.md.

RAW_BUFFERClick to expand / collapse

Summary

A session honored the repository-local AGENTS.md but did not appear to load or apply the global ~/.codex/AGENTS.md.

Why this seems wrong

The global file contained cross-project defaults, including commit policy guidance. During the session, the agent followed the repo-local file and later stated that it had not checked a global AGENTS.md and only knew about the repo-specific file that had been surfaced in context.

That suggests either:

  • global AGENTS.md is not being auto-loaded in some session types, or
  • global and repo AGENTS.md are not being merged as expected, or
  • the load behavior is correct but not visible enough to the agent/user.

Repro

  1. Put cross-project instructions in ~/.codex/AGENTS.md.
  2. Open a repository that also has its own AGENTS.md.
  3. Start a Codex session in that repo.
  4. Ask the agent to perform a task where the global policy should materially affect behavior.
  5. Ask the agent which AGENTS.md files were actually loaded.

Observed

  • The repo-local AGENTS.md was active.
  • The global ~/.codex/AGENTS.md did not appear to be active.
  • The agent reported that it only had the repo AGENTS.md in context and had not inspected a global one.

Expected

One of the following should be true:

  • The global ~/.codex/AGENTS.md is automatically loaded and merged with the repo AGENTS.md.
  • If global loading is intentionally disabled for a given session type, that should be clearly documented and ideally visible in-session.
  • The agent should be able to distinguish between "global instructions are loaded" and "a global file exists on disk but is not active in this session."

Impact

Users may assume their cross-project defaults are active when they are not, which can change commit strategy, tool behavior, and other workflow expectations in subtle ways.

extent analysis

TL;DR

The issue can be addressed by ensuring the global ~/.codex/AGENTS.md is properly loaded and merged with the repository-local AGENTS.md during Codex sessions.

Guidance

  • Verify the documentation for the specific Codex session type being used to see if global AGENTS.md loading is supported and how it is expected to behave.
  • Check the Codex configuration to ensure that global AGENTS.md files are not intentionally disabled for the session type in question.
  • Test the behavior with different session types to see if the issue is specific to one type or a general problem.
  • Consider adding a feature request or documentation update to clarify how global and local AGENTS.md files are handled in different scenarios.

Example

No specific code example is applicable here as the issue seems related to configuration and session management rather than code implementation.

Notes

The exact solution may depend on the specifics of the Codex tool and its configuration options, which are not fully detailed in the issue description. Further investigation into the tool's documentation and configuration is necessary.

Recommendation

Apply a workaround by explicitly loading the global AGENTS.md in the session or ensuring through configuration that it is merged with the repository-local file, as the current behavior may lead to unexpected workflow changes due to missing cross-project defaults.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

codex - 💡(How to fix) Fix Global AGENTS.md does not appear to be loaded when a repo AGENTS.md is present [2 comments, 3 participants]