Ability to Save a Session State and Branch New Sessions From It
What feature would you like to see?
Summary
I am requesting a feature that enables saving a session’s internal state at a specific point and then creating new branches (new sessions) from that saved state. This would allow users to avoid repeating lengthy initialization or context-building prompt sequences across multiple sessions, significantly reducing token usage and improving workflow efficiency.
Problem Statement
For certain tasks, especially multi-step or complex workflows, I often go through a series of prompts to “prepare” the model:
- Loading context
- Establishing the working conventions
- Setting architectural or project background
- Reaching a stable, useful conversational state
These steps may require hundreds or thousands of tokens and must be repeated whenever I want to start a new, separate conversation following the same assumptions or context. This leads to:
- Excessive token consumption
- Repetitive prompting
- Increased time to reach a usable working state
- Difficulty maintaining consistency across parallel sessions
Proposed Solution
Introduce the capability to save a session snapshot (the model’s internal conversation state at a given point in time) and then create new sessions that start from that snapshot.
This could take the form of features such as:
- “Save State”: Serialize an internal representation of the current session context.
- “Branch Session”: Start a new session that inherits the prior state while allowing its own independent evolution.
- Optional: “List saved states” / “Delete saved state” management interface.
- Optional: Programmatic API support so developers can automate branching and state management.
Benefits
- Reduced token usage: Eliminates the need to resend large initialization prompts.
- Improved consistency: Ensures multiple sessions can start from an identical baseline.
- Faster workflows: Users can immediately begin working at the intended context depth.
- Better multi-branch experimentation: Enables parallel explorations from a shared root state without redoing setup each time.
Example Workflow
- I start a session and guide the model through 10–20 prompts establishing architectural rules, coding conventions, domain details, etc.
- I save the session state as “project-setup-v1.”
- Later, I open a new conversation and choose “Start from saved state → project-setup-v1.”
- I now have a clean, fresh session with all the prior context loaded, allowing me to explore different directions without repeating setup prompts.
Additional Notes
- This feature aligns with common version-control mental models (e.g., branching from a baseline).
- It would be especially valuable for developers using Codex as part of iterative or modular project workflows.
- The capability does not need to reveal any internal model representation; it simply needs to restore the conversational context.
Request
Please consider adding this feature to improve usability, efficiency, and productivity for advanced users who rely on reproducible conversational baselines and multi-branch workflows.
Additional information
_No response_
2 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Thanks for the suggestion. I think this is already captured in #4690, which has received numerous upvotes already. If you think that it doesn't quite capture your idea or you'd like to extend it, feel free to post to it. I'm going to close this one as a duplicate for consolidation purposes.