deployment

Remote Control: Drive Claude From Anywhere

Trigger Claude Code from Slack, Telegram, SMS, voice. The remote-control patterns that put Claude in your pocket.

9 min read·

Hidden Feature #002

Leave your desk. Keep the session.

One command generates a QR code. Scan it from your phone. Continue the exact same Claude Code session (context, files, everything) from your mobile browser. Or skip the QR entirely and trigger Claude from Slack, Telegram, SMS, or voice. Claude Code is not a desktop-only tool. It is an always-available AI that fits in your pocket.

1 command

to activate

QR code

scan to connect

full context

nothing lost

Full command
claude remote-control

Run this in your terminal. Claude generates a QR code and a one-time URL.

Shortcut
/rc

Inside any active Claude Code session, type /rc to instantly generate the QR code without leaving the conversation.

continue from where i left, finish the PR description and push
Reading the current diff… PR looks good. Draft: ## What changed - Refactored auth middleware - Added token refresh - Updated tests
session continued from desktop

Trigger surfaces

4 ways to reach Claude from anywhere

Each surface follows the same pattern: message in → local relay → Claude Code → result out.

S

Slack

chat / DM

Send a message in a dedicated Slack channel or DM a bot you configure. The bot relays your text as a Claude Code prompt, then posts the response back.

Example

# Example: Slack bot listener
/rc
# Then in Slack:
"finish the migration and push to staging"

Best for

Best for async instructions you type on mobile during a commute or break.

Architecture

How it wires together

Every surface feeds through a single local relay server. One relay to maintain, one log to watch, one place to add auth.

Flow diagram

INPUT LAYER
  Slack DM  →  bot webhook  ┐
  Telegram  →  bot webhook  ├──→  Local relay server  →  Claude Code CLI
  SMS       →  Twilio hook  ┤                               ↓
  Voice     →  iOS Shortcut ┘                          Result handler

OUTPUT LAYER
  Result handler  →  reply via original channel (Slack / Telegram / SMS)
               or  →  file saved to disk  (for large outputs)
               or  →  silent  (fire-and-forget tasks)

Input layer

Any messaging surface posts to your relay endpoint via webhook or bot API.

Relay server

A small Node/Python script receives messages and calls the Claude Code SDK or CLI with the text as the prompt.

Output handler

Claude's response is routed back to the originating channel, dropped to a file, or POSTed to a callback URL.

Minimal relay: Node.js

// relay-server.mjs
import express from "express"
import { execSync } from "child_process"

const app = express()
app.use(express.json())

app.post("/trigger", (req, res) => {
  const { text, secret } = req.body
  if (secret !== process.env.WEBHOOK_SECRET) return res.sendStatus(401)

  const result = execSync(
    `claude --message ${JSON.stringify(text)} --output-format text`
  )
  res.json({ result: result.toString() })
})

app.listen(3333)

Authentication

Lock the door before opening the window

Remote access means remote risk. Layer at least two of these patterns before exposing your relay.

QR / One-time URL

built-in

The native /rc command generates a short-lived, single-use URL. Expires after the session ends or a configurable timeout. No credentials required: possession of the URL is the auth.

Webhook shared secret

recommended

Add a WEBHOOK_SECRET env variable to your relay server. Each incoming request must include it as a header. Cheap to implement, sufficient for personal use.

IP allowlist

extra layer

Restrict the relay port to your VPN or home IP range. Even if a secret leaks, requests from unknown IPs are dropped at the network level.

mTLS / client cert

advanced

For team or production setups: issue a client certificate to each device. The relay server verifies it on every connection. Overkill for solo devs, right-sized for shared infrastructure.

Quick setup

For most solo devs: use the built-in /rc QR link (one-time URL) plus a WEBHOOK_SECRET on any custom relay. That is two layers for under 5 minutes of setup.

Real scenarios

When remote control actually saves you

On the train or metro

You had a session going, left your laptop at the office, and realise on the train that you forgot to push a critical fix. Scan the QR code you generated before leaving, continue from where you stopped, push the commit, done.

How

# Before leaving desk
/rc
# Scan QR on phone → continue session in mobile browser

Result delivery

4 ways to get the answer back

Choose the delivery method that matches the task type. Mix and match by routing logic in your relay.

Reply in channel

instant

Claude posts the response back to the same Slack channel, Telegram chat, or SMS thread. Best for short answers and status updates.

File drop

for long output

For large outputs (diffs, reports, generated files), Claude writes to a local path and posts a summary with the file location. Keeps messages clean.

Fire and forget

automations

You trigger a task (e.g. run tests, deploy to staging) and get no reply unless it fails. Useful for automations that should be silent when they succeed.

Webhook callback

integrations

Claude POSTs the result JSON to a URL you supply in the trigger message. Lets downstream tools (Zapier, n8n, Notion) pick up the output automatically.

Safety controls

What you should know before going remote

Remote access runs through the same permission layer as your desktop session. No special danger, but a few things to be aware of.

  1. 1

    One-time URL

    Each /rc generates a unique, short-lived URL. It expires after a set time or when the session ends. No permanent open port left behind.

  2. 2

    Local tunnel only

    The connection runs through a secure local tunnel. Your code never leaves your machine through an unsecured channel.

  3. 3

    Hook-level guardrails

    Your existing bash-safety.sh and file-protection.sh hooks still run. Remote triggers go through the exact same permission layer as desktop commands.

  4. 4

    Avoid public WiFi for sensitive sessions

    If you are working with credentials, production systems, or confidential code, use a mobile hotspot instead of public WiFi when connecting remotely.

Cost optimisation

Keep remote usage lean

Remote triggers can eat tokens fast if you are not deliberate. Four habits that keep costs flat.

01

Use /compact before going remote

Compresses the conversation without losing context. Fewer tokens per remote message means lower API cost.

02

Scope the task tightly

Remote messages like "do the thing" force Claude to re-read context. Specific messages like "run pnpm test and reply with just the failure count" cost a fraction.

03

Fire-and-forget for automations

Tasks that do not need a reply (deploy, format, lint) skip the response generation tokens entirely.

04

Set max_tokens on relay server

Add a --max-tokens flag when constructing CLI calls in your relay. Caps runaway responses from vague prompts.

Rule of thumb

Specific remote instructions cost 3-10× less than vague ones. The context is already loaded; you just need to tell Claude exactly what slice of the work to do.

Want this running in your stack?

AY Automate builds AI automation systems for production teams.