Skip to content

Add /merge to import useful context from another Codex session #29031

Open

Description

@RandyHaddad

What variant of Codex are you using?

App / CLI / TUI

What feature would you like to see?

We would like Codex to support a first-class /merge command that imports the working state of another Codex session into the current session.

Codex already has ways to branch work through forked, resumed, and parallel sessions. That makes it possible to try a side path without polluting the main thread. The missing piece is the return path: when the side session has done real work, the main session has no structured way to absorb what happened there.

Today that handoff is manual. The user has to leave the flow, reconstruct enough of the side session for the main session to continue, and hope no important detail gets lost. /merge would let the user stay in session A and bring session B's working state back as background context.

/merge user flow

Generated by Codex using GPT Image.

Expected behavior:

  • /merge opens a /resume-style source session picker.
  • /merge <session-id-or-name> imports a specific source session.
  • /merge <session-id-or-name> <instruction> lets the user guide what should be preserved from the source.

The current session remains the target session, the source session is left untouched, and the imported state is visible as a merge marker/history item. That makes the operation distinguishable from ordinary conversation or ordinary compaction when the session is resumed or inspected later.

This should be a session context/state operation only. It should not touch Git state or workspace files.

The closest public requests I found are about first-class fork/branch workflows and selective context transfer:

Do you want to implement the feature yourself?

Yes. We are working on a draft PR in a fork and would like to validate whether this direction aligns with the Codex team's expectations before opening an upstream PR: RandyHaddad#1.

At a high level, the implementation imports source-session context by reusing Codex's compact runtime with merge-specific instructions, then stores the result in the target session as a merge item. The source session is left untouched, and /merge does not perform Git/file/worktree merges.

/merge implementation

Generated by Codex using GPT Image.

Activity

  1. added
    enhancement
    CLI
    TUI
    session
    context
    on Jun 19, 2026
  2. github-actions commented on Jun 19, 2026

    @github-actions
    Contributor

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

    Powered by Codex Action

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

    CLITUIcontextenhancementsession

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions