Published: 2026-11-21
Summary
Summary
Claude Code on a VPS you message from Telegram: the official channel plugin, Bun and tmux, and a 400K auto-compact window
Chapters / key moments (click to jump — plays here on the page)
The idea: run Claude Code on a cloud server that never turns off, keep it open in tmux, and message it from your phone through a Telegram bot. The video uses a hosting provider's one-click image with Claude Code preinstalled, then connects Telegram with Anthropic's own channel plugin. The plugin steps below are checked against Anthropic's Channels documentation; the hosting steps are as shown in the video.
Source video
"How to Put Claude Code on a VPS in 10 Minutes" by Nate Herk — Watch on YouTube → The video is sponsored by the hosting provider (an affiliate link and a coupon code) and points to a setup doc in the creator's free community; nothing below depends on either. Captions spell Claude Code as "Cloud Code" and tmux as "T-Mox".
The setup, in order
- Get a VPS. The video picks a plan with Claude Code preinstalled, sets a root password (save it in a password manager), and turns on the host's free malware scanner. Any Linux VPS works if you install Claude Code yourself; the one-click image only saves that step.
- Open a terminal on it, over SSH or the host's web console, and run
claude. Log in with your subscription (the video uses a Team plan) and pick a permission mode. - Check the prerequisites. On the video's image tmux was installed and Bun was not, so Bun had to be installed. Anthropic's docs say every supported channel plugin requires Bun.
- Create the bot. In Telegram, message BotFather with
/newbot, give it a name and copy the access token. - Install the plugin inside Claude Code (checked against the docs):
Choose the user scope when asked, as the video does and the docs recommend. If the marketplace is missing, the docs give/plugin install telegram@claude-plugins-official /telegram:configure <token> /reload-plugins/plugin marketplace add anthropics/claude-plugins-official; if the plugin is missing,/plugin marketplace update claude-plugins-official. - Start Claude Code with the channel on, then DM your bot and press Start:
The docs note the bot can reply only while the channel is active. The video's fix when the plugin did not reload: exit withclaude --channels plugin:telegram@claude-plugins-official/exitand relaunch with the flag. - Keep it running. Claude Code runs inside tmux on the VPS. The video had Claude Code set up a background service so the channel comes back after a reboot, and tested a reboot; the exact service file is not shown.
- Compact earlier. Because a Telegram channel is one long-running session, the video sets auto-compaction to trigger at 400K tokens to stay out of "context rot" territory. Anthropic's environment-variable reference lists
CLAUDE_CODE_AUTO_COMPACT_WINDOW, which takes a token count of100000or more; suffixed values such as400kneed v2.1.304 or later:
The video quotes the default as about 960,000 tokens; we did not check that figure.export CLAUDE_CODE_AUTO_COMPACT_WINDOW=400000 - Bring your workspace. Clone your own repository (the creator's "AI operating system" of skills and projects) and copy over the
.envfile it needs.
Things the docs add that the video only hints at
- Team and Enterprise must switch channels on. The video warns about Team plans; the docs say an Owner enables channels under Organization settings > Claude Code > Channels, or an admin sets
channelsEnabledtotruein managed settings. Without it the MCP server still connects, but channel messages never arrive, and a startup warning says so. - Channels are a research preview. They need Anthropic authentication through claude.ai or a Console API key, and are not available on Amazon Bedrock, Google Cloud's Agent Platform or Microsoft Foundry.
Caveats
- A bot that can drive Claude Code on a server holding your repository and
.envis remote access to those secrets. Use a dedicated VPS, give Claude Code only the keys the job needs, and keep a permission mode that still asks before risky actions. - The video stores the VPS root password in the agent's own
.envso Claude can help later. That is convenient and also puts a server credential where any tool reading the file can see it. - The hosting plan, price and discount are the sponsor's; prices change.





