Urgent.News

What's breaking now, across thousands of outlets.

Tech

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

I keep many Claude Code sessions open in Claude Desktop's Code tab. When I walk away, one of them is usually sitting on a permission prompt by the time I'm back. I wanted to see and answer those sessions from my phone. They had to be the same sessions, not copies. The catch is that the desktop app has no public API for any of this. This post is about the design I ended up with in Relaymote (MIT,…

When authoring content for Claude Desktop's Code tab, it often leads to permission prompts while away from the computer. The goal was to access those sessions on a phone without copies. Claude Desktop lacks a public API for these operations. This article details the design created in Relaymote, open-source (MIT, Node.js, Windows first).

The key idea is to read from files without interacting with the app. Claude Desktop saves session details to JSON files, while conversations are saved as .jsonl transcripts. Relaymote can read these files directly, allowing the phone to access sessions even when the desktop app is closed. The phone can only control the app through actions that exist within it, such as sending messages or archiving sessions.

It attaches to the app's main-process debugger (Chrome DevTools Protocol) to invoke the app's internal methods when possible, and falls back to UI interaction when no such methods exist. To prevent UI racing, Relaymote uses serialised actions with an idle gate, ensuring no keyboard or mouse input occurs for a short period. The remote app is a web application, raising security concerns as it could indirectly control the PC.

To mitigate this, the control port binds to loopback only, the app port requires an access key for every request, and pairing uses a QR link with an exchanged key stored as an HttpOnly cookie. The key is still required behind a Cloudflare tunnel, which verifies a JWT if configured. Push notifications are end-to-end encrypted. Waiting times are minimized by auto-resuming sessions that stop due to usage limits and keeping status dots and unread states up-to-date by reading the sidebar every 30 seconds.

The author advises separating reading from acting, treating file access as stable, serialising UI interactions, and treating message sending as code execution while locking down access accordingly. The code repository on GitHub includes the debugger bridge (lib/bridge.js) and the idle-gated UI lane (lib/desktop.js). Feedback on the CDP automation of Electron apps is welcome.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Curiosity Over Comfort

I’m More Interested in Why Things Break Than Why They Work I don’t think I became interested in technology because I wanted to build apps.

More from Tuesday 6 October →