← 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 and Antigravity. Each agent keeps its own real session; the bridge computes what the other one is missing and delivers exactly that.

JavaScriptnpmv0.10.0 developer preview
context-bridge: Switch agents. Not context.
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 antigravity same command in every agent agy ▸ $bridge grok grok ▸ $bridge claude back home, context intact
One handoff you type /bridge codex departing agent records decisions and open questions bridge packs what the target is missing (knownBy matrix) launcher closes one TUI, opens the other target resumes already knowing your work

Four 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 viaSessionStart hook, inside the conversation
First switch to CodexOfficial OpenAI import
Version2.1.x or newer

No auto-submitted resume prompt exists in Claude Code, so the hook is the only road in. It is also the cleanest: nothing is pasted in front of the conversation.

Codex

$bridge <agent>
Delta arrives viaResume prompt; SessionStart hook once trusted via /hooks
First switchDelta-seeded session
Version0.143.0 or newer

Exposes its running thread as CODEX_THREAD_ID, so adopting a session that started outside the bridge is deterministic, no guessing involved.

Grok

$bridge <agent>
Delta arrives viaOpening prompt of the resumed session
First switchDelta-seeded session
Version0.2.x or newer

Cleanest storage of the four: resumes by session id, encodes the project path reversibly and marks turn boundaries explicitly. Nothing about it is heuristic.

Antigravity

$bridge <agent>
Delta arrives viaAuto-submitted prompt (--prompt-interactive)
First switchDelta-seeded session
Versionagy 1.1.x

Asks a one-time consent dialog per project; until it is answered the seeded prompt waits. Adapter behaviour was verified live against agy 1.1.5, not assumed.

the rest of the toolbox
$ bridge status what is linked, which launch flags are armed $ bridge inspect what the last handoff actually ran, failures first $ bridge clean --dry-run prune old checkpoints; a pending injection is never deleted $ bridge handoff codex --from grok rescue a crashed or rate-limited agent from any healthy terminal $ bridge claude --model claude-fable-5 flags after the agent name pass through untouched $ bridge doctor --deep asks each agent a real question, reports LIVE or BROKEN

State, not transcripts

Per project the bridge keeps .bridge/state.json: session references, sync watermarks, a git checkpoint and pending markers. Never transcripts, gitignored automatically, migrated forward across versions with the original kept as a backup. Delta checkpoints are delivery artifacts with a pruning schedule, not an archive; canonical memory stays in each agent's own session files.

Doctor checks what others skip

Beyond install and auth, bridge doctor verifies that each vendor's session files still parse with this version of the bridge. Session formats are internal, a renamed field ships silently in a point release, and without this check every handoff would return an empty delta while everything still looked installed.

Local and private

No SaaS, no telemetry, no database. No API keys are read or stored; auth detection checks that credentials exist and never touches their values. Deltas travel only between the CLIs on your machine, inside their normal subscription-authenticated calls.