Skip to content

Code and context rollback #6449

Closed as not planned
Closed as not planned

Description

@moos1110

The Codex terminal version lacks the ability to roll back code and context. When a generation goes wrong or the context becomes polluted, there is no way to quickly restore a stable state. This breaks the interactive workflow for writing and correcting code, making the terminal version practically unusable for real development.

Expected Behavior
Code rollback: Quickly switch to a previous code snapshot within the terminal session.
Context rollback: Restore to a specific conversation node to avoid error propagation.
Simple trigger: By pressing Esc twice, an interactive menu should appear, allowing the user to choose:
Roll back to a specific context node
Roll back to a specific code snapshot
Compare differences between versions

Current Behavior
No built‑in rollback mechanism.
Once an error is generated, the only option is manual copy/paste or starting over.
Context pollution accumulates and cannot be cleaned.
Iteration and review are inefficient.

Impact
Development efficiency drops: Stable iteration and branching experiments are impossible.
Risk increases: Once wrong code or prompts enter the context, they persist.
Not aligned with CLI workflows: Terminal users expect reversible, auditable operations.

Suggested Solution
Shortcut trigger: Double‑press Esc → open rollback selection menu.
Interactive choice: User selects which context or code snapshot to revert to.
Command fallback: Keep CLI commands like codex revert for advanced users, but Esc Esc provides a fast entry point.
Snapshot storage: Save snapshots in .codex/ directory, with optional tags for management.

Steps to Reproduce

  1. Start a multi‑round coding session in the terminal.
  2. Generate an incorrect output.
  3. Attempt to restore the previous correct version.
  4. Observe: rollback is impossible, only manual workarounds exist.

Environment
Systems: Linux / WSL / Termux / Windows PowerShell
Version: Latest stable terminal release of Codex
Project type: Multi‑file project requiring consistent context

Activity

  1. added
    enhancementNew feature or request
    CLIIssues related to the Codex CLI
    contextIssues related to context management (including compaction)
    on Nov 10, 2025
  2. ZackHirshhorn commented on Nov 10, 2025

    @ZackHirshhorn

    I think these steps to reproduce are too general. I've been doing this countless times and never had a problem getting codex cli to rollback it's changes... Can you make them more specific? perhaps a code example and a specific broken change?

  3. changed the title [-]Why doesn’t the terminal version support code and context rollback? Without it, writing code is useless [/-] [+]Code and context rollback[/+] on Nov 19, 2025
  4. etraut-openai commented on Jan 17, 2026

    @etraut-openai
    Contributor

    This feature request hasn't received enough upvotes to keep open. There are other similar feature requests, so feel free to upvote those.

  5. lly-ke commented on Mar 24, 2026

    @lly-ke

    Needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIIssues related to the Codex CLIcontextIssues related to context management (including compaction)enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions