What Is Claude Code Dispatch? How to Remote Control Your AI Agent from Your Phone
Claude Code Dispatch lets you control your local Claude instance from Telegram or any messaging app. Here's how it works and how to set it up.
Remote Coding From Your Couch — What Claude Code Dispatch Actually Does
Imagine you’ve kicked off a complex refactoring task, closed your laptop, and walked away. Twenty minutes later you’re somewhere else and want to check progress — or redirect the agent entirely. That’s the problem Claude Code Dispatch solves.
Claude Code Dispatch is a relay layer that lets you control your local Claude Code instance from a messaging app like Telegram. Instead of being chained to your terminal, you get a remote interface on your phone. You can send instructions, monitor output, and manage long-running tasks from anywhere.
This article explains what Claude Code Dispatch is, how it works technically, and how to set it up — including the security considerations most guides skip over.
What Claude Code Is (and Why Remote Access Matters)
Claude Code is Anthropic’s terminal-based AI coding agent. Unlike a chat assistant, it doesn’t just generate code for you to paste. It reads files, executes commands, makes changes, verifies results, and iterates — more like a developer with terminal access than a text completion tool.
What makes Claude Code an agent, not a chatbot
When you give Claude Code a task — “refactor this module to use async/await” or “write tests for every function in this directory” — it plans the work, opens the relevant files, makes changes, and runs commands to check them. It operates autonomously through a sequence of steps you don’t have to manage one by one.
This is genuinely useful. It’s also why remote access becomes relevant.
The gap Dispatch fills
Claude Code tasks can take minutes, sometimes much longer. For anything non-trivial, you’re either waiting at your terminal or flying blind. Neither is great.
There’s no native mobile interface for Claude Code, no way to check in from your phone, and no built-in notification system. Dispatch fills that gap by creating a communication channel between your phone and the Claude Code process running on your machine.
What Claude Code Dispatch Actually Is
Claude Code Dispatch is not an official Anthropic product. It’s an open-source pattern — built by the developer community — that wraps Claude Code’s CLI with a relay server and connects it to a messaging app’s bot API.
The core mechanic is simple:
- A lightweight server runs on your local machine alongside Claude Code
- A Telegram bot (or similar) forwards your phone’s messages to that server
- The server pipes those messages into Claude Code
- Claude Code’s responses get sent back through the bot to your phone
Your phone becomes the UI. Your machine does the work. The relay server is just the bridge.
Where the name comes from
“Dispatch” comes from multi-agent systems terminology. You’re dispatching instructions to an agent that works independently — you don’t need to be present, and the agent doesn’t wait for you. Dispatch is the communication channel that keeps you in the loop without requiring you to be at a terminal.
As AI agents get longer context windows and take on longer-running tasks, this concept matters more. The ability to hand off work and check in asynchronously is the whole point of an autonomous agent.
How Claude Code Dispatch Works — The Technical Architecture
Understanding the architecture helps you debug it when things go wrong and make informed decisions about security.
The four components
A typical Dispatch setup involves:
- Claude Code — the Anthropic CLI tool installed on your local machine (
@anthropic-ai/claude-code) - The Dispatch server — a lightweight Node.js or Python process running locally that manages the Claude Code subprocess and handles message routing
- Telegram Bot API — routes messages between your phone and the Dispatch server
- Your phone — the Telegram client where you type commands and read responses
The Dispatch server is the piece you actually set up. It spawns Claude Code as a child process, listens for incoming messages from your bot, pipes them into Claude Code’s stdin, captures stdout, and sends responses back through the bot.
Message flow, step by step
When you send a message from your phone:
- You type a command in Telegram: “Add error handling to the authentication module”
- Telegram’s servers receive it and deliver it to the Dispatch server (via polling or a webhook)
- The Dispatch server passes the message text to the Claude Code subprocess
- Claude Code processes the request — reads files, makes changes, runs checks
- The Dispatch server captures the output and splits it into Telegram-sized chunks if needed
- You see the response on your phone
The loop takes as long as Claude Code needs. A simple question might come back in seconds. A large task might produce partial updates over several minutes.
Why this needs to run locally
Claude Code needs access to your actual codebase — your files, your environment, your installed dependencies. It can’t operate on a remote server without access to those things. That’s why Dispatch runs locally: the agent stays on your machine, and only the communication layer is remote.
How to Set Up Claude Code Dispatch with Telegram
Here’s a practical walkthrough. Exact steps vary depending on which community implementation you use, but the pattern is consistent across all of them.
Prerequisites
Before starting, make sure you have:
- Claude Code installed and authenticated — run
npm install -g @anthropic-ai/claude-codeand complete the login flow with your Anthropic API key - Node.js 18+ — required by most Dispatch implementations
- A Telegram account — and access to BotFather to create a bot
- Your Telegram user ID — a numeric string you’ll use for the security whitelist
Step 1: Create your Telegram bot
Open Telegram, search for @BotFather, and start a conversation. Send /newbot, follow the prompts to name your bot, and you’ll receive a bot token:
123456789:ABCDefGhIJKlmNoPQRsTUVwxyZ
Keep this token private. It’s the credential that controls your bot.
Step 2: Find your Telegram user ID
Start a conversation with a utility bot like @userinfobot. It will return your account’s numeric user ID. Write it down — this is what the Dispatch server uses to verify that incoming messages are from you.
Step 3: Clone and configure Dispatch
Download the Dispatch implementation from GitHub. Most use a .env file or environment variables for configuration:
TELEGRAM_BOT_TOKEN=your_bot_token_here
ALLOWED_USER_IDS=your_numeric_user_id
CLAUDE_WORKING_DIRECTORY=/path/to/your/project
CLAUDE_WORKING_DIRECTORY tells Claude Code which directory to treat as the project root. Point it to the codebase you want the agent working in.
Step 4: Install dependencies and start the server
For a Node.js implementation:
npm install
npm start
For Python:
pip install -r requirements.txt
python dispatch.py
The server will start Claude Code as a subprocess and begin polling or listening for Telegram updates.
Step 5: Test the connection
Send your bot a simple message: “What files are in this directory?” Claude Code should respond through the bot within a few seconds. If it does, the loop is working.
Step 6: Keep it running in the background
For practical use, you’ll want the Dispatch server running even when your terminal is closed. Use a process manager like pm2:
npm install -g pm2
pm2 start dispatch.js --name claude-dispatch
pm2 save
pm2 startup
The pm2 startup command generates a system startup script so the server relaunches automatically after a reboot.
Security: What You Need to Know Before You Deploy This
This section is usually buried or omitted in setup guides. It matters.
What you’re actually exposing
Claude Code has access to read and write files in your working directory. It can also execute terminal commands. The Dispatch server gives an external channel access to that process. If someone can message your bot, they can instruct Claude Code to modify files or run commands on your machine.
That is not a small risk. Treat Dispatch accordingly.
Minimum safeguards
- User ID whitelist — only your Telegram user ID should be allowed to send commands. Every Dispatch implementation should support this. Enable it.
- Keep the bot token private — never commit it to a repository or share it. Rotate it via BotFather immediately if it’s compromised.
- Scope the working directory — point Claude Code at the specific project you’re working on, not your entire home directory.
- Run behind a firewall — don’t expose the Dispatch server port to the internet if you’re using webhook mode. Use polling instead for simpler local setups.
None of this is complicated, but skipping any of it turns a useful tool into a significant liability.
Practical Use Cases
Long-running refactoring tasks
You start a migration from one library to another. It might take Claude Code 30–60 minutes to work through the codebase. With Dispatch, you can check in from your phone, see what’s been changed, and redirect the agent if it’s going off track — without sitting at your desk.
Overnight coding sessions
Start a task before bed, review the results in the morning via Telegram. Claude Code runs overnight, and you wake up to a summary of what was built, what it got stuck on, and what it’s ready to show you.
Mobile code reviews
Claude Code proposes a change. You review the description on your phone, ask follow-up questions, request modifications, or approve the next step — all through the Telegram interface.
Monitoring autonomous agents
For longer-horizon tasks — “build out the user authentication flow” or “convert all PNG assets in this directory to WebP” — Dispatch lets you see progress without micromanaging the steps. You’re informed without being in the way.
Where MindStudio Fits Into Remote Agent Workflows
Claude Code Dispatch is purpose-built for one thing: giving Claude Code a phone-based interface. That’s useful, but it’s also narrow. It requires local infrastructure, handles only coding tasks, and doesn’t extend to other types of automated work.
If you’re thinking more broadly — how do I control AI agents remotely across many task types, not just code? — that’s where MindStudio’s webhook and API endpoint agents come in.
MindStudio lets you build AI agents that are remotely accessible by design. You create the agent once using the no-code visual builder, expose it as a webhook or API endpoint, and it’s immediately callable from any external source — a messaging app, a scheduled job, another service, or a manual trigger on your phone. No relay server to manage, no process supervisor to configure.
For teams already using Claude Code, there’s a more direct integration worth knowing about: the MindStudio Agent Skills Plugin. It’s an npm package (@mindstudio-ai/agent) that lets Claude Code call over 120 typed capabilities as simple method calls:
await agent.sendEmail({ to: "...", subject: "...", body: "..." })
await agent.searchGoogle({ query: "..." })
await agent.runWorkflow({ workflowId: "..." })
Claude Code handles the reasoning. MindStudio handles the tools, integrations, and infrastructure. That means Claude Code agents can trigger broader multi-agent workflows — send notifications, update databases, generate images, kick off pipelines — without any of that being built into the agent itself.
Where Dispatch gives Claude Code a phone interface, MindStudio gives it an action layer that extends well beyond the terminal.
You can try MindStudio free at mindstudio.ai.
Frequently Asked Questions
Is Claude Code Dispatch an official Anthropic product?
No. Dispatch is community-built. Anthropic makes Claude Code itself, but the relay infrastructure that connects it to Telegram or other messaging apps is maintained by individual developers and open-source contributors. There are multiple implementations on GitHub with varying feature sets and maintenance levels.
Does Claude Code Dispatch work with apps other than Telegram?
Telegram is the most common target because its Bot API is straightforward and well-documented, but the underlying pattern works with any platform that has a bot or messaging API. Slack, Discord, and WhatsApp (via Twilio) are all technically viable. The core relay architecture is the same — only the API integration changes.
Is it safe to run Claude Code Dispatch on my personal machine?
It can be, with proper configuration. The non-negotiables: whitelist your user ID, keep your bot token private, and scope Claude Code’s working directory to only what it needs access to. Running Dispatch without those safeguards is a meaningful security risk, since Claude Code can read, write, and execute commands in whatever directory you’ve pointed it at.
What’s the difference between Claude Code and Claude Code Dispatch?
Claude Code is the AI agent — it does the reasoning, reads files, writes code, and runs commands. Dispatch is purely the communication layer. It adds remote access that Claude Code doesn’t have by default. Think of Claude Code as the worker and Dispatch as the walkie-talkie.
Can Claude Code Dispatch handle multiple users at once?
Basic implementations are designed for a single user against a single Claude Code instance. Multiple simultaneous users cause problems because Claude Code maintains a single conversation context — concurrent messages will conflict. For multi-user setups, you’d need session management, and at that point you’re better served by a platform designed for that use case.
How reliable is Dispatch for production workflows?
It’s a developer tool, not a production system. Dispatch is best for personal productivity — managing your own coding work remotely. If you need reliability, observability, and multi-step automation running in production, a purpose-built platform is a better investment than a community relay script running on a local machine.
Key Takeaways
- Claude Code Dispatch is a community-built relay that connects your local Claude Code instance to a messaging app, giving you a phone-based interface for your AI coding agent.
- The architecture is simple: a local server bridges the Telegram Bot API to Claude Code’s CLI, creating a two-way communication loop.
- Setup involves Claude Code, a Telegram bot token, and a Dispatch server — typically a 20–30 minute process.
- Security is your responsibility: whitelist your user ID, protect your bot token, and scope the working directory carefully.
- For broader remote agent workflows — spanning multiple tool types, not just coding — MindStudio offers webhook and API-based agents that are remotely accessible without the local infrastructure overhead.