git status -sb
Resolved 💬 6 comments Opened Sep 17, 2025 by peakyragnar Closed Nov 11, 2025
💡 Likely answer: A maintainer (etraut-openai, contributor)
responded on this thread — see the highlighted reply below.
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_
6 Comments
Short answer:
git status -sbandgit diffform a simple safety check for agents applying patches:git status -sbto verify which files were modified, added, or deleted — ensuring only expected files were changed.git diffto inspect the actual line-by-line changes, confirming the patch was applied as intended.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
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
<img width="2060" height="6888" alt="Image" src="https://github.com/user-attachments/assets/5791d1f0-b192-412c-a8ff-464872b5ff6c" />
I experience Codex getting into "git status -sb" pathology about once every two hours as I work with it...
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
/feedbackcommand in the CLI. That will provide us with additional details including logs and conversation text.