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
broski installbroski doctor to check that everything is configured correctly.Commands
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 bundleArchitecture
Component Responsibilities
| Component | Responsibility |
|---|---|
| Phone App | User interface, Broski Link client, state management, caching |
| broski-link | Pairing, device authorisation, Noise encryption, LAN listener, relay client, bridge supervision |
| Bridge Server | Message routing, event batching, agent connectors |
| AI Backend | Session management, AI reasoning, tool execution, file operations |
| Filesystem | Your actual code files that the AI reads and modifies |
Data Flow
When you send a message from your phone:
Connection Routes
Broski Link picks the route that works:
| Route | Latency | Security | Setup | Use Case |
|---|---|---|---|---|
| Local network | 1-30ms | Noise end-to-end | Automatic | Home/office, fastest |
| Relay | Variable | Noise end-to-end | Set a relay in ~/.broski/link/config.json | Away from home |
How It Works
broski-link runs on your system, starts the bridge and listens for paired phones
broski-link pair shows a QR code with your Mac's fingerprint, a one-time pairing secret and its local and relay addresses
The phone connects directly on your network, or through a relay, and completes a Noise handshake
Your messages go to AI agent, responses and tool calls stream back in real-time
Supported AI Agents
Version Requirements
| Component | Minimum Version | Recommended |
|---|---|---|
| Claude Code CLI | Latest | Latest |
| Pi | Latest | Latest |
| macOS | 12 (Monterey) | 14+ (Sonoma) |
| Linux | Ubuntu 20.04+ | Ubuntu 22.04+ |
Security
| Security Feature | Implementation |
|---|---|
| Pairing | One-time secret in the QR code; expires after 10 minutes and works once |
| Link Encryption | Noise end-to-end (hybrid X25519 + ML-KEM-768), pinned to your Mac's fingerprint |
| Device Control | broski-link devices / revoke manage which phones may connect |
| Bridge Exposure | Unix socket for broski-link and 127.0.0.1 only (agent hooks, dashboard) |
| Local Hook Token | Random token with timing-safe comparison, stored in ~/.broski/token.json with 0600 permissions |
| Relay | Forwards ciphertext only; sees ids, timing and sizes |