How to Use Claude Code in Telegram With Chatcode
Set up Claude Code with Chatcode’s browser terminal and Telegram layer on your own server, with clear host, relay, credential, and native-plugin trade-offs.
Chatcode provides a browser terminal and Telegram companion for coding-agent sessions running on a server you control. This guide sets up Claude Code and spells out the boundary that matters most: the repository and agent process stay on your host, but Chatcode’s control plane relays readable terminal traffic between that host, the browser, and Telegram.
If all you need is a Telegram bot for one live Claude session, Anthropic’s official Channels plugin is a simpler starting point. Use this workflow when the full browser terminal, persistent host, or support for several agents is part of the requirement.
What the setup contains
Browser / Telegram
↕
Chatcode control plane
↕ outbound TLS WebSocket
Your server + gateway
↕
Claude Code session
The gateway does not need an inbound port for normal Chatcode traffic. It starts agent sessions on the connected machine and maintains an outbound connection to the control plane. SSH is still worth keeping as a separate administrative and recovery path.
1. Choose the host
There are two common choices:
- An always-on Linux server. Connect an existing VPS, or use the DigitalOcean flow to provision one.
- A Mac you already use. This avoids another server, but availability follows the Mac’s power, network, and login state.
Linux installation creates a dedicated vibe user and uses
/home/vibe/workspace. On macOS the gateway runs as your current user and uses
~/workspace, so it inherits that user’s file permissions. Read
how the gateway works before deciding which trust model suits
the host.
2. Connect the gateway
Sign in at app.chatcode.dev, add a server, and use the generated installation command. It contains a gateway identifier and authentication token, so do not paste it into a public issue, chat, or shell recording.
The installer configures the gateway as a background service. Once it appears online in the app, verify the host and workspace path before opening an agent session.
3. Open a workspace and authenticate Claude Code
Choose a project directory under the configured workspace root, create a session, and select Claude Code. Complete Claude’s own authentication on the host terminal just as you would outside Chatcode.
Keep credentials scoped to the work:
- use a project-specific repository token where possible;
- avoid placing production secrets in the gateway user’s home directory;
- begin on a branch or worktree that can be reviewed and discarded;
- choose the session sandbox setting before asking for broad command execution.
On Linux, the gateway user has a documented unattended-administration model.
On macOS, optional passwordless sudo and system privacy prompts need separate
consideration. The gateway documentation covers those details.
4. Link Telegram
Link the Telegram account from Chatcode, then open the Mini App or a linked session chat. Use a harmless read-only prompt first and confirm that it reaches the same session shown in the browser.
The surfaces have different jobs:
- Browser: full terminal interaction, commands, rich output, and session administration.
- Telegram: continuity, notifications, compact interaction, and supported file or session views.
Keeping that distinction avoids expecting a Telegram message thread to behave like a complete terminal transcript.
5. Test persistence and recovery
Before relying on the setup away from a desk:
- Start a non-destructive task in the browser.
- Close the browser and confirm the server-side session continues.
- Follow the update from Telegram.
- Reopen the browser and verify that it is the same session.
- Test SSH access and locate gateway logs so you have a recovery route.
An always-on server improves availability, but it also increases the time an agent and its credentials are reachable. Patch the host, monitor disk usage, and remove abandoned workspaces and credentials.
Native Channels or Chatcode?
| Claude Code Channels | Chatcode | |
|---|---|---|
| Primary interface | Telegram | Browser terminal plus Telegram |
| Host process | Claude Code with plugin enabled | Gateway service and agent session |
| Permission prompts | Supported prompts can be relayed to Telegram | Managed through the agent terminal and session safety settings |
| Agents | Claude Code | Claude Code, Codex, Gemini, and OpenCode |
| Trust dependencies | Anthropic plugin and Telegram | Chatcode gateway/control plane and Telegram |
| Best fit | One running Claude session in Telegram | Persistent terminal workflow across devices or agents |
Channels is official, narrower, and requires fewer moving parts. Chatcode offers a broader interface but adds a control plane that can read relayed terminal content. Choose based on the interface and trust model, not on an assumption that managed automatically means safer.
For the native path, use How to Connect Claude Code to Telegram.
Frequently asked questions
Does Chatcode require a VPS?
No. You can connect a supported Linux server or Mac you already own. A VPS is useful when the session must remain available while your personal computer is asleep.
Is Telegram the full terminal interface?
No. The browser is the primary terminal. Telegram provides linked views, notifications, file previews, and continuity around the same server-side session.
Can I use the official Claude Code Telegram plugin instead?
Yes. Use Anthropic’s official Channels plugin when you only need Telegram access to a running Claude session. Chatcode is more relevant when you also need a browser terminal, an always-on managed host, or several coding agents.
Can Chatcode read terminal traffic?
Yes. Connections are TLS-encrypted per hop, but the Chatcode control plane is a trusted relay rather than an end-to-end encrypted pipe. It processes terminal content for Telegram formatting, previews, transcription, and notifications.