Track worked-on files

Resolved 💬 2 comments Opened Feb 25, 2026 by davidgilbertson Closed Feb 25, 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?

If the codex harness tracked which files were being read and modified, and for each of those files, tracked if they were changed since the last turn, you could inject into the prompt something like "by the way, file X has changed on disk since you last used it" which could eliminate a lot of annoying behaviour.
By default, Codex will regularly overwrite changes you make to a file, assuming it knows what's in the file. Right now the workaround is to forcefully state in an agents file that the agent must re-read each file before making changes, but a lot of the time this is wasted tokens and time as it re-reads files that haven't changed.

The harness could even provide a diff of what changed to save a round trip (perhaps only if simple or small).

This would make Codex a much better pair programmer. Right now I find myself typing ridiculous things like "change that value from 100 to 102" even though the file is right in front of me, because I know if I do it myself there's a chance Codex is just going to undo it, so it makes for a clumsy experience like I'm "not allowed" to touch my own files.

As for tracking which files are being read, seems like a small suite of tools for reading/writing files would be handy (for this and other reasons), but I assume you've already thought of this and there's a good reason that doesn't exist (I'd love to know it).

Additional information

_No response_

View original on GitHub ↗

2 Comments

github-actions[bot] contributor · 6 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #12547
  • #11654
  • #11601

Powered by Codex Action

etraut-openai contributor · 6 months ago

Yes, we've explored multiple variations of this idea. There are a couple of problems:

  1. The harness doesn't control how files are modified. The agent is free to call any command-line tool it wants, and it is trained to use the most token-efficient means to accomplish the goal. For example, it can (and does) write a small python script to modify files.
  2. Even if we limit all modifications to a built-in tool like apply_patch and block source files that have been modified since the last time the file was read, the model tends to read the file and then overwrite it. This is model behavior that we need to train out of the model.

In any case, these ideas have been suggested by other users as well. I'm going to close this in favor of #11696.