← All projects

Open Source · npm package

context-bridge.

Switch agents. Not context.

You work in more than one coding agent, and every switch normally costs you the conversation: copy a summary, hunt a session id, start over. context-bridge connects the native sessions of Claude Code, Codex, Grok, Antigravity and OpenCode. Each agent keeps its own real session; the bridge computes what the other one is missing and delivers exactly that.

JavaScriptnpmv0.12.2 developer preview

Five native sessions, running at once

Claude Code

Native session
claude › Working on the checkout…
Decisions Use VitestKeep API surface small
Open questions How to diff Codex threads?
Files touched src/bridge/src/state/tests/
git main ✓ clean

Codex

Native session
codex › Refactoring the adapter…
Decisions Deterministic thread adoption
Open questions What about rate limits?
Files touched src/adapters/src/cli.ts
git main ✓ clean

Grok

Native session
grok › Exploring edge cases…
Decisions Session-id resume path
Open questions How to handle expired sessions?
Files touched src/grok/src/state.ts
git main ✓ clean

Antigravity

Native session
agy › Tightening the handoff…
Decisions Auto-submit prompt
Open questions Consent UX wording?
Files touched src/agy/docs/
git main ✓ clean

OpenCode

Native session
opencode › Verifying transactions…
Decisions SQLite insert strategy
Open questions Should we prune more aggressively?
Files touched src/opencode/src/ob/
git main ✓ clean
Missing context only
The agents were different.The work was the same.

Every switch meant rebuilding context, rewriting summaries or starting over.

The context should follow.

One command · one continuous session

Watch the work move.

Claude Code

claude ▸ /bridge codexPacking delta…Sending to Codex…Closing Claude Code session.

context-bridge

decisions ✓open questions ✓git state ✓knownBy matrix ✓packing delta…

Codex

codex ▸ Session resumedContext received: only what was missing.
  1. Record

    Decisions and open questions

  2. Diff

    Compare what the target knows

  3. Pack

    Build bounded delta

  4. Switch

    Close one TUI, open the next

  5. Resume

    Continue inside native session

No copied transcript. No wrapper session. No restart.

install, check, switch
$ npm install -g @serdardb/context-bridge
$ bridge doctor --fix bootstraps what is missing, asks before each change
$ bridge starts the loop, Claude Code by default
claude ▸ /bridge codex hand off, Claude closes, Codex opens
codex ▸ $bridge grok same command in every agent
grok ▸ $bridge antigravity
agy ▸ $bridge opencode the fifth agent, delta written into its own store
opencode ▸ $bridge claude back home, context intact
Five agents.Twenty directions.One command.

Five agents. Equal citizens.

Same knowledge on every side. The session shape differs per agent, and each difference is stated, not glossed.

Claude Code

/bridge <agent>
Delta arrives via SessionStart hook, inside the conversation
First switch to Codex Official OpenAI import
Version 2.1.x or newer

Codex

$bridge <agent>
Delta arrives via Resume prompt; SessionStart hook once trusted via /hooks
First switch Delta-seeded session
Version 0.143.0 or newer

Grok

$bridge <agent>
Delta arrives via Opening prompt of the resumed session
First switch Delta-seeded session
Version 0.2.x or newer

Antigravity

$bridge <agent>
Delta arrives via Auto-submitted prompt (--prompt-interactive)
First switch Delta-seeded session
Version agy 1.1.x

OpenCode

$bridge <agent>
Delta arrives via Direct write into its SQLite session store
First switch Delta written on resume, then the TUI opens
Needs The sqlite3 CLI (bridge doctor reports it)

State, not transcripts.

  • Native Claude session
  • Native Codex session
  • Native Grok session
  • Native Antigravity session
  • Native OpenCode session

.bridge/state.json

session refssync watermarksgit checkpointpending markers

Canonical memory stays where it belongs: inside each agent's own session.

  • No transcripts

  • No SaaS

  • No telemetry

  • No API keys

One directory. More than one conversation.

Lanes isolate context, not the working tree.

main Claude Code Codex Switch history
refactor Claude Code Grok OpenCode Switch history
release Codex Antigravity Switch history
Same checkout / same working tree
$ bridge lane$ bridge lane new refactor --seed main$ bridge lane switch main

Each lane keeps its own agent links, switch history and checkpoints. Two terminals can run without their context colliding.

Parallel conversation, not parallel code.

More than a switch.

bridge status linked sessions and saved launch flags
bridge inspect what the last handoff actually ran
bridge clean --dry-run safe checkpoint pruning
bridge handoff codex --from grok rescue a crashed or rate-limited agent
bridge doctor --deep real LIVE or BROKEN probe
bridge unlink codex link fresh next time

Doctor checks vendor session formats before a silent point release can turn every delta empty.

Engineering principles

Engineering principles.

  • Local and private

    No SaaS. No telemetry. Credentials are detected, never read.

  • Boundaries stated

    macOS supported. Linux untested. Lanes share one checkout.

  • Failures visible

    Inspect shows what agents actually ran, failures first.

  • Safe by default

    Clean supports dry-run. Pending injection is never deleted.

The product is the handoff. Trust is the rest of the system.

Keep the work.Change the agent.
npm install -g @serdardb/context-bridge
v0.12.2 / developer previewMIT / zero dependenciesUses the subscription CLIs already installed on your machine.