Skip to content

Make it easy to fork *current session* and go back to where you forked #9499

Closed

Description

@markgrover

What feature would you like to see?

I had originally filed #4690
It seems like /fork now exists but I find it to be rather lacking and it doesn't meet the stated use cases of 4690 easily.

2 issues:

  1. Currently, when I fork, I have to specify which session I want to fork. But really, every single time, I have wanted to fork the thread I am on. So, now I have to find which session to fork - from a list which just has 3 columns Updated,Branch and Conversation. Most of my conversations start with a same prompt so I can't tell which session I have to fork. There are many ways to make this choice simpler (including putting a badge/star on my current session, listing session IDs, or making forking from current session a top level choice).

  2. I fork because I want to go down a tangent. Sometimes the tangent is productive and sometimes it's not. So, I want to go back to the part where I forked off from. For this to be accomplished today, I have to go find the session ID of the original session from where I forked and resume from there. However, same problem in resume, I have so many sessions, there's not even a session ID displayed in the resume list, so it takes a long time to find the unforked session. All this is still predicated on me noting down the session ID before I fork, which I don't always do. There's gotta be a better way to make this happen.

Additional information

No response

Activity

  1. added
    enhancement
    on Jan 19, 2026
  2. added
    TUI
    on Jan 19, 2026
  3. etraut-openai commented on Jan 19, 2026

    @etraut-openai
    Contributor

    Thanks for the feature request.

    Follow-up question... when you "go back to the part where [you] forked off from", what do you do with code modifications that were made on that forked conversation? Do you revert them? Commit them? Or do these explorations typically involve no code modifications (planning, discovery, etc.)?

    You mentioned that most of your sessions start with the same prompt. If you're able to say more, I'm curious to understand more about this. This is quite different from how I (and probably most) users use Codex. If your prompt is often the same, do you use a custom prompt to avoid typing it every time?

    Just trying to get a better sense for your workflow.

  4. markgrover commented on Jan 20, 2026

    @markgrover
    Author

    Thanks for taking the time to read and ask!

    RE: code modifications:

    • I don't have a great answer, but in most (all?) of my cases, I don't have additional code - it's a planning related tangent. Earlier today, I was implementing some soft delete functionality in an iPhone app. Codex over-engineering and had extra verification logic that was buggy. I had previously done some some related work in another branch that I wanted it to review and see if that also had that buggy logic. I needed the past context in my current session so I didn't want to start a new session altogether but reading that whole another branch in the same session would had made the context pretty dirty. So I decided to fork, did the exploration and wanted to come back to where I forked to resume on the original session, giving it some additional direction based on what I derived from that tangential exploration.
      • Related to this, I have had sessions where I don't have the foresight of forking before I go down the tangent. And, after my context has been dirtied, I want to go back to earlier in the conversation where I had clean context. That was the primary driver for me filing Allow branch off from a past conversation in the current session #4690 As a workaround, I have been going to my jsonl file in codex sessions and deleting all text after a certain point, to get to that state. Not saying that forking should solve that problem - just sharing my use cases, you make the call!

    RE: sessions starting with the same prompt:
    Like everyone else, my sessions start with a plan. However, I find the plan capabilities lacking. I saw your message about /plan in another thread and tried it. It still didn't cut it - I am not sure if I can articulate it super well, but I find that either the plan output is too high level (audit current code to figure out all usages of X), or too low level (here are the usages of X I found in all these files) and neither of them are good for me to engage with. The only thing, I found that makes planning work well with codex is Superpowers. So all my sessions start with running ~/.codex/superpowers/.codex/superpowers-codex bootstrap. I left a note about my experience using superpowers in this thread

  5. markgrover commented on Jan 24, 2026

    @markgrover
    Author

    Just saw /fork fork the current session and LOVE IT!

  6. markgrover commented on Jan 24, 2026

    @markgrover
    Author

    Additionally,
    /status shows:
    │ Forked from: 019bee2a-2602-7502-95cb-66508dbf2f26

    So that solves my problem of going back to the original session. Thanks for turning this around quickly!

  7. duckSquirrelPilot commented on Feb 2, 2026

    @duckSquirrelPilot

    I'm confused- how does /fork differ from or relate to the esc esc functionality? This needs to be documented much better in terms of exactly how this affects the transcripts (when does the command clone a new session conversation), and also what is in the context window after running the command. It gets quite confusing especially when you resume a conversation- I get the feeling that what's in the context window is not what I see in the transcript.

    Actually, I see now that the esc esc forking functionality seems to have been removed here:
    #9140

    That's fine I suppose- one just has to remember to fork before using this if you wish to retain the original conversation. However, while things are fine while working in the "rolled back" conversation, it's quite confusing when resuming as all the original "rolled back" messages come back. In other words, when resuming a "rolled back" conversation that used double esc, what's in the transcript does not match the context window (as I mentioned above).

  8. t4ce commented on Jun 10, 2026

    @t4ce

    Can we get a /fork <Set> ?

    i want to Fork Chatsession cut below -> as usual
    i want to Fork Chat cut above -> forgets old Chat
    i wants cut any of it -> forgets something in between

    This is for when i really care about the Projekt,

    Thanks

  9. BleedingDev commented on Aug 20, 2026

    @BleedingDev

    Would be great to get codex fork <id>, can you make it happen?

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

    TUIenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions