DEV Community

Edgar Durand Díaz
Edgar Durand Díaz

Posted on

How to control Claude Code from your phone

A walkthrough of pairing your terminal with a mobile remote, with notes on PTY handling and React Ink quirks I learned the hard way.

  1. The problem — describe the "agent paused, dev paused" loop. Why mobile makes sense (you have notifications, voice input, a touchscreen — all the pieces).
    1. What it is, in one sentence — CodeAgent Mobile is a mobile app + CLI that pair via 6-character code so you can drive Claude Code from your phone while it runs locally on your laptop.
    2. Setup walkthrough (with code blocks): npm install -g codeam-cli codeam pair # prints a 6-char code Pairing code: 7K2QFM Waiting for mobile…
    3. Open the app, enter the code, then: codeam # spawns Claude Code; you control from phone now
    4. What you can actually do from the phone — bullet list with screenshots: prompt input (text + voice), output streaming, approve interactive prompts (y/n, numbered selectors), file attachments, model picker.
    5. The interesting technical bits (this is what makes it a Dev.to-worthy post, not a sales pitch):
    6. Why a Python PTY helper: Node's child_process.spawn doesn't allocate a full PTY by default → Claude Code (which uses React Ink) refuses to render interactive UI without a TTY. The Python helper wraps the spawn so stdin.isTTY === true even when the CLI's parent is non-interactive.
    7. The 80ms arrow key gap: arrow keys for navigating Ink selectors must be sent one at a time with ≥80ms between each. Sending them in a single write() collapses them into one synchronous batch and React batches the state updates → Enter always picks option 0. Took weeks to track down.
    8. Why the backend is just a relay: code never leaves your machine; Anthropic billing stays on your existing key; the backend has zero LLM cost so the free tier can be generous.
    9. Caveats — needs internet, free tier limits, you still need an Anthropic subscription on your laptop.
    10. What's next — roadmap (multi-agent comparison, voice-driven flows, etc.).
    11. CTA — install, try it, give feedback. Link to repo.

Top comments (0)