git status -sb
What version of Codex is running?
codex-cli 0.36.0
Which model were you using?
gpt-5-codex high
What platform is your computer?
MacOS
What steps can reproduce the bug?
Codex keeps running git status -sb over and over without being prompted.
What is the expected behavior?
No response
What do you see instead?
No response
Additional information
No response
Short answer:
git status -sb and git diff form a simple safety check for agents applying patches:
- Use
git status -sbto verify which files were modified, added, or deleted — ensuring only expected files were changed. - Then run
git diffto inspect the actual line-by-line changes, confirming the patch was applied as intended. - Only if both checks look correct should the changes be staged and committed.
This workflow helps catch failed patch applications, stray file changes, or unintended modifications before committing.
This is totally normal for gpt-5-codex, it's just verifying that the changes are good.
Ok. Thank you. It is running multiple times - the command will appear 2-3 times in succession. This is normal?
@peakyragnar yes - especially so if you have mem. files that require it to revalidate itself a million times.
@trethore @nicholaswmin The problem is far more than what you've suggested. For instance, I asked it a simple prompt
In this document I have five different example playlists to see how each one will render. Is there a neat HTML-and-CSS-only way to let me as a user switch between them? Or will I have to use javascript?"
and in its response it invoked "git status -sb" FIFTY TIMES.
I put up the full transcript (i.e. the complete set of JSON requests that were sent to the OpenAI Response endpoint), and the full JSON responses, so you can see what's up -- https://ljw1004.github.io/codex-trace/example-traces/git_status.html
Here's a screenshot
I experience Codex getting into "git status -sb" pathology about once every two hours as I work with it...
- Once every two days I see infinite loops of "git status -sb" that I have to stop.
- The more frequent pathology though is that I ask a question, and it gives an output_text block with the real answer, but then also invokes "git status -sb" and ends the conversation with a final output_text block that tells me about git status. Therefore, in the VSCode Codex UI, the real answer is hidden under "Finished working" and the visible answer is a useless one about git status. You can observe a variation of this in the screenshot I pasted above: the real answer was the first output_text block "You can make it work with ..." that included snippets, but the visible answer is less useful summary, a paraphrasing, one that no longer has code blocks.
If I terminate a conversation and start a new one, then the "git status -sb" pathology seems to go away for a time. I'm using Gpt-5-codex medium.
(Actually, the transcript that I linked to here has several instances of "git status -sb" pathology in it, earlier in the transcript).
I posted another example of "git status -sb" pathology here: https://www.reddit.com/r/OpenaiCodex/comments/1nm0hgg/ran_git_status_sb/
I'm also noticing this, as well as some other bash commands being repeated this morning. In my case I saw "git status -sb" four times in a row and then the same MySQL SELECT query executed three in a row, followed by another git status -sb, then an answer to the question I had, followed by yet another git status -sb (at which point I pressed Esc to stop it.
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 /feedback command in the CLI. That will provide us with additional details including logs and conversation text.