/undo and Conversation Pollution in Codex

The Pollution Problem

Seasoned coding agent users are familiar with conversation pollution that can introduce misled, misguided, or otherwise undesirable tokens or information to an otherwise healthy conversation history.

This pollution comes in two forms:
1. Introduced via prompt by user error including missing information and false premises, or
2. Introduced via agent reasoning or tool calls by accessing incorrect files, assuming wrong keywords, searching outdated documentation.

This pollution can drive drastically different implementation and research approaches from agents, including 5.6 Sol at its highest reasoning level, with as little as a few wrong words in a user prompt.

It is insufficient for Codex to strictly allow editing only the most recent user prompt.

The most effective tool against conversation pollution is editing the history of the conversation. Pollution compounds as a linear conversation with no edits becomes a context window full of corrections and backtracking. A mistake made 5 messages ago is now permanently embedded in context.

Eric Traut addressed this feature request on GitHub citing users “use git to commit” or “they rely on Codex to undo its own work”. Neither of these workarounds address the issue of Codex missing this critical feature: /undo is a conversation management tool, not just an ‘oopsie’ tool.

Claude Code fully fixes this issue. /rewind is fast, easy, and incredibly effective. Unsatisfactory responses and user mistakes are non-existent from its conversation history rather than just being backtracked in context. Conversation pollution is not a concern when using Claude Code, meanwhile Codex requires the context-minded to worry about it before every prompt. Please re-introduce /undo.

image

Correct me if I am wrong, but doesn’t Codex quite literally provide the exact same (/rewind) maximally cache-preserving feature already with this branching ability?

Claude’s rewind is checkpoint based. They make a snapshot after every single prompt you send iirc.

The way you think of it with simply editing something in the middle of the history, none of the cached computation after that mutation remains usable lol

I mean, you can build it. It’s just a token smeltery and maximally inefficient.

Branching does exist. Critically, however, you can only branch from the most recent Codex response. This means managing a conversation to the same utility that /rewind provides with branches requires both tediously creating a new branch after every prompt and also undoing all of the code and memory changes up to whichever branch you’re going back to. After 10 messages, that’s 10 separate branches in your side panel of the same conversation.

I mean it is true that it does not undo your code changes in Codex but why would you need to fork after every prompt? You can literally just scroll up and fork older states.

As for the snapshotting and “rewinding” code part, done: GitHub - LoweloDev/codex-rewind: reverts code using git with hook, not just chat · GitHub

If it’s broken I’ll fix it tomorrow or so or you just make an issue / open PR. I’ll use that myself. Didn’t actually know that it doesn’t snapshot via version management by default.