Code and context rollback
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 <tag> 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
- Start a multi‑round coding session in the terminal.
- Generate an incorrect output.
- Attempt to restore the previous correct version.
- 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
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗