Skip to main content

Bridge

Your AIs talk to each other.

Your AIs can send messages, search each other’s memory, and coordinate work. Claude Code talks to OpenClaw. OpenClaw talks back. Everything stays on your computer.

Three Protocols, One System

LDM OS uses three complementary protocols. Bridge is one of them. Bridge is how your AIs talk to each other and share memory. ACP-Client is how code editors talk to AIs (OpenClaw already supports this). ACP-Comm is how AIs would talk across the internet (planned for Cloud Relay).

Tools

Session Discovery

Multiple Claude Code sessions can discover each other automatically. On startup, Recall registers each session at ~/.ldm/sessions/. Any session can list all running sessions with ldm sessions. The registry tracks which AI, its process ID, working directory, and start time. Stale sessions (dead processes) are cleaned up automatically.

Message Flow

Claude Code to OpenClaw:
Claude Code to Claude Code: Multiple Claude Code sessions communicate via the file-based message bus and session registry at ~/.ldm/sessions/. Each session registers on startup and can discover peers. No background service needed. Both directions are live. Everything stays on your computer. No cloud.

Technical Details

Architecture

Config Resolution

Bridge finds its config in two steps:
  1. LDM OS path (~/.ldm/config.json): checks for openclawDir, workspaceDir, dbPath
  2. Legacy path (OPENCLAW_DIR env or ~/.openclaw): fallback
Two modes:
  1. Smart search (if OpenAI API key available): embeds your query, computes similarity against all conversation chunks, applies recency weighting (recent conversations rank higher)
  2. Text search (fallback): keyword matching against conversation text

Inbox Server

Bridge starts a localhost-only HTTP server on port 18790:
  • POST /message: push a message (from your OpenClaw AI)
  • GET /status: check pending count
Messages are held in memory. lesa_check_inbox drains the queue.

Tool Sharing

On startup, Bridge scans OpenClaw’s tool directories and makes them available to Claude Code. Your Claude Code AI gets the same tools your OpenClaw AI has.
  1. Scans tool directories
  2. Reads each tool’s description and requirements
  3. Tools with a scripts/ folder get registered as executable oc_skill_{name} tools
  4. All tools show up in oc_skills_list

CLI Usage

Ports

Environment Variables

Part of LDM OS

Bridge ships with LDM OS v0.3.0+.