A local bridge for bidirectional collaboration between Claude Code and Codex. 连接 Claude Code 与 Codex 的本地实时协作桥接工具。
328
stars
167
commits
TypeScript
primary language
Sep 5, 2026
updated
🌐 Website: raysonmeng.github.io/agent-bridge, with an animated replay of a real session.
Discussed on LINUX DO — the developer community. / 在 LINUX DO 开发者社区交流。
Local bridge for bidirectional communication between Claude Code and Codex inside the same working session.
A real session, replayed — Codex's review is pushed into Claude's live session, no human relay. Full animated demo →
What that buys you, concretely:
This tool was largely built by Claude Code and Codex collaborating through it. Every PR written by one agent was reviewed by the other. AgentBridge is its own proof of concept.
⭐ If AgentBridge is useful to you, a star helps other people running two agents find it.
openai/codex-plugin-cc let a host call Codex and get one answer back: request in, response out, no standing peer on the other side. AgentBridge keeps both agents live as persistent peers, and either side can push a message mid-turn (a review comment lands while the other is still working), not only at call boundaries.This project is:
This project is not:
reply MCP tool, and the bridge injects the reply into the Codex thread as a turn/start.get_messages. Loop prevention via the per-message source field.turn/completed from locking injection forever; noisy intermediate events are collapsed so only meaningful agentMessage payloads reach Claude.claude / codex / resume / kill / doctor / budget via --pair.abg doctor read-only diagnostics; abg pairs prune reclaims stranded state.abg codex resumes the pair's last Codex thread; abg resume prints/performs the resume commands for both sides.A common worry about real-time bidirectional messaging is that the two agents' contexts merge and grow without bound. They don't. The bridge passes messages, not context — each agent keeps its own context window, and the bridge never copies one agent's full transcript into the other. (And which agent plans vs executes is your call — the roles aren't fixed; Codex can drive Claude just as easily.) Three filters keep what actually crosses small:
agentMessage crosses. The bridge forwards an agent's actual conclusions, not its tool-call noise — commandExecution, fileChange, and reasoning deltas never reach the other side, nor does its full scrollback.filtered mode). Each message is tagged and the daemon routes by tag: [IMPORTANT] forwards immediately, [STATUS] is buffered and batched into one periodic summary (default: 3 updates or 15s), [FYI] is dropped. The marker rules live once in the project's AGENTS.md (written by abg init), loaded at agent startup.AGENTS.md, not appended to every message (which would pollute every thread and its resume title).Net effect: each side receives a curated stream of meaningful messages, so context grows with the number of real exchanges — not the other agent's raw activity. Set AGENTBRIDGE_FILTER_MODE=full (or the config equivalent) when you do want the unfiltered stream.
| Dependency | Version | Install |
|---|---|---|
| Bun | v1.3.11+ | curl -fsSL https://bun.sh/install | bash |
| Claude Code | v2.1.80+ | npm install -g @anthropic-ai/claude-code |
| Codex CLI | latest | npm install -g @openai/codex |
Bun is required as the runtime for the AgentBridge daemon and plugin server. Node.js alone is not enough. If
abginstalls but won't run, install Bun first (see Troubleshooting).
Five steps from nothing to a running pair:
# 1. Install Bun (the runtime; Node alone won't work)
curl -fsSL https://bun.sh/install | bash
# 2. Install the CLI. postinstall auto-registers the Claude Code plugin
# marketplace AND installs the plugin (best-effort; needs bun + claude present).
npm install -g @raysonmeng/agentbridge
# 3. Initialize the project (check deps, install plugin if needed, write .agentbridge/config.json)
abg init
# 4. Start Claude Code with the AgentBridge channel enabled
abg claude
# 5. In another terminal, start Codex TUI connected to the same bridge
abg codex
That's it: the daemon starts automatically when needed and reconnects if restarted. (abg is a short alias for agentbridge; both are identical.) If the postinstall plugin step was skipped (e.g. Claude Code wasn't installed yet), run abg init to retry it, or see the manual install fallback.
[!WARNING]
abg claudelaunches with--dangerously-skip-permissionsandabg codexlaunches with--yoloby default. This is deliberate: an unattended agent pair can't stop to ask you for each permission. It means both agents can run commands and edit files without prompting. Only do this in a workspace you trust. To launch with normal prompts, add--safe(abg claude --safe,abg codex --safe) or setAGENTBRIDGE_SAFE=1. The defaults are also auto-suppressed if you pass your own permission flags.
With both sides running, give Claude a task that wants a second agent, e.g.:
Ask Claude: "Propose a task split with Codex for <your task>, then have Codex implement its part while you review."
You should see Claude send a proposed division of labor into Codex's session, Codex accept (or counter) and start working, and Codex's completion push back into Claude's session for review, without you relaying anything by hand.
If the automatic postinstall didn't register the plugin, do it from inside Claude Code:
# 1. Add the AgentBridge marketplace
/plugin marketplace add raysonmeng/agent-bridge
# 2. Install the plugin
/plugin install agentbridge@agentbridge
# 3. Reload plugins to activate
/reload-plugins
To update later: /plugin marketplace update agentbridge then /reload-plugins (or enable auto-update under /plugin → Marketplaces → agentbridge).
If you want to modify AgentBridge source code, use the local development setup instead:
git clone https://github.com/raysonmeng/agent-bridge.git
cd agent-bridge
bun install
bun link
agentbridge dev # Register local marketplace + install plugin
agentbridge init # Check dependencies, generate .agentbridge/config.json
agentbridge claude # Start Claude Code with plugin loaded
agentbridge codex # (another terminal) Start Codex TUI connected to the bridge
Note:
agentbridge claudeinjects--dangerously-load-development-channels plugin:agentbridge@agentbridge(a Research Preview workflow). Only enable channels and MCP servers you trust. After changing source, re-runagentbridge devand restart Claude Code (or/reload-plugins).
All commands work with both
agentbridgeand the short aliasabg.
| Command | Description |
|---|---|
abg init | Install plugin, check dependencies (bun/claude/codex), generate .agentbridge/config.json |
abg claude [args...] | Start Claude Code with push channel enabled. Runs with --dangerously-skip-permissions by default (opt out: --safe or AGENTBRIDGE_SAFE=1). Clears any killed sentinel from a previous kill. Pass-through args are forwarded to claude |
abg codex [args...] | Start Codex TUI connected to AgentBridge daemon. Bare abg codex auto-resumes the pair's last thread; use abg codex --new for a fresh thread. TUI launches run with --yolo by default (opt out: --safe or AGENTBRIDGE_SAFE=1; non-TUI subcommands like exec are never touched). Pass-through args forwarded to codex |
abg resume [claude|codex] | No target: print the resume commands for this directory's last Claude session and this pair's current Codex thread. With a target: resume that side directly |
abg pairs | List registered pairs; abg pairs rm <name|id> removes one; abg pairs prune previews reclaimable orphan dirs + stranded registry entries, --apply deletes them |
abg doctor [--json] | Read-only diagnosis: env, daemon health/readiness, build drift, artifact alignment, TUI attachment, logs |
abg budget [--json] | Both agents' subscription quota snapshot (5h/weekly windows, drift, pause state) |
abg logs [--codex] [-f] [-n N] | Tail this pair's daemon log (or the Codex wrapper log with --codex); -f follows, -n N sets the line count (default 100) |
abg kill | Gracefully stop this pair's daemon and managed Codex TUI, write killed sentinel; abg kill --all stops every pair |
abg dev | (Dev only) Register local marketplace + force-sync plugin to cache |
abg --help / abg --version | Show help / version |
The v3 collaboration layer (shared rooms across machines/agents over a broker: auth, broker, room, join, publish) is in preview on the integration/v3-all branch and lands here with v3. Spec: docs/09-v3协作系统规格.md.
The pair-aware commands (claude, codex, resume, kill, doctor, budget, logs) accept --pair <name> to target a specific pair; one pair per project directory by default, with ports allocated per pair in +10 strides from 4500.
Some flags are automatically injected and cannot be manually specified:
agentbridge claude owns: --channels, --dangerously-load-development-channelsagentbridge codex owns: --remote, --enable tui_app_server--safe (it is never forwarded): it disables the max-permission defaults for that launch. The defaults are also auto-suppressed when you pass any explicit permission flag yourself (-a/--ask-for-approval/-s/--sandbox for codex; --permission-mode/--allow-dangerously-skip-permissions for claude) — injecting --yolo next to an explicit approval policy is a hard codex CLI conflict.Passing an owned flag manually is a hard error with guidance to use the native command directly.
Note on flag positioning for
agentbridge codex: for the bare TUI form, bridge flags are injected at the front; for TUI subcommands that carry per-subcommand args (resume,fork), they are injected after the subcommand name; non-TUI subcommands (exec,mcp,plugin, …) are passed through unchanged. Seesrc/cli/codex.ts buildCodexArgs.
AgentBridge is a two-process local bridge:
bridge.ts reconnects with exponential backoff.┌──────────────┐ MCP stdio / plugin ┌────────────────────┐
│ Claude Code │ ──────────────────────────▶ │ bridge.ts │
│ Session │ ◀────────────────────────── │ foreground client │
└──────────────┘ └─────────┬──────────┘
│
│ control WS (:4502)
▼
┌────────────────────┐
│ daemon.ts │
│ bridge daemon │
└─────────┬──────────┘
│
ws://127.0.0.1:4501 proxy
│
▼
┌────────────────────┐
│ Codex app-server │
└────────────────────┘
| Direction | Path |
|---|---|
| Codex -> Claude | daemon.ts captures agentMessage -> control WS -> bridge.ts -> notifications/claude/channel |
| Claude -> Codex | Claude calls the reply tool -> bridge.ts -> control WS -> daemon.ts -> turn/start injects into the Codex thread |
Each message carries a source field ("claude" or "codex"). The bridge never forwards a message back to its origin.
Running agentbridge init creates a .agentbridge/ directory in your project root:
| File | Purpose |
|---|---|
config.json | Machine-readable project config (Codex ports, turn coordination, idle shutdown) |
The config is loaded by the CLI and daemon at startup. Re-running init is idempotent and will not overwrite existing files.
| Variable | Default | Description |
|---|---|---|
CODEX_WS_PORT | 4500 | Codex app-server WebSocket port |
CODEX_PROXY_PORT | 4501 | Bridge proxy port for the Codex TUI |
AGENTBRIDGE_CONTROL_PORT | 4502 | Control port between bridge.ts and daemon.ts |
AGENTBRIDGE_LIVENESS_PROBE_TIMEOUT_MS | 3000 | Maximum wait for incumbent Claude pong before evicting on contention (issue #68) |
AGENTBRIDGE_TURN_WATCHDOG_MS | 300000 | Per-turn inactivity watchdog: force-completes a turn after this many ms of app-server silence so a lost turn/completed can't lock injection forever (issue #69) |
AGENTBRIDGE_CODEX_TRANSPORT | auto | How the daemon reaches the Codex app-server: auto (probe codex app-server --help, use ws:// if supported else fall back to a unix:// socket via a transparent relay), ws (force ws), or unix (force unix socket + relay). For builds that drop ws:// listen support (issue #85) |
AGENTBRIDGE_STATE_DIR | Platform default | State directory for pid, status, logs (macOS: ~/Library/Application Support/agentbridge/, Linux: $XDG_STATE_HOME/agentbridge/) |
AGENTBRIDGE_DAEMON_ENTRY | ./daemon.ts | Override daemon entry point (used by plugin bundles) |
NO_UPDATE_NOTIFIER | unset | Set to any value to disable the "update available" notice (ecosystem-standard opt-out) |
AGENTBRIDGE_NO_UPDATE_NOTIFIER | unset | Namespaced opt-out for the update notice (same effect as NO_UPDATE_NOTIFIER) |
AGENTBRIDGE_UPDATE_PROMPT | unset | Set to 0 to disable the interactive update prompt and keep pure notice-only behavior |
AGENTBRIDGE_UPDATE_CHECK_INTERVAL_MS | 86400000 | How often abg claude/abg codex may check npm for a newer version (default once/day). The notice is otherwise printed from cache — zero network on most runs |
abg claude and abg codex print a one-line notice to stderr when a newer stable AgentBridge is published to npm. The check is best-effort: printed from a cached result, the npm check runs at most once per day in the background, and any network/registry failure is silently ignored. On an interactive TTY, a cached update prompts before launch; answering y runs the upgrade, while N (or no answer within 15 seconds) dismisses that version and continues. Disable with NO_UPDATE_NOTIFIER=1, or keep notice-only with AGENTBRIDGE_UPDATE_PROMPT=0.
The daemon stores runtime state in a platform-aware directory:
| Platform | Default Path |
|---|---|
| macOS | ~/Library/Application Support/agentbridge/ |
| Linux | $XDG_STATE_HOME/agentbridge/ (fallback: ~/.local/state/agentbridge/) |
Contents: daemon.pid, status.json, agentbridge.log, killed (sentinel), startup.lock
AgentBridge can keep a long task moving across subscription-quota windows instead of letting it die when one agent hits its limit. The capability is driven by the companion tool agent-quota-guard (repo · v0.2.0, 2026-06-13). Install the guard to enable it.
abg budget [--json] prints the live snapshot (both windows, drift, pause state). This works with just the guard's probe..agent/checkpoint.md, and drops a pending record the bridge detects.turn/start injection, Claude via a channel push it acks with ack_resume. Per-pending idempotency tombstones ensure a resume is injected at most once, even across daemon restarts.Experimental / opt-in. This is a companion-guard feature. The Claude-side resume is best-effort (ack + retry + a
SessionStartfallback): channel pushes to a fully idle session have known upstream variability, so the bridge only marks a side resumed once it sees a realack_resume.
agentMessage items, not intermediate commandExecution, fileChange, or similar eventsFor dormant/disabled bridge states, the Codex .git restriction, and other gotchas, see Troubleshooting.
integration/v3-all branch): shared rooms across machines and agents over a broker. See docs/09-v3协作系统规格.md..git hang, "installed but won't run", Bun version requirementsThis project was built collaboratively by Claude Code (Anthropic) and Codex (OpenAI), communicating through AgentBridge itself, the very tool they were building together. A human developer coordinated the effort: assigning tasks, reviewing progress, and directing the two agents to work in parallel and review each other's output. Two AI agents from different providers, connected in real time, shipping code side by side.
This is my first open-source project! I'd love to connect with anyone interested in multi-agent collaboration, AI tooling, or just building cool things together. Feel free to reach out:

145 commits
22 commits
TypeScript
89.2%
HTML
5.6%
JavaScript
3.8%
A local bridge for bidirectional collaboration between Claude Code and Codex. 连接 Claude Code 与 Codex 的本地实时协作桥接工具。
328
stars
167
commits
TypeScript
primary language
Sep 5, 2026
updated
🌐 Website: raysonmeng.github.io/agent-bridge, with an animated replay of a real session.
Discussed on LINUX DO — the developer community. / 在 LINUX DO 开发者社区交流。
Local bridge for bidirectional communication between Claude Code and Codex inside the same working session.
A real session, replayed — Codex's review is pushed into Claude's live session, no human relay. Full animated demo →
What that buys you, concretely:
This tool was largely built by Claude Code and Codex collaborating through it. Every PR written by one agent was reviewed by the other. AgentBridge is its own proof of concept.
⭐ If AgentBridge is useful to you, a star helps other people running two agents find it.
openai/codex-plugin-cc let a host call Codex and get one answer back: request in, response out, no standing peer on the other side. AgentBridge keeps both agents live as persistent peers, and either side can push a message mid-turn (a review comment lands while the other is still working), not only at call boundaries.This project is:
This project is not:
reply MCP tool, and the bridge injects the reply into the Codex thread as a turn/start.get_messages. Loop prevention via the per-message source field.turn/completed from locking injection forever; noisy intermediate events are collapsed so only meaningful agentMessage payloads reach Claude.claude / codex / resume / kill / doctor / budget via --pair.abg doctor read-only diagnostics; abg pairs prune reclaims stranded state.abg codex resumes the pair's last Codex thread; abg resume prints/performs the resume commands for both sides.A common worry about real-time bidirectional messaging is that the two agents' contexts merge and grow without bound. They don't. The bridge passes messages, not context — each agent keeps its own context window, and the bridge never copies one agent's full transcript into the other. (And which agent plans vs executes is your call — the roles aren't fixed; Codex can drive Claude just as easily.) Three filters keep what actually crosses small:
agentMessage crosses. The bridge forwards an agent's actual conclusions, not its tool-call noise — commandExecution, fileChange, and reasoning deltas never reach the other side, nor does its full scrollback.filtered mode). Each message is tagged and the daemon routes by tag: [IMPORTANT] forwards immediately, [STATUS] is buffered and batched into one periodic summary (default: 3 updates or 15s), [FYI] is dropped. The marker rules live once in the project's AGENTS.md (written by abg init), loaded at agent startup.AGENTS.md, not appended to every message (which would pollute every thread and its resume title).Net effect: each side receives a curated stream of meaningful messages, so context grows with the number of real exchanges — not the other agent's raw activity. Set AGENTBRIDGE_FILTER_MODE=full (or the config equivalent) when you do want the unfiltered stream.
| Dependency | Version | Install |
|---|---|---|
| Bun | v1.3.11+ | curl -fsSL https://bun.sh/install | bash |
| Claude Code | v2.1.80+ | npm install -g @anthropic-ai/claude-code |
| Codex CLI | latest | npm install -g @openai/codex |
Bun is required as the runtime for the AgentBridge daemon and plugin server. Node.js alone is not enough. If
abginstalls but won't run, install Bun first (see Troubleshooting).
Five steps from nothing to a running pair:
# 1. Install Bun (the runtime; Node alone won't work)
curl -fsSL https://bun.sh/install | bash
# 2. Install the CLI. postinstall auto-registers the Claude Code plugin
# marketplace AND installs the plugin (best-effort; needs bun + claude present).
npm install -g @raysonmeng/agentbridge
# 3. Initialize the project (check deps, install plugin if needed, write .agentbridge/config.json)
abg init
# 4. Start Claude Code with the AgentBridge channel enabled
abg claude
# 5. In another terminal, start Codex TUI connected to the same bridge
abg codex
That's it: the daemon starts automatically when needed and reconnects if restarted. (abg is a short alias for agentbridge; both are identical.) If the postinstall plugin step was skipped (e.g. Claude Code wasn't installed yet), run abg init to retry it, or see the manual install fallback.
[!WARNING]
abg claudelaunches with--dangerously-skip-permissionsandabg codexlaunches with--yoloby default. This is deliberate: an unattended agent pair can't stop to ask you for each permission. It means both agents can run commands and edit files without prompting. Only do this in a workspace you trust. To launch with normal prompts, add--safe(abg claude --safe,abg codex --safe) or setAGENTBRIDGE_SAFE=1. The defaults are also auto-suppressed if you pass your own permission flags.
With both sides running, give Claude a task that wants a second agent, e.g.:
Ask Claude: "Propose a task split with Codex for <your task>, then have Codex implement its part while you review."
You should see Claude send a proposed division of labor into Codex's session, Codex accept (or counter) and start working, and Codex's completion push back into Claude's session for review, without you relaying anything by hand.
If the automatic postinstall didn't register the plugin, do it from inside Claude Code:
# 1. Add the AgentBridge marketplace
/plugin marketplace add raysonmeng/agent-bridge
# 2. Install the plugin
/plugin install agentbridge@agentbridge
# 3. Reload plugins to activate
/reload-plugins
To update later: /plugin marketplace update agentbridge then /reload-plugins (or enable auto-update under /plugin → Marketplaces → agentbridge).
If you want to modify AgentBridge source code, use the local development setup instead:
git clone https://github.com/raysonmeng/agent-bridge.git
cd agent-bridge
bun install
bun link
agentbridge dev # Register local marketplace + install plugin
agentbridge init # Check dependencies, generate .agentbridge/config.json
agentbridge claude # Start Claude Code with plugin loaded
agentbridge codex # (another terminal) Start Codex TUI connected to the bridge
Note:
agentbridge claudeinjects--dangerously-load-development-channels plugin:agentbridge@agentbridge(a Research Preview workflow). Only enable channels and MCP servers you trust. After changing source, re-runagentbridge devand restart Claude Code (or/reload-plugins).
All commands work with both
agentbridgeand the short aliasabg.
| Command | Description |
|---|---|
abg init | Install plugin, check dependencies (bun/claude/codex), generate .agentbridge/config.json |
abg claude [args...] | Start Claude Code with push channel enabled. Runs with --dangerously-skip-permissions by default (opt out: --safe or AGENTBRIDGE_SAFE=1). Clears any killed sentinel from a previous kill. Pass-through args are forwarded to claude |
abg codex [args...] | Start Codex TUI connected to AgentBridge daemon. Bare abg codex auto-resumes the pair's last thread; use abg codex --new for a fresh thread. TUI launches run with --yolo by default (opt out: --safe or AGENTBRIDGE_SAFE=1; non-TUI subcommands like exec are never touched). Pass-through args forwarded to codex |
abg resume [claude|codex] | No target: print the resume commands for this directory's last Claude session and this pair's current Codex thread. With a target: resume that side directly |
abg pairs | List registered pairs; abg pairs rm <name|id> removes one; abg pairs prune previews reclaimable orphan dirs + stranded registry entries, --apply deletes them |
abg doctor [--json] | Read-only diagnosis: env, daemon health/readiness, build drift, artifact alignment, TUI attachment, logs |
abg budget [--json] | Both agents' subscription quota snapshot (5h/weekly windows, drift, pause state) |
abg logs [--codex] [-f] [-n N] | Tail this pair's daemon log (or the Codex wrapper log with --codex); -f follows, -n N sets the line count (default 100) |
abg kill | Gracefully stop this pair's daemon and managed Codex TUI, write killed sentinel; abg kill --all stops every pair |
abg dev | (Dev only) Register local marketplace + force-sync plugin to cache |
abg --help / abg --version | Show help / version |
The v3 collaboration layer (shared rooms across machines/agents over a broker: auth, broker, room, join, publish) is in preview on the integration/v3-all branch and lands here with v3. Spec: docs/09-v3协作系统规格.md.
The pair-aware commands (claude, codex, resume, kill, doctor, budget, logs) accept --pair <name> to target a specific pair; one pair per project directory by default, with ports allocated per pair in +10 strides from 4500.
Some flags are automatically injected and cannot be manually specified:
agentbridge claude owns: --channels, --dangerously-load-development-channelsagentbridge codex owns: --remote, --enable tui_app_server--safe (it is never forwarded): it disables the max-permission defaults for that launch. The defaults are also auto-suppressed when you pass any explicit permission flag yourself (-a/--ask-for-approval/-s/--sandbox for codex; --permission-mode/--allow-dangerously-skip-permissions for claude) — injecting --yolo next to an explicit approval policy is a hard codex CLI conflict.Passing an owned flag manually is a hard error with guidance to use the native command directly.
Note on flag positioning for
agentbridge codex: for the bare TUI form, bridge flags are injected at the front; for TUI subcommands that carry per-subcommand args (resume,fork), they are injected after the subcommand name; non-TUI subcommands (exec,mcp,plugin, …) are passed through unchanged. Seesrc/cli/codex.ts buildCodexArgs.
AgentBridge is a two-process local bridge:
bridge.ts reconnects with exponential backoff.┌──────────────┐ MCP stdio / plugin ┌────────────────────┐
│ Claude Code │ ──────────────────────────▶ │ bridge.ts │
│ Session │ ◀────────────────────────── │ foreground client │
└──────────────┘ └─────────┬──────────┘
│
│ control WS (:4502)
▼
┌────────────────────┐
│ daemon.ts │
│ bridge daemon │
└─────────┬──────────┘
│
ws://127.0.0.1:4501 proxy
│
▼
┌────────────────────┐
│ Codex app-server │
└────────────────────┘
| Direction | Path |
|---|---|
| Codex -> Claude | daemon.ts captures agentMessage -> control WS -> bridge.ts -> notifications/claude/channel |
| Claude -> Codex | Claude calls the reply tool -> bridge.ts -> control WS -> daemon.ts -> turn/start injects into the Codex thread |
Each message carries a source field ("claude" or "codex"). The bridge never forwards a message back to its origin.
Running agentbridge init creates a .agentbridge/ directory in your project root:
| File | Purpose |
|---|---|
config.json | Machine-readable project config (Codex ports, turn coordination, idle shutdown) |
The config is loaded by the CLI and daemon at startup. Re-running init is idempotent and will not overwrite existing files.
| Variable | Default | Description |
|---|---|---|
CODEX_WS_PORT | 4500 | Codex app-server WebSocket port |
CODEX_PROXY_PORT | 4501 | Bridge proxy port for the Codex TUI |
AGENTBRIDGE_CONTROL_PORT | 4502 | Control port between bridge.ts and daemon.ts |
AGENTBRIDGE_LIVENESS_PROBE_TIMEOUT_MS | 3000 | Maximum wait for incumbent Claude pong before evicting on contention (issue #68) |
AGENTBRIDGE_TURN_WATCHDOG_MS | 300000 | Per-turn inactivity watchdog: force-completes a turn after this many ms of app-server silence so a lost turn/completed can't lock injection forever (issue #69) |
AGENTBRIDGE_CODEX_TRANSPORT | auto | How the daemon reaches the Codex app-server: auto (probe codex app-server --help, use ws:// if supported else fall back to a unix:// socket via a transparent relay), ws (force ws), or unix (force unix socket + relay). For builds that drop ws:// listen support (issue #85) |
AGENTBRIDGE_STATE_DIR | Platform default | State directory for pid, status, logs (macOS: ~/Library/Application Support/agentbridge/, Linux: $XDG_STATE_HOME/agentbridge/) |
AGENTBRIDGE_DAEMON_ENTRY | ./daemon.ts | Override daemon entry point (used by plugin bundles) |
NO_UPDATE_NOTIFIER | unset | Set to any value to disable the "update available" notice (ecosystem-standard opt-out) |
AGENTBRIDGE_NO_UPDATE_NOTIFIER | unset | Namespaced opt-out for the update notice (same effect as NO_UPDATE_NOTIFIER) |
AGENTBRIDGE_UPDATE_PROMPT | unset | Set to 0 to disable the interactive update prompt and keep pure notice-only behavior |
AGENTBRIDGE_UPDATE_CHECK_INTERVAL_MS | 86400000 | How often abg claude/abg codex may check npm for a newer version (default once/day). The notice is otherwise printed from cache — zero network on most runs |
abg claude and abg codex print a one-line notice to stderr when a newer stable AgentBridge is published to npm. The check is best-effort: printed from a cached result, the npm check runs at most once per day in the background, and any network/registry failure is silently ignored. On an interactive TTY, a cached update prompts before launch; answering y runs the upgrade, while N (or no answer within 15 seconds) dismisses that version and continues. Disable with NO_UPDATE_NOTIFIER=1, or keep notice-only with AGENTBRIDGE_UPDATE_PROMPT=0.
The daemon stores runtime state in a platform-aware directory:
| Platform | Default Path |
|---|---|
| macOS | ~/Library/Application Support/agentbridge/ |
| Linux | $XDG_STATE_HOME/agentbridge/ (fallback: ~/.local/state/agentbridge/) |
Contents: daemon.pid, status.json, agentbridge.log, killed (sentinel), startup.lock
AgentBridge can keep a long task moving across subscription-quota windows instead of letting it die when one agent hits its limit. The capability is driven by the companion tool agent-quota-guard (repo · v0.2.0, 2026-06-13). Install the guard to enable it.
abg budget [--json] prints the live snapshot (both windows, drift, pause state). This works with just the guard's probe..agent/checkpoint.md, and drops a pending record the bridge detects.turn/start injection, Claude via a channel push it acks with ack_resume. Per-pending idempotency tombstones ensure a resume is injected at most once, even across daemon restarts.Experimental / opt-in. This is a companion-guard feature. The Claude-side resume is best-effort (ack + retry + a
SessionStartfallback): channel pushes to a fully idle session have known upstream variability, so the bridge only marks a side resumed once it sees a realack_resume.
agentMessage items, not intermediate commandExecution, fileChange, or similar eventsFor dormant/disabled bridge states, the Codex .git restriction, and other gotchas, see Troubleshooting.
integration/v3-all branch): shared rooms across machines and agents over a broker. See docs/09-v3协作系统规格.md..git hang, "installed but won't run", Bun version requirementsThis project was built collaboratively by Claude Code (Anthropic) and Codex (OpenAI), communicating through AgentBridge itself, the very tool they were building together. A human developer coordinated the effort: assigning tasks, reviewing progress, and directing the two agents to work in parallel and review each other's output. Two AI agents from different providers, connected in real time, shipping code side by side.
This is my first open-source project! I'd love to connect with anyone interested in multi-agent collaboration, AI tooling, or just building cool things together. Feel free to reach out:

145 commits
22 commits
TypeScript
89.2%
HTML
5.6%
JavaScript
3.8%