Add /merge to import useful context from another Codex session

Open 💬 1 comment Opened Jun 19, 2026 by 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: https://github.com/RandyHaddad/codex/pull/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._

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗