Agent Context Bridge
A local-first bridge for moving useful context between coding agents, indexing sessions and creating handoff packets for seamless agent switching.
README
Agent Context Bridge
Maintained by @Yongthyuan.
Agent Context Bridge is a local-first bridge for moving useful context between coding agents. It indexes nearby agent sessions, normalizes them into a shared event model, and creates concise handoff packets that another agent can continue from without pasting full raw transcripts.
It is designed to extend CC Switch as an installable Skill + MCP server. CC Switch keeps switching agents; Agent Context Bridge adds session discovery, evidence-backed handoff packets, timeline/search, policy checks, local audit helpers, and encrypted local-directory sync helpers.
Project Status
- Current release line:
1.0.0. - Runtime: Node.js
>=24, Linux/WSL-first. - Distribution: GitHub install through
npx -y github:Yongthyuan/agent-context-bridge. - Safety posture: local-first, default-deny for remote sync and native writes.
- Scope boundary: the bridge creates continuation context; it does not claim native lossless resume between different agent products.
Features
- Detects Claude Code, Codex, Gemini CLI, opencode, Cursor, and Aider session files.
- Builds a normalized project timeline with raw evidence references.
- Creates target-specific continuation prompts for agent handoff.
- Exposes the same bridge through CLI commands, MCP tools, and a small local browser UI.
- Provides CC Switch deep links for one-click Skill and MCP installation.
- Stores runtime state under the current project in
.agent-bridge/. - Avoids modifying native agent session stores by default.
Install
CC Switch
Open the hosted installer:
https://yongthyuan.github.io/agent-context-bridge/cc-switch/install.html
The page generates two CC Switch deep links:
- Skill import: installs the bridge usage instructions.
- MCP import: adds the bridge MCP server command.
The generated MCP command uses:
npx -y github:Yongthyuan/agent-context-bridge bridge-mcp
CLI
Install directly from GitHub:
npm install -g github:Yongthyuan/agent-context-bridge
Initialize bridge storage in a project:
bridge detect
The first run is lightweight: it scans known session roots, creates project-local state, and does not copy full native histories.
Quick Start
List known agents and sessions:
bridge agents list
bridge list --all
Create a handoff packet:
bridge handoff --from codex --to claude --latest
Search recent normalized events:
bridge timeline --limit 20
bridge search "failing test" --limit 10
Use the CC Switch compatibility layer:
bridge cc-switch manifest
bridge cc-switch sessions --target claude
bridge cc-switch handoff --session codex:<session-id> --target claude
Start the local UI:
bridge ui start --host 127.0.0.1 --port 0
Supported Agents
| Agent | Aliases | Session handling |
|---|---|---|
| Claude Code | claude, claude_code |
JSONL session detection and handoff rendering |
| Codex | codex |
JSONL session detection and handoff rendering |
| Gemini CLI | gemini, gemini_cli |
JSONL-style adapter and shell mapping |
| opencode | opencode |
JSONL-style adapter and shell mapping |
| Cursor | cursor |
JSONL-style adapter and terminal mapping |
| Aider | aider |
Markdown session adapter and shell mapping |
Built-in registry packs:
core
gemini-cli
opencode
cursor
aider
protocol-core
Command Reference
Core handoff:
bridge detect
bridge list [--all] [--agent <agent>]
bridge open <agent>:<session-id> [--target <agent>]
bridge handoff --from <agent> --to <agent> [--latest|--session <id>]
bridge raw <agent>:<id> [--around <text>] [--tool <name>] [--since-compact]
bridge doctor
Workbench:
bridge agents list
bridge timeline [--agent <agent>] [--session <id>] [--op <canonical_op>] [--limit <n>]
bridge search <query> [--agent <agent>] [--op <canonical_op>] [--tool <name>] [--limit <n>]
bridge registry list [--available|--installed]
bridge registry validate --pack <pack>
bridge registry install <pack>
bridge hooks status [--agent <agent>]
bridge hooks plan --agent <agent>
bridge hooks install --agent <agent> --yes
bridge hooks uninstall --agent <agent> --yes
bridge memory export [--format markdown|json] [--output <path>]
bridge ui start [--host 127.0.0.1] [--port 0|<port>]
Coordination and policy:
bridge protocol inspect
bridge protocol negotiate --from <agent> --to <agent>
bridge registry negotiate --from <agent> --to <agent>
bridge policy show
bridge policy check <remote.push|remote.pull|native.write|raw.full|raw.excerpt|collab.turn> --agent <agent>
bridge team append --actor <id> --agent <agent> --summary <text> [--files a,b]
bridge team audit
bridge remote status
bridge remote push --to <dir> --key-env <ENV> [--agent <agent>] --yes
bridge remote pull --from <bundle> --key-env <ENV> [--agent <agent>] --yes
bridge collab start --agents codex,claude --mode single_driver [--owner <agent>] [--phase <phase>]
bridge collab status
bridge collab turn --owner <agent> --phase <phase> [--actor <agent>] [--summary <text>]
MCP Tools
Run the MCP server with:
bridge-mcp
It exposes newline-delimited JSON-RPC stdio tools:
bridge_list_sessions
bridge_open_session
bridge_get_handoff_packet
bridge_get_raw_excerpt
bridge_get_sync_status
bridge_append_ledger_event
bridge_list_agents
bridge_get_timeline
bridge_search_events
bridge_list_registry_packs
bridge_validate_registry_pack
bridge_get_hook_status
bridge_plan_hook_install
bridge_export_project_memory
bridge_get_protocol_descriptor
bridge_negotiate_protocol
bridge_negotiate_registry
bridge_check_policy
bridge_get_team_audit
bridge_get_remote_status
bridge_get_collab_status
bridge_cc_switch_manifest
bridge_cc_switch_sessions
bridge_cc_switch_handoff
MCP responses are concise by default. Raw transcripts are exposed only through bounded raw excerpt tools.
Storage And Safety
Runtime state is project-local:
.agent-bridge/
config.json
ledger.jsonl
packets/
raw/
registry/
default-mappings.json
packs/
cache/
exports/
ui/
hooks/
team-ledger.jsonl
remote/
collab/
session.json
Native agent session stores are not modified by default. Hook commands are guarded: status and plan are non-mutating, and install/uninstall require --yes. Current hook installation writes only project-local hook manifests under .agent-bridge/hooks/.
Remote sync is disabled by policy by default. Push/pull require an enabled policy, a key environment variable, an explicit local directory or bundle path, and --yes. Encrypted bundles use Node built-in AES-256-GCM and do not store plaintext payloads.
Development
npm ci
npm test
npm run typecheck
npm pack --dry-run
In this WSL workspace, the verified commands are:
node --test tests/**/*.test.ts
node node_modules/typescript/bin/tsc --noEmit
See ARCHITECTURE.md for the module layout, ROADMAP.md for planned direction, CONTRIBUTING.md for contribution workflow, RELEASE.md for release procedure, SECURITY.md for vulnerability reporting, and CHANGELOG.md for release notes.
Do not commit .agent-bridge/, raw transcripts, remote sync bundles, keys, logs, or generated exports.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。