Add --agents-file or --instructions-file option for explicit AGENTS.md path selection

Resolved 💬 2 comments Opened May 7, 2026 by AlexusEl Closed Jul 1, 2026

What variant of Codex are you using?

CLI

What feature would you like to see?

Hi Codex team,

It would be very useful if codex exec supported an explicit option to provide an instruction file, for
example:

codex exec --agents-file ./path/to/AGENTS.md ...

or more generally:

codex exec --instructions-file ./path/to/profile.md ...

Today, instructions are mainly discovered from the working directory. That works well in many cases, but it
makes it harder to run different Codex executions with different instruction profiles from the same workspace.

This would be especially helpful to run multiple Codex executions on the same project with different objectives,
roles, or constraints, while keeping their instruction profiles clearly separated.

An explicit instruction-file option would make it easier to keep global rules, project rules, and task-specific
rules separate, without changing directories, copying AGENTS.md files, or injecting large instruction blocks
directly into the prompt.

Thanks.

Additional information

_No response_

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗