Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Building a phone remote for a desktop app that has no API

Description and use

Relaymote enables phone control of Claude Code sessions by reading session files and performing actions via Chrome DevTools Protocol, with security and UI serialization safeguards.

Problem

The author needed to view and answer Claude Code sessions from a phone, but the desktop app had no public API.

Outcome

Relaymote allows phone users to list, view, and control Claude Code sessions without a public API, while keeping the UI interactions safe and secure.

Workflow

  • Read session metadata and transcripts from JSON files, starting from the end for fast load.
  • For actions, attach to the app’s main‑process debugger via CDP on 127.0.0.1.
  • If the app exposes an internal method for the action, call it; otherwise drive the UI via CDP.
  • Serialize all UI interactions through a single lane and gate them on human idleness to avoid race conditions.
  • Secure the control port by binding to loopback, requiring an access key on every request, and verifying Cloudflare Access JWTs if used.
  • Implement auto‑resume by recording reset times for usage limits and sending a “continue” request when the limit resets.
  • Poll the sidebar every 30 seconds to update status dots and unread state without opening sessions.

Evidence

Claude Desktop writes a small JSON file per Code session (title, folder, model, archived), and Claude Code writes each conversation as a .jsonl transcript.

Source

Relaymote reads those directly, and reads transcripts from the end, so a long session opens fast.

Source

Acting goes through the app’s main-process debugger (Chrome DevTools Protocol on 127.0.0.1).

Source

Every UI action goes through one serialised lane and waits for an idle gate: no keyboard or mouse input for a short while.

Source

The control port binds to loopback only.

Source

The app port requires an access key on every request. Pairing is a QR link whose key is exchanged once for an HttpOnly cookie.

Source

  • Record date: 2026-10-06T22:40:59.770Z