One conversation.
Any agent runtime.

Switch the agent CLI running your conversation, mid-thread, without losing context. Start in Codex, continue in Claude Code or OpenCode, 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 o   OpenCode takes a turn
  Ctrl-B x   Codex takes it back
  Ctrl-B t   the trail graph — every chapter so far
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
  (auth bug · ch02 ← codex · cobalt-37)
  carried 14 turns · 2 redactions
  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, snapshots the distilled thread to its own record, 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 session file, the one it re-reads to remember.

02
alembic reader

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

03
sanitize + redact

Drop scaffold, redact secrets, cap tool output. Every carry prints a receipt of what crossed.

04
the record

Snapshot the distilled IR to ~/.constant/snapshots first — a durable copy no runtime owns.

05
native resume

Materialise the target's exact native session and boot it with its own resume command. No paste. No summary.

What carries

What carries, what doesn't

Your turns cross over. Tool history can come along with --with-tools; reasoning never does. 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 and handle, so it shows up in /resume
  • Tool calls and results, opt-in with --with-tools (redacted, size-capped)

Stripped

Removed before anything crosses over.

  • System prompts, skill and plugin lists
  • Injected memory and environment blocks
  • Secrets: API keys, AWS keys, PEM blocks, JWTs, tokens, emails

Not carried

Some machinery is never the same across runtimes.

  • ·Tool history, unless you opt in with --with-tools
  • ·Reasoning traces — never carried
  • ·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 (uppercase C: new continuation)
  • Ctrl-Bx
    Continue in Codex (uppercase X: new continuation)
  • Ctrl-Bo
    Continue in OpenCode (uppercase O: new continuation)
  • Ctrl-Bt
    Toggle the trail graph: every chapter of the conversation, switchable from the graph
  • Ctrl-B:
    Open the command line (switch / new / rename / quit, with Tab completion and history)
  • Ctrl-Bd
    Quit (the hosted CLI exits with it)
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: switch the live runtime with a prefix key, status bar on the bottom row.
$ constant carry --from codex --to claudeHeadless carry into the target's native session; prints a receipt and the resume command.
$ constant resume cobalt-37Re-host a conversation from the trail; reprints from the record if every projection is gone.
$ constant sessions --all --titlesList carryable sessions across known runtime stores.
$ constant snapshotsList the record volumes: per-hop IR snapshots written at every carry.
$ constant restore SNAPSHOTReprint a fresh native session from any record volume. Never overwrites anything.
$ constant rename auth bugName a conversation; the native resume pickers re-stamp immediately.
$ constant pack cobalt-37Bundle a conversation — ledger and record — into one portable file; unpack it on another machine.
$ constant psEvery agent CLI process alive right now: runtime, uptime, the conversation it holds, cwd.
$ 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 trailShow the conversation's projections and chapters for this directory.
Codex CLI·validated against 0.139.xClaude Code·validated against 2.1.xOpenCode·validated against 1.14.xGemini CLI·carry source · 0.40Aider·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, and every carry is snapshotted to a local record you can restore from. Secrets are redacted and system prompts stripped before anything crosses over. Read the trust boundary before using it on sessions you care about.