Broski Bridge

The bridge server connects your phone to AI coding agents running on your computer.

What is the Bridge?

The Broski Bridge is a lightweight server that runs on your Mac or Linux machine and acts as the communication hub between your phone and the AI coding agent. It sits behind broski-link, which handles pairing and the encrypted connection to your phone. The bridge:

  • Translates protocols - Converts messages from your phone into API calls to the AI backend
  • Stays private - Listens on a local socket and on loopback only; it is never exposed to your network

Installation

bash
broski install
Verify your setup
Run broski doctor to check that everything is configured correctly.

Commands

bash
broski                 # Start server (default)
broski install         # Install as background service
broski uninstall       # Remove background service
broski status          # Check if bridge is running
broski stop            # Stop background service
broski-link pair       # Show QR code to pair phone
broski-link status     # Bridge, relay and session status
broski doctor          # Full diagnostics
broski doctor --fix    # Apply safe fixes
broski logs --export   # Export diagnostics bundle

Architecture

Your Phone
Chat UI
Projects
File Browser
Your Desktop
broski-linkPairing, encryption
↓
Bridge ServerUnix socket
↓
AI BackendClaude Code / Pi
↓
Your Code (Filesystem)
↓
AI Cloud (Anthropic/OpenAI)
Connection Routes: Local network (direct) • Relay (end-to-end encrypted)

Component Responsibilities

ComponentResponsibility
Phone AppUser interface, Broski Link client, state management, caching
broski-linkPairing, device authorisation, Noise encryption, LAN listener, relay client, bridge supervision
Bridge ServerMessage routing, event batching, agent connectors
AI BackendSession management, AI reasoning, tool execution, file operations
FilesystemYour actual code files that the AI reads and modifies

Data Flow

When you send a message from your phone:

1
Phone App: User types "Fix the bug in auth.ts"
↓
2
WebSocket: type: "chat", sessionId, content
↓
3
Bridge Server: Receives message, calls AI backend API
↓
4
AI Backend: Processes request, executes tools (Read, Edit, Bash)
↓
5
Bridge Server: Receives events, batches and forwards to phone
↓
6
Phone App: Displays streaming response, tool calls, and results

Connection Routes

Broski Link picks the route that works:

RouteLatencySecuritySetupUse Case
Local network1-30msNoise end-to-endAutomaticHome/office, fastest
RelayVariableNoise end-to-endSet a relay in ~/.broski/link/config.jsonAway from home

How It Works

1
Service starts

broski-link runs on your system, starts the bridge and listens for paired phones

2
Phone scans QR

broski-link pair shows a QR code with your Mac's fingerprint, a one-time pairing secret and its local and relay addresses

3
Encrypted link established

The phone connects directly on your network, or through a relay, and completes a Noise handshake

4
Messages relay

Your messages go to AI agent, responses and tool calls stream back in real-time

Supported AI Agents

ClaudeClaude CodeOfficial Anthropic CLI
PiPiMulti-provider agent

Version Requirements

ComponentMinimum VersionRecommended
Claude Code CLILatestLatest
PiLatestLatest
macOS12 (Monterey)14+ (Sonoma)
LinuxUbuntu 20.04+Ubuntu 22.04+

Security

Privacy by Design
Traffic between your phone and your Mac is end-to-end encrypted, on your local network and through a relay. No data is sent to Broski servers, and the bridge itself is never exposed to the network.
Security FeatureImplementation
PairingOne-time secret in the QR code; expires after 10 minutes and works once
Link EncryptionNoise end-to-end (hybrid X25519 + ML-KEM-768), pinned to your Mac's fingerprint
Device Controlbroski-link devices / revoke manage which phones may connect
Bridge ExposureUnix socket for broski-link and 127.0.0.1 only (agent hooks, dashboard)
Local Hook TokenRandom token with timing-safe comparison, stored in ~/.broski/token.json with 0600 permissions
RelayForwards ciphertext only; sees ids, timing and sizes

Next Steps