Skip to Content
SubsystemsRemote Bridge

Remote Bridge

Source: src/bridge/ (32 files)

Overview

The bridge system enables remote session management, allowing Claude Code to forward sessions to cloud execution environments. This is feature-gated with BRIDGE_MODE.

Architecture

Key Files

FilePurpose
bridgeMain.tsMain bridge orchestrator
bridgeApi.tsAPI for bridge communication
bridgeMessaging.tsMessage protocol
createSession.tsSession creation
sessionRunner.tsSession execution management
RemoteSessionManager.tsRemote session lifecycle
bridgeConfig.tsBridge configuration
bridgeUI.tsUser interface for bridge status

Security

The bridge implements multiple security layers:

  • JWT Tokens (jwtUtils.ts) — Session authentication
  • Trusted Devices (trustedDevice.ts) — Device verification
  • Work Secrets (workSecret.ts) — Encrypted session data
  • HTTPS Transport — Encrypted communication

Session Lifecycle

  1. Create — Initialize a remote session with credentials
  2. Connect — Establish secure connection to remote environment
  3. Forward — Route user interactions to remote execution
  4. Sync — Keep local and remote state in sync
  5. Disconnect — Gracefully close the session
Last updated on