Add a setting to configure persistent instructions
Resolved 💬 7 comments Opened Feb 27, 2026 by amit-mittal Closed Apr 3, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor)
responded on this thread — see the highlighted reply below.
What variant of Codex are you using?
CLI
What feature would you like to see?
Scenario:
If I update the Codex generated code separately in IDE, sometimes it doesn't refresh the context with the change and end up working on the old copy of the code (generated by codex), so in each turn, I have to remind it to reload the files in its context.
Similar to https://block.github.io/goose/docs/guides/using-persistent-instructions/, if we can provide a way to configure persistent instructions. This will ensure that in case I forgot to include "refresh" part in the instructions, the persistent instructions would have included that by default.
Additional information
_No response_
7 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
The
AGENTS.mdmechanism is the recommend way to issue persistent instructions, those that apply to all turns.Correct me, but as part of operation to "compact" the context , codex might remove that from context and the subsequent conversations won't have that information.
Have you tried using AGENTS.md? Are you having problems with that approach?
I haven't put it in
AGENTS.md. I can put in the below instructions and reopen the thread if we run into issues again:Let me know if you have any other suggestion.
FYI, having it re-open the files every time before modifying them is going to burn context. When a file has changes, that's unavoidable. But when it's the same, it's a lot of potential context waste, especially that in each prompt it's modifying a file it's going to re-add it to context, not removing the last reads. It might be worth trying to find a different way like telling it whenever it reads a file to keep a list of the file's last modified timestamp, and to check that to see if it needs to re-read it. Perhaps you'd have to tell it to store the list in a temp file. That would avoid compaction nuking the list, and might help it actually track it.
There's ways a file's contents can change and not get noticed using this process, but I think this would be very rare failures. Alternatively, you could have it compare hashes instead of timestamps.
Keeping a list like this would certainly use context too, but if it used it efficiently (search the file in a command rather than read the entire tempfile into context again) it would probably be way less than re-reading files.
It would be interesting if Codex could watch the repo for file changes, and track which files it had read, to automatically know when the file contents in context were stale. There would certainly be decisions to be made about how to implement this, as my proposal is of course nowhere near complete.
This feature request hasn't received enough upvotes, so closing.