openaiswitch
Open source · the bridge between AI coding CLIs

Stop rebuilding the story
every time you switch.

Decisions, failed attempts, and next moves pile up inside one tool — then die when you open another. openaiswitch turns a saved session into a structured handoff the next CLI can pick up cold. Command: ais.

  • MIT open source
  • Single Go binary
  • 5 AI coding CLIs
  • Provider stores stay read-only

The Trap

What dies on switch

The useful half of a session never travels: why a path was rejected, which command proved the bug, what “done” actually means. The next model starts from zero and you pay for discovery twice.

What you want instead

Not a paste of the whole transcript. A bridge: objective, decisions that must survive, evidence already earned, blockers, and the next move — ready for a different CLI.

Session stuck in one CLI ais resume Same tool: native resume · Other tool: detailed handoff

Quick Start

install
# requires Go 1.26+
$ git clone https://github.com/reigpol/openaiswitch.git
$ cd openaiswitch
$ go install ./cmd/ais
$ ais doctor

Works on macOS and Linux. ais is a single Go binary — it does not install or replace provider CLIs. Put $(go env GOPATH)/bin on your PATH, then run ais doctor to see what is available on your machine.

In The Loop

Claude Code Codex CLI OpenCode Antigravity Grok CLI Native resume Detailed handoff Secret redaction
ais resume ais doctor ais status .ai/openaiswitch/ handoff.md Read-only stores Model pickers Effort levels

What It Does

Sell the path, not the fantasy: pick a session, stay or switch, land with a handoff that still means something.

Discover sessions

Find conversations that belong to the current project across Claude Code, Codex, OpenCode, Antigravity, and Grok.

Resume natively

Stay in the same CLI and reopen the provider’s real session. No handoff file. No summarization quota spent.

Switch with a bridge

Changing tools builds a detailed handoff: objective, decisions, evidence, blockers, next move — not a raw transcript dump.

Redact secrets

API keys, tokens, passwords, cookies, JWTs, credentials, and .env values are replaced before the handoff is written or copied.

Read-only stores

Provider session stores stay untouched. ais never rewrites Claude, Codex, OpenCode, agy, or Grok history.

Model-aware pickers

Choose the source model and only the reasoning levels that model actually supports — or pass flags for scripts.

Switch Across Tools

Drag the scrubber or scroll the page — the rail moves with you. Five AI coding CLIs, one handoff format.

Scroll the page or drag the scrubber to move the rail.

How The Switch Works

Same CLI

Native resume

Reopens the provider’s official session command. No handoff file is created.

Quota: none
Other CLI

Detailed handoff

Redacts secrets, asks the source model to write a structured handoff, then launches the destination CLI.

Quota: source CLI
Handoff only

Save & copy

Same cross-tool flow without launching another tool. Useful when you want the bridge on disk first.

Quota: source CLI

A handoff is a bridge, not a transcript.

You keep the craft: what was decided, what was proven, what remains. You drop the noise: recursive summaries, secrets, and dead ends that only matter to the model that already lived them.

What survives the switch

  • Objective and current truth
  • Decisions that must not be re-litigated
  • Evidence and verification already done
  • Completed work, active work, blockers
  • Next actions and relevant files
  • A bounded tail of recent conversation — without recursive old handoffs
.ai/openaiswitch/
  • handoff.mdbridge for the next CLI
  • session.mdredacted conversation
  • full.mdfull compaction context
  • compact.mdcompact between passes
  • decisions.mddurable decisions
  • state.jsonlast source / target

Supported Tools

Five AI coding CLIs. One handoff format. Session stores are read-only.

Tool Native resume Session source
Claude Code claude --resume <id> ~/.claude/projects/
Codex CLI codex resume <id> ~/.codex/sessions/
OpenCode opencode --session <id> OpenCode SQLite database
Antigravity agy --conversation <id> ~/.gemini/antigravity-cli/
Grok CLI grok --resume <id> ~/.grok/sessions

Security

Before building a handoff, ais redacts likely API keys, OAuth and access tokens, passwords, cookies, JWTs, credentials, and values loaded from .env files.

  • Redaction covers the handoff prompt, files under .ai/openaiswitch/, and clipboard text.
  • Selected conversations are read; provider session stores are never written by ais.
  • Handoffs are still local files. Review them before sharing outside your machine.

Commands

ais resume

Continue a saved session or create a detailed handoff. Optional focus text for the next agent.

ais status

Show project root, last continuation, handoff status, and detected tools.

ais doctor

Check provider binaries, session stores, Git, SQLite, and clipboard support.

ais update · version

Update or inspect the ais binary only — never your provider CLIs.

Why This Exists

Built for people who already live in more than one CLI.

If you only ever use one tool, you may not need ais. If you hop — Claude for depth, Codex for speed, Grok for a second opinion — the cost is not the model. The cost is re-teaching the work. That is the problem this binary is for.

No waitlist. No hosted model tax. MIT license. Your providers stay yours.