Proposal: Make destructive edits actually destructive in git repos

Resolved 💬 2 comments Opened Sep 11, 2025 by searls Closed Nov 28, 2025

Codex CLI feels overly conservative about removing code. Even with explicit prompts like “delete X entirely; no placeholders/comments,” it often:

  • Inserts placeholder comments (e.g., <!-- removed: … -->, // removed: …).
  • Leaves commented‑out code instead of deleting it.
  • Writes timestamped backup files on overwrite.

In git‑first workflows these safeguards create noisy diffs and stale breadcrumbs. Git already provides history/undo; the extra artifacts are detritus to be dealt with by the developer or by Codex in follow-up requests.

I figured I'd make a request here, because Codex (apparently) has really good defaults around git hygiene in its system prompt, wherein it generally won't start doing git operations like commits and pushes without being explicitly told to. As a result, addressing this in Codex feels appropriate.

Please either make this behavior configurable or relax it automatically when Codex is operating inside a git repo.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗