Skip to content
Maxwell CollinsContact

MobileCommandCenter: phone control of a Mac's AI agent

A phone app and Mac service for directing his Mac's AI coding agent from anywhere.

What it achieved

His Mac's AI agent keeps working while he's away, and asks his phone before every action it takes.

The short version

His Mac's AI coding agent keeps working while he is away and asks his phone before every action it takes, so it never sits stalled waiting for him and never acts without his yes. MobileCommandCenter lets him run a Claude Code agent on his Mac from his phone, in real time. A service on the Mac runs the agent and streams every thought, tool call and file change to a phone app built in React Native. Every action the agent wants to take waits for his yes on the phone. If the connection drops, the answer is no. He pairs the phone once by QR code and reaches the Mac from anywhere over a private network (Tailscale).

The problem

An agent works best on the machine that holds the project, but the person directing it isn't always there. Leaving it unattended means either letting it do anything, or coming back to find it stopped hours ago waiting for a yes.

In use

  1. He pairs the phone once by scanning a QR code, and reaches the Mac from home or anywhere over Tailscale.
  2. From the phone he picks a project, starts a session and sends instructions.
  3. He watches the agent's thinking, tool calls and diffs stream in as they happen, with the cost of each step.
  4. When the agent wants to run a tool, it pauses and his phone asks him. Nothing runs without a yes, and if the connection drops the answer is no.

What it achieved

  • An agent left running no longer sits stalled for hours waiting for a yes: each request reaches his phone wherever he is, showing the tool, its inputs and its risk.
  • Nothing runs without his approval: if the connection drops the answer is no, and no timeout ever approves on its own.
  • Proven on the real thing: a full round trip with the real AI agent software (Anthropic's Agent SDK), from instructions through phone approvals to the cost of each step, works end to end.
  • A phone that drops off and reconnects receives exactly the messages it missed.

The full record

On this page
In one sentence

Maxwell built MobileCommandCenter, real-time control from a phone of a Claude Code agent running on his Mac, in which a relay daemon wraps the Claude Agent SDK, streams every thought, tool call and diff to a React Native app, and holds every tool call at an approval gate on the phone over a 38-message-type WebSocket protocol, measured at 9,319 lines of application code across the relay, the mobile app and a shared protocol package, 18,630 lines of tests (387 relay test cases, 497 mobile test cases and 71 integration test cases), relay coverage of 94.48% of statements, a 1,761-line product spec, 10 architecture decision records and 85 commits. He builds by directing AI agents, and he built this system that way.

lines of tests
18,630
protocol message types
38
test cases
955
lines of application code
9,319
relay statement coverage
94.48%

What it does

Runs the agent from a phone

  • Start a session from anywhere. Pick a project from the phone, start a session, send instructions, and stop it. The agent runs on the Mac with the full project; the phone is the control surface.
  • Watch it think and work. The app streams the agent's text, thinking blocks, tool calls and file diffs as they happen, rendered with Markdown, code blocks and a streaming indicator.
  • Multi-turn sessions with cost tracking. A session carries on across many instructions, and the app shows what each one costs.
  • History. Past sessions and their messages are kept and can be reopened.

An approval gate on every tool call

  • Nothing runs without a yes. When the agent wants to run a tool, the relay suspends it and sends an approval prompt to the phone, showing the tool, its inputs and its risk. The agent waits until the owner taps approve or deny.
  • Fails closed. The SDK's canUseTool callback suspends on a stored promise; an unknown tool defaults to high risk; and no timeout ever approves on its own.
  • Hook events from the agent's own hooks are forwarded to the phone too, so the owner sees what the project's guards did.

The relay daemon on the Mac

  • A Node 22 service under launchd that wraps the Claude Agent SDK, with modules for authentication (device manager, pairing service, auth handler), the database and its migrations, a message ring buffer and message store, permissions, a project registry, the SDK wrapper and event translator, the server (connection manager, envelope codec, message dispatcher, REST router) and sessions (session manager and state machine).
  • Translates 19 or more SDK event types into the protocol's messages.
  • A 9-state session state machine governs every session's lifecycle, so a session can only move between states the contract allows.
  • Never loses a message. Messages carry time-ordered UUIDv7 identifiers and sit in a ring buffer backed by SQLite, so a phone that drops off and reconnects asks for a replay and receives exactly what it missed.
  • REST endpoints for health, pairing and the pairing QR code.

The phone app

  • Five screens: Pairing, Project List, Session, History and Settings.
  • Components for the approval prompt, diff view, thinking block, tool card, Markdown renderer, code block and streaming indicator.
  • Services for biometric unlock, the QR scanner, a reconnection manager and secure storage.
  • Built in React Native 0.79 with Zustand for state and React Navigation 7.

Pairing and security

  • Ed25519 pairing by QR code, then a bearer token for each connection. The app keeps its credentials in secure storage and supports biometric unlock.
  • Reachable on the home network or anywhere over Tailscale, never through a public server.

The protocol

  • 38 message types in one contract. 28 from the relay to the phone: 5 system, 6 session, 10 stream, 2 approval, 3 hook and 2 task or subagent. 10 from the phone to the relay: 6 commands (authenticate, start a session, send an instruction, stop a session, answer an approval, request a replay), the heartbeat reply, and adding, removing and listing projects.
  • Heartbeats keep each connection honest and detect a dropped phone.

What it achieved

  • 18,630 lines of tests and 955 test cases behind 9,319 lines of application code: 7,374 lines and 387 test cases for the relay, 8,009 lines and 497 test cases for the mobile app, and 3,247 lines and 71 test cases for integration.
  • Relay coverage of 94.48% of statements.
  • A verified end-to-end round trip against the real Agent SDK: multi-turn instruction, approvals from the phone and cost tracking all proven together.
  • 85 commits.

The problem it solves

A Claude Code agent works best on the machine that holds the project, but the person directing it is not always at that machine. Leaving an agent running unattended means either granting it permission to do anything, or coming back to find it stopped hours ago waiting for a yes. MobileCommandCenter puts the yes in his pocket: the agent keeps working on the Mac, and every action it wants to take reaches him on his phone, wherever he is, with enough detail to decide.

How he built it

  • Specification first. A 1,761-line product spec, 10 architecture decision records and a 10-phase build playbook were written before code.
  • One protocol contract, enforced. A shared package of 662 lines defines every message, and a hook refuses any message string not in the contract, so the relay and the phone can never disagree about the protocol.
  • Fail-closed by design. Every approval path defaults to deny, and every unknown is treated as high risk.
  • Proven against the real SDK. Five sprints (R1 to R5) connected the real Agent SDK and proved the full round trip against it.
  • Heavy testing. Unit tests for each relay module and mobile screen, integration tests across the wire, and coverage measured on the relay.
  • Maxwell built it by directing AI agents.