Bridge & Remote Control Architecture
Overview
The Bridge system connects your local terminal to Claude.ai web interface. It enables remote control - you can interact with your local codebase from anywhere via the web.
Plain text
Shared from "Claude-Code" on Inkdown
The Bridge system connects your local terminal to Claude.ai web interface. It enables remote control - you can interact with your local codebase from anywhere via the web.
| File | Purpose |
|---|---|
bridge/bridgeMain.ts | Entry point for claude remote-control |
bridge/remoteBridgeCore.ts | Core polling and sync logic |
bridge/replBridge.ts | Bridge-aware REPL integration |
bridge/bridgeMessaging.ts | Message routing between local/web |
bridge/initReplBridge.ts | Bridge initialization |
bridge/bridgeUI.ts | Bridge status UI |
bridge/sessionRunner.ts | Session execution in bridge mode |
bridge/createSession.ts | Session creation API |
Use case: Share local session progress without allowing remote control.
Use case: Let others watch your session without them controlling it.
For persistent remote sessions, Claude Code can run as a daemon:
| State | Indicator | Meaning |
|---|---|---|
offline | Nothing | Bridge not enabled |
connecting | "Bridge: ..." | Connecting to server |
connected | "Bridge: ready" | Connected, no active session |
active | "Bridge: active" | Web user connected |
error | "Bridge: error" | Connection failed |
reconnecting | "Bridge: ..." | Reconnecting after drop |
Bridge is a feature flag. Most users never enable it.
Primary transport is HTTP polling. WebSocket used when available for lower latency.
All state changes are events. Events are queued and flushed to remote.
Remote commands go through the same code path as local input.
If bridge fails, local session continues unaffected.