Context Bridge

Context Bridge is an open-source CLI agent harness and context orchestration utility developed by serdardb. It is built to facilitate seamless context switching and conversation state portability across different terminal-based AI coding agents. Operating as a lightweight Node.js command-line tool, Context Bridge manages session transitions between supported developer agents, including Claude, OpenAI Codex, and OpenCode. It tracks active session threads, captures transcript deltas, and delivers state updates across agent boundaries using runtime hooks like SessionStart. What sets Context Bridge apart is its multi-route adopt architecture. Instead of locking developers into a single proprietary assistant interface, it allows users to switch between disparate AI tools on the fly, auto-adopting external sessions via process environment indicators such as CODEX_THREAD_ID or working directory rollout discovery. The project is available as an open-source tool with zero external runtime dependencies, supporting Node.js environments (v18, v20, and v22).

Tags: agent harness, ai agent, cli, coding agent, developer tools, OpenSource

Visit Context Bridge

Key features

  • Cross-agent context handoff — Enables bi-directional context routing between multiple AI coding agents, including Claude, Codex, and OpenCode. - External session adoption — Automatically detects and adopts running agent sessions via runtime IDs or cwd-matched transcript discovery using the --adopt flag. - Hook-driven state injection — Injects pending conversation deltas and session state into target agents using SessionStart hook integrations. - Zero runtime dependencies — Packaged as a clean, native Node.js binary requiring no third-party package dependencies. - Delta and transcript synchronization — Implements byte-accurate truncation and baseline sync tracking to pass compact conversation summaries across agent boundaries.

Use cases

Use Case: Switching Agent Runtimes Mid-Task A developer prototyping an implementation in Claude Code reaches a task better suited for Codex or OpenCode. By triggering a bridge handoff, Context Bridge extracts the active session transcript and passes a structured delta to the next agent without requiring manual re-prompting.

Use Case: Adopting Unmanaged Terminal Sessions A developer starts an ad-hoc session directly in Codex and later decides to switch to Claude. Running Context Bridge with the --adopt flag locates the active session transcript using the current working directory or thread ID and initializes the new agent with full context.

Who it is for

Context Bridge is intended for software engineers who switch between multiple CLI-based AI assistants (such as Claude Code, Codex, and OpenCode) and require state portability. It is not necessary for developers whose entire workflow remains inside a single, dedicated agent ecosystem.

Install guide

Installation Install Context Bridge globally from npm (Node.js 18+ required): bash npm install -g context-bridge

First Run Verify that the binary is installed and check its version: bash bridge --version

Example Session Adopt an existing unmanaged agent session and route context to another agent: bash # Adopt an active session context and transition to Claude bridge claude --adopt # Or invoke context transitions from within supported plugin environments $bridge claude

Part of CLI Coding Agents

Categories: AI Coding Agents, Code Assistants, Developer Tools

Related CLI agents

  • SWE-agent — SWE-agent is an open-source autonomous software engineering agent harness built and maintained by researchers from Princeton University and Stanford University.…
  • AgentLint — AgentLint is an open-source repository linting, validation, and workflow enforcement harness developed by 0xmariowu. It is designed to enforce structural…
  • Weaver — Weaver is an open-source agent harness and orchestration framework maintained by sean35mm on GitHub. Built on top of the Bun…
  • Agentic Engineering Framework — Agentic Engineering Framework is an open-source orchestration harness and governance layer developed by Dimitri Geelen. It is designed to constrain,…
  • Hivelore — Hivelore is an open-source agent harness and contextual memory orchestrator created by Doucs91. It provides persistent project memory, decision tracking,…
  • Agent Runbook — Agent Runbook is an open-source contract-based multi-agent skill framework developed by KnoxOps. It acts as an orchestrator and compiler that…
  • AI Tools
  • Categories
  • Industries
  • CLI Coding Agents
  • MCP Servers
  • MCP Categories