Add a rewind workflow for context and code timeline management

Open 💬 3 comments Opened Jun 11, 2026 by cjlludwig
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What variant of Codex are you using?

CLI

What feature would you like to see?

Problem

Codex is missing a first-class rewind workflow for managing both conversation context and code changes over time. Claude Code's rewind covers this need well, and the gap in Codex affects my daily workflow.

The core issue is not just undoing code. I need to curate the working timeline of an agent session: remove tangents, failed attempts, stale assumptions, and context bloat while continuing from a useful known-good point.

Current behavior

In Codex, once a thread accumulates noisy context or drifts into a tangent, there is no practical way to prune that context while preserving the useful parts of the session. I can use git to recover some code state, but git does not solve the conversation/context state problem.

That means the agent may continue carrying stale assumptions, unnecessary detours, and prior failed approaches even after the code has been manually cleaned up.

Expected behavior

Codex should support a rewind-like workflow that lets me:

  • Return to a previous point in the session timeline.
  • Discard later conversation turns from the active context.
  • Optionally revert code changes made after that point.
  • Continue working from the cleaner context and code state.
  • Preserve enough history to inspect or recover discarded work if needed.

Why this matters

Context curation is a major part of keeping agent work productive. Without rewind, long-running sessions become harder to steer because the model carries too much irrelevant or actively misleading context.

This has daily impact for workflows where I am iterating with the agent, exploring approaches, rejecting paths, and trying to keep the final working state focused.

Suggested shape

A useful implementation could support:

  • Rewind conversation only.
  • Rewind code only.
  • Rewind both conversation and code to the same checkpoint.
  • Fork from an earlier point while keeping the original session available.
  • Show a clear timeline of checkpoints, tool actions, and code diffs before applying the rewind.

User value

This would make Codex much better for sustained engineering work, where success depends not only on editing files but on actively managing the agent's working memory and direction over time.

Additional information

_No response_

View original on GitHub ↗

3 Comments

github-actions[bot] contributor · 2 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #27233
  • #26348
  • #27188
  • #26739

Powered by Codex Action

kbj2043 · 2 months ago

Adding another user signal for this request.

The key workflow gap is the ability to rewind to a selected point in the agent timeline, not only by pruning later conversation/context, but also with an explicit option to revert the code changes made after that point.

The UX should make the scope clear before applying:

  • rewind context only
  • revert code changes only
  • rewind both context and code to the same checkpoint
  • preview the affected turns, tool actions, and file diffs before confirming

This matters because after a failed direction, stale context and later workspace edits can diverge. Git can help with files, but it does not clean up the agent context; conversation branching can help with context, but it can leave the workspace in a later state. A Claude Code-style rewind flow with a code rollback option would make long Codex sessions much safer to steer.

S2thend · 6 days ago

@cjlludwig @kbj2043 — rewinding to a selected point in the timeline, rather than only pruning, is what codex-rewind does.🥰 It is Codex itself, unofficially built, tracking upstream releases with file snapshots added, so nothing you use today changes.

The part that makes it a timeline rather than a discard: going back is possible. /rewind moves you to an earlier point and /redo returns, because every restore captures the state you are leaving before it overwrites anything. Each destination carries its own undo stack, so returning lands on the state that point actually left rather than on a global most-recent.

It also stays one conversation. Every rewind spawning a visible branch produces branches faster than anyone can label them; here the fork is kept underneath for the return trip and the superseded thread is archived rather than shown.

npm install -g codex-rewind, then run codexr:
https://github.com/extracurricular-ai/codex-rewind

Design write-up, including the redo direction and the archiving rule:
https://github.com/extracurricular-ai/codex-rewind/blob/main/docs/rfc-file-snapshot-rewind.md