Add config.toml option for explicit additional AGENTS.md paths
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.5k
- PR merge metrics
- PR metrics pending
Description
What variant of Codex are you using?
Codex CLI / app-server (and any client consuming the same configuration).
What feature would you like to see?
Add a supported config.toml option that lets users explicitly specify additional AGENTS.md files to load as native instruction sources.
For example:
agents_files = [
"/home/user/workspace/example-a/AGENTS.md",
"/home/user/workspace/example-b/AGENTS.md",
]
The exact key name is not important; agents_files, additional_agents_files, or similar would all work.
These files should be additive to normal AGENTS.md discovery rather than replacing it.
Use case
Consider a coordinator workspace containing multiple independent repositories:
/home/user/workspace/
├── example-a/
│ ├── .git/
│ └── AGENTS.md
└── example-b/
├── .git/
└── AGENTS.md
Codex is intentionally started from:
/home/user/workspace
so one thread can coordinate work across both repositories.
Current AGENTS.md discovery does not descend into arbitrary child repositories from that working directory, so neither repository-specific AGENTS.md is automatically part of the native instruction chain. A global AGENTS.md can tell the agent to manually read both files, but that is only a workaround: those files are then ordinary file reads rather than first-class instruction sources managed by the Codex harness.
An explicit path list would also be useful for nonstandard workspace layouts where automatic repository discovery is intentionally insufficient or undesirable.
Desired behavior
Configured files should:
- be read at thread/session initialization;
- be treated as native instruction sources, with the same instruction semantics as discovered
AGENTS.mdfiles; - be represented in
/statusalongside other loadedAGENTS.mdsources; - remain part of the effective instruction set after context compaction and thread resume, without relying on the model to remember to reread them;
- load in a deterministic documented order relative to global and automatically discovered
AGENTS.mdfiles; - produce a clear warning if a configured path is missing or unreadable.
The feature should not require recursive scanning. Explicit paths are sufficient and keep the behavior predictable.
Why configuration is useful even with multi-repository discovery
This is related to #38065, which requests automatic per-repository AGENTS.md resolution when work crosses repository boundaries.
That behavior would be valuable, but an explicit configuration mechanism solves a distinct problem: sometimes the user already knows exactly which instruction files must govern a coordinating thread and wants them loaded from the beginning, regardless of which repository is touched first or whether Codex can infer a repository boundary.
The two mechanisms could coexist:
- normal automatic
AGENTS.mddiscovery; - explicitly configured additional instruction files;
- optional dynamic per-repository discovery when work crosses boundaries.
Related: #38065, #27943.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing config.toml parsing and the existing AGENTS.md discovery and instruction-loading paths. Check how sources are initialized, shown in /status, preserved across compaction and resume, and how missing files are reported; done means configured paths load additively in a documented deterministic order with clear warnings.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli, developer-experience
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100