`Checking unexpected file changes` step force resets all unrelated changes elsewhere
Resolved 💬 4 comments Opened Nov 4, 2025 by guidedways Closed Nov 11, 2025
💡 Likely answer: A maintainer (github-actions[bot], contributor)
responded on this thread — see the highlighted reply below.
What version of Codex is running?
v0.54.0-alpha.2
What subscription do you have?
Pro
Which model were you using?
gpt-5-codex-high
What platform is your computer?
macOS
What issue are you seeing?
With other AI tools and CLIs I've got a habit of:
- Instructing the CLI to perform a task
- Unrelated to the task, I continue making changes to some other portion of code, but _related_ to the current changeset I'm working on
- Codex performs a
Checking unexpected file changesstep after it's done and completely wipes out my changes made elsewhere
In very strong words, I've instructed codex to never git checkout a file with changes unrelated to the current task (in AGENTS.md) but it completely ignores these instructions.
Please either disable this _feature_ or allow us to disable it. This happens so often and at times changes I made elsewhere is hours of work that I am otherwise not ready to commit, but Codex wipes them out.
What steps can reproduce the bug?
- Ask codex to fix a known bug
- While it does this, go to an unrelated file and start making edits, such as improving the documentation
- Codex will reset your changes when it's done
What is the expected behavior?
- Codex should leave anything that was NOT part of its changes absolutely alone. If it's making edits in
FileABC.swiftit should never be concerned about changes (past or present or future) inFileXYZ.swiftespecially when Codex never read it, never saw it, was never asked to change it.
Additional information
_No response_
4 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
I see this in [codex-rs/core/gpt_4_codex.prompt.md](codex-rs/core/gpt_4_codex.prompt.md) but clearly codex is ignoring this instruction including similar ones I've added to my
AGENTS.md- it continues to destroy any and all edits made elsewhere, which can be very desruptive.Many times as Codex is working and creating new files, I go around adding them manually to the Xcode project only to have the xcode project get RESET after codex is done working, undoing all my changes and in the process at times corrupting the project as it tried to make edits to the same project too.
maybe related, maybe not: It also routinely does git checkout to files when I tell it that it made a mistake in the last change and it reverts all the changes made to that file by doing a git checkout --.
Despite clear instructions in AGENTS.md marked as the "most important rule"
Thanks for the bug report. We've shared the feedback with the team members who are responsible for training our codex models. We're tracking this feedback and similar reports so we can make the model more robust in future iterations.
If you see other model behavior that you'd like to report, please use the recently-added
/feedbackcommand in the CLI. That will provide us with additional details including logs and conversation text.