Codex app: add a repo hygiene agent for dirty worktrees and git state
Feedback
When a repository is dirty with multiple git or repo-hygiene issues, Codex often focuses on the single top-line issue and misses the rest. For users who are busy or less confident with merge/pull/push/commit workflows, this leaves too much operational responsibility on the user.
Git hygiene has become a complex workflow in its own right: understanding dirty worktrees, unstaged changes, untracked files, local commits, remote divergence, branch state, merge conflicts, pull/rebase decisions, and what is safe to commit or push. This can feel as complex and consequential as bookkeeping.
Current behavior
Codex may notice one obvious issue, such as a dirty worktree, uncommitted files, or a branch mismatch, but it does not consistently take global responsibility for the repository's full hygiene state. The user still has to infer whether other git risks remain.
Desired behavior
Add a dedicated repo hygiene agent or mode that takes responsibility for the full repository state across a Codex project. It should inspect and explain the complete git situation, including:
- dirty tracked files
- untracked files
- staged vs unstaged work
- local commits not pushed
- remote commits not pulled
- branch divergence
- merge/rebase conflicts or risks
- unclear ownership of existing changes
- whether it is currently safe to pull, commit, push, or open a PR
The agent should produce a clear action plan and, with user confirmation where needed, help carry out the appropriate git workflow end to end.
Why this matters
Codex is increasingly used by developers who may not be git experts. If Codex can write code across multiple files and branches, it should also help keep the repo in a healthy, understandable state. A global hygiene agent would reduce accidental overwrites, lost work, confusing branch states, and user anxiety around committing, pulling, pushing, and merging.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗