@vivekgg/code-bridge
v0.1.1
Published
Phone control surface for Claude Code — drives Claude Code sessions via the Agent SDK and exposes them to the Claude Code Micro app over WebSocket or BLE.
Maintainers
Readme
@vivekgg/code-bridge
Dev-machine bridge for Claude Code Micro — a phone control surface for Claude Code. The bridge runs on the machine you want to drive; the phone app connects to it and streams sessions, prompts, approvals, model changes, and token usage.
phone app ──WebSocket / BLE──► code-bridge ──► Claude Agent SDK ──► this machineThis is a community tool. It is not an official Anthropic product.
Requirements
- Node.js ≥ 20 on the machine running the bridge.
- Claude authentication on that machine. The bridge calls the Claude Agent
SDK, so it uses the same credentials as Claude Code (a logged-in Claude Code
install, or
ANTHROPIC_API_KEY). The model runs here and can read/write this machine's files — the phone is only a remote control. - The Claude Code Micro Android app on your phone (installed separately — it is not distributed via npm).
Run
# no install needed:
npx @vivekgg/code-bridge
# or install the command globally:
npm i -g @vivekgg/code-bridge
code-bridgeOn start the bridge prints a QR code, every dialable ws:// URL, and the
pairing token. In the app open Network → Scan QR (or paste a URL).
Flags:
code-bridge # WebSocket only (default)
code-bridge --ble # Bluetooth only (needs the optional native BLE dep)
code-bridge --all # both transports at onceConnecting from another device
The server listens on all interfaces and every connection must present the token, so any device that can route to this machine on the port can connect:
| Where the phone is | URL to use |
|---|---|
| Same Wi-Fi / LAN | ws://<lan-ip>:8787/?t=<token> (printed as lan · …) |
| A different network, anywhere | Install Tailscale on both ends → ws://100.x.y.z:8787/?t=<token> (preferred, encrypted) |
| Tethered by USB | adb reverse tcp:8787 tcp:8787 then ws://127.0.0.1:8787/?t=<token> |
| No network | use the app's Bluetooth tab and run code-bridge --ble |
Configuration
| Env var | Default | Purpose |
|---|---|---|
| CCM_PORT | 8787 | WebSocket port |
| CCM_TOKEN | see below | Pairing token |
Token precedence: CCM_TOKEN → ./.ccm-token (dev checkout) →
~/.claude-code-micro/token. If none exists one is generated and saved to the
first writable location, so an installed CLI keeps the same token across
restarts (no re-pairing). Set your own with CCM_TOKEN=my-secret code-bridge,
and choose a strong token if you expose the bridge over Tailscale.
Security
Anyone who reaches the port with the token can drive Claude Code on this
machine, with this machine's files and credentials. Prefer Tailscale over
exposing the port publicly, and use a strong CCM_TOKEN.
License
MIT
