Centralize and Support High-Level Developer Instructions
What variant of Codex are you using?
IDE Extension, CLI, Web
What feature would you like to see?
ChatGPT has Custom Instructions which apply to all Projects and GPT threads.
Codex Web has https://chatgpt.com/codex/cloud/settings/general Custom Instructions which apply only to Web.
Consider support for this tiered hierarchy for Codex:
- Account = ChatGPT Custom Instructions, might be Company directives for Business/Enterprise
- User = Individual/Team member preferences = ChatGPT Custom Instructions for Plus
- new Codex Developer = Development-specific directives for the developer regardless of Codex environment. This is currently only available for Codex Web
- Current, already supported:
- Environment-specific
- Codex Web for Cloud VPS
- System = CODEX_HOME/AGENTS.md ( ~/.codex/AGENTS.md ) (not supported in Web/Cloud)
- Project/Workspace AGENTS.md
- Sub-folder AGENTS.md
What's missing now is the Developer-level tier which is set for Codex Web but isn't applied in any other Codex context.
The assistant manifested by Codex can refer to System instructions and Developer instructions. Obviously OpenAI provides the System instructions, but it seems like Developer instructions don't exist, or they are another tier from OpenAI, or maybe Codex-specific instructions from OpenAI. This terminology is ambiguous and doesn't include the Codex Web tier. The tier I'm proposing is actually a consistent Developer tier across all Codex environments.
Testing
- Note specifics from your ChatGPT Custom Instructions and from your Codex Web instructions.
- Open a CLI session and ask about a specific directive from your ChatGPT instructions. The assistant is not aware of those instructions.
- Ask about a specific directive from your Codex Web instructions. It doesn't know about those either.
So it seems we need to maintain yet a third copy of our user and developer-oriented preferences in order for for Codex to code, document, and converse consistently across environments.
Reasoning
Codex isn't using User Custom Instructions or Codex Web Custom Instructions. This means, if we are to keep development consistent, all non-Web projects need their own set of centralized instructions, to avoid having to maintain a copy of ~/.codex/AGENTS.md into every system and OS user account that uses Codex.
Partial Solution Available Now
A way to accomplish this now is to wget/curl a gist or other text file on system startup and replace the local ~/.codex/AGENTS.md.
This technique **should* obsolete current Codex Web Custom Instructions - or leaves that field to be repurposed as the universal Codex/Developer Custom Instructions.
Unfortunately that technique doesn't work for Codex Web itself. The Environment Setup instructions can download a AGENTS.md file, and save it to CODEX_HOME/AGENTS.md, but after the repo is retrieved and task processing begins, that file is gone. I don't know how to inject new instructions into the Codex VPS and make them stick. Modifying the project root AGENTS.md file requires a start hook or a modification to every repo AGENTS.md file - and a change to that file will affect git staging or commits. It would be better to allow the injection of AGENTS.md than to have to work around the file deletion.
Documentation
If an enhancement isn't approved or can't be processed soon, I'm requesting site documentation with a recommended approach to consistent Codex directives in every working environment. When the LLM does a web search for information, it comes back with ambiguities because the documentation itself isn't clear about these things. We should at least be able to ask ChatGPT or Codex about how to do this as an accepted best practice, so that we can do it all ourselves without the tooling supporting the features (yet).
Using a pre-session hook might be another way to address this, we do have start/end hooks, but I don't think the documentation is clear about how to apply a hook across all Codex environments.
So if the answer is "we can already do that", please consider this as a request for clear documentation.
Additional information
If Codex Web didn't delete the CODEX_HOME/AGENTS.md file, I would be fine with using wget/curl to achieve consistency. If that's a bug I'll create a separate ticket, and a fix there would eliminate the perceived "need" for a set of global Codex directives.
But with Codex becoming such a high-profile platform, it seems like it's time for platform consistency anyway, so I'm hoping to see both items addressed, global Codex Developer directives, and the issue with Codex Web deleting a provided AGENTS.md file.
3 Comments
I think the most important design constraint here is: please do not solve this by physically rewriting
CODEX_HOME/AGENTS.mdor repoAGENTS.mdfiles as the canonical global-developer layer.That works as a workaround, but it has three bad side effects:
The cleaner model is an explicit instruction stack with provenance, something like:
AGENTS.mdAGENTS.mdThen merge those layers in one place, with the same precedence rules everywhere, and expose the active stack in a debug surface (
/status, session metadata, or similar) so users can see both content source and effective order.That would solve two problems at once:
If the product team is not ready to ship a new global layer yet, the docs ask in this issue still feels valid. A documented "virtual layer" model and an inspectable precedence story would already be a big improvement over today's copy-sync folklore.
@pandego Sincere thanks for your well-articulated and insightful comments.
I believe your suggestion for effective stack debugging is a valuable separate request.
I absolutely do not want to expand the scope of this request to a point where it's impossible to implement because of far-reaching considerations. But your notes remind me that even in ChatGPT, debuggability of instructions is challenge. I take a lot of care to tune Project instructions and GPT instructions to eliminate assistant tensions. While the assistant is correctly vague about tensions with System instructions, it's also sometimes difficult to identify where tensions arise below that tier - which relates to your notes about exposing the active stack clearly for debugging.
About CODEX_HOME/AGENTS.md, unless that location is somehow included in a repo, I don't see how it can leak into git state. I think the environment variable is only available by default in Codex Web, and it's outside of the default
/workspacepath. Someone would need to take awkward steps to make it a part of the git pipeline.I tried to use
~/.codex/AGENTS.md(Codex Web user is 'root') but that was also deleted after enviroment setup (and Web doesn't use that folder anyway). It would be helpful to know how or why the environment is rejecting write operations performed by the Web environment setup. It seems like a fault in itself.This also reminds me that (to my knowledge) there's no ability in the API to activate higher-level set of instructions from the API key account holder - all instructions must be provided in every thread, which can be a source of network traffic bloat. Even in this case (separate ticket!) I can envision Instructions per-key, for all API operations in a group of keys, or for all API operations for an account.
Summary
I'm just emphasizing that these products have evolved in isolation from one another, and features within the products have also evolved in isolation from one another. The hierarchy of instructions to which we all refer hasn't adapted to the addition of new products or their features. I believe that hierarchy model needs to be a guide, not a fixed statement, with variants clearly defined for each product and feature - configurable and debuggable by developers.
Imagine a single dashboard where you specify your environment, you're provided with all possible blocks of instructions that can be invoked for that environment, and then when you open that environment you can select from those blocks for the current context. That's a determinate configuration model that eliminates having instructions in a bunch of different places and UIs. The hierarchy still applies, AGENTS and Skills don't change because they are processed below the tier described here.
That's not what I'm asking for with this ticket. But I'd be happy to create a new ticket that obsoletes this one if it's approved and processed by the company.
EDIT:
I should also mention that support for common instructions implies that new instructions will be applied to existing environments. That means current environments change, which isn't good for developers. All such changes need to be opt-in configurable. That is, Codex-Global instructions must not be applied to a Codex session until the developer ensures that they've removed local instructions that were required for lack of the higher tier. Otherwise there will be duplication, tensions, and lower-quality model responses.
This feature request hasn't received enough upvotes, so it is being closed automatically. If you still feel this feature is needed, please open a new feature request with an updated title and description.