One conversation.
Any agent runtime.

Switch the agent CLI running your conversation, mid-thread, without losing context. Start in Codex, continue in Claude Code, switch back whenever.

brew tap kennykankush/constant https://github.com/kennykankush/constant
brew install kennykankush/constant/constant
constant host
activeCodex
$ constant host codex
codexthe conversation stays constant

A live codex ⇄ claude switch. The transcript stays; only the runtime swaps.

Codex changes.Claude changes.The conversation stays constant.
Rustlocal-firstno API proxyno model calls on switchMIT
Usage

Two ways to use it

Host an agent live and switch with a keypress, or carry a thread from the command line.

constant host

Live, in your terminal

Run an agent CLI inside Constant and switch the running one with a prefix key. The CLI keeps its own interface; Constant swaps it underneath.

$ constant host codex

  you talk to Codex
  Ctrl-B c   Claude Code continues the thread
  Ctrl-B x   Codex takes it back
constant carry

From the command line

Carry a thread into another runtime's session without a hosted terminal. Constant prints the resume command.

$ constant carry --from codex --to claude
  carried -> claude session 8da587a7
  resume with: claude -r 8da587a7
How it works

What happens on a switch

Agent CLIs don't keep the conversation in memory. Every turn they re-read it from a file on disk, so the file is the memory. To switch, Constant reads the current session, writes the target runtime's own session file, and runs its resume command. No summaries, no model calls. It takes milliseconds.

01
source session

The runtime's local JSONL, the file it re-reads to remember.

02
alembic reader

Load Codex / Claude formats into a neutral thread model (IR).

03
sanitize + redact

Drop scaffold and tool noise, redact secrets.

04
native session

Materialise the target runtime's exact native session shape.

05
native resume

Boot the target with its own resume command. No paste. No summary.

What carries

What carries, what doesn't

Your turns cross over. Tool calls and reasoning don't, because they aren't the same across runtimes. System prompts and secrets are stripped on the way.

Carried

The conversation crosses, word for word.

  • Every user and assistant turn
  • The working directory
  • A name, so it shows up in /resume

Stripped

Removed before anything crosses over.

  • System prompts, skill and plugin lists
  • Injected memory and environment blocks
  • Secrets: API keys, tokens, auth headers, emails

Not carried

Tool calls and reasoning don't transfer between runtimes.

  • ·Tool calls and tool results
  • ·Reasoning traces
  • ·Approvals, sandbox, and hidden provider state
Install

Add the tap, then install

Homebrew is the recommended path. curl and Cargo work too. Run constant doctor afterwards to check your setup.

brew tap kennykankush/constant https://github.com/kennykankush/constant
brew install kennykankush/constant/constant
constant --version
constant doctor
Updating later
$ brew update
$ brew upgrade kennykankush/constant/constant
Hosted keysprefix: Ctrl-B
  • Ctrl-Bc
    Continue in Claude Code, refreshing the existing projection
  • Ctrl-BC
    Create a new Claude continuation
  • Ctrl-Bx
    Continue in Codex, refreshing the existing projection
  • Ctrl-BX
    Create a new Codex continuation
  • Ctrl-B:
    Open the Constant command line (switch / new / quit)
  • Ctrl-Bd
    Detach and exit cleanly
Commands

The command set

A small set of subcommands. The read-only ones never write to your runtime files.

$ constant host codexRun an agent CLI in a Constant PTY and switch the live runtime with a prefix key.
$ constant carry --from codex --to claudeHeadless carry into the target's native session; prints the resume command.
$ constant sessions --all --titlesList carryable sessions across known runtime stores.
$ constant export --from codex --out thread.constant.jsonExport the distilled, redacted neutral IR of a thread.
$ constant doctorPreflight: runtime CLI versions, session-store presence, codec versions.
$ constant statusQuick orientation: runtime readiness, latest sessions, trail state.
$ constant trailShow the current Constant projection per runtime for this directory.
$ constant routeDebug view of the fork graph with readable aliases (codex[1], claude[1.1]).
Codex CLI·validated against 0.137.xClaude Code·validated against 2.1.xOpenCode·plannedAider·plannedGemini CLI·planned
Before you use it

Constant is alpha software. It reads and writes local session files and never overwrites your originals; it keeps a separate copy per runtime. Secrets are redacted and system prompts stripped before anything crosses over. Read the trust boundary before using it on sessions you care about.