VS Code Telegram Bridge
Control your entire VS Code environment remotely from Telegram — AI agents, terminal, files, tunnels, and screenshots — even when your dev machine is on a completely different network.
Built for developers who run code on a remote machine, desktop, or WSL environment and want full control from their phone.
Why This Exists
You're on your phone. Your dev machine is at home on a different network. You want to:
- Check if Claude Code finished that refactor
- Run a quick terminal command
- See what's on screen
- Expose a local port to share with someone
- Send a new prompt to your AI agent
Without this extension, you'd need VPN, SSH, or RDP. With it — you just open Telegram.
How It Works
Your Phone (Telegram) ←→ Telegram Bot API ←→ VS Code Extension ←→ Your Machine
The extension runs a Telegram bot inside VS Code. Every command you send from Telegram gets executed on your machine — terminal commands, AI agent prompts, screenshots, ngrok tunnels — and the output is sent back to you instantly.
Features
🤖 AI Agent Control
| Command |
Description |
/start_agent |
Start a session with the active agent (Claude Code or Copilot) |
/send <message> |
Send a prompt to the active agent session |
/sessions |
List all running agent sessions with interactive buttons |
/kill |
Show all sessions as buttons — tap to kill |
/kill <id> |
Kill a specific session by ID |
/output |
Get the last 20 lines of output from the active session |
/agent claude |
Switch active agent to Claude Code |
/agent copilot |
Switch active agent to GitHub Copilot |
🔵 GitHub Copilot
| Command |
Description |
/copilot_open |
Open the Copilot Chat panel in VS Code |
/copilot_allow |
Approve a pending Copilot terminal permission request |
/copilot_deny |
Deny a pending Copilot terminal permission request |
💻 Terminal
| Command |
Description |
/run <command> |
Execute any shell command, get output back in Telegram |
/cwd |
Show the current working directory |
📁 Files & Workspace
| Command |
Description |
/file <path> |
Read a file and send its contents (inline or as document if large) |
/file <dir> |
List contents of a directory |
| Send any file to bot |
Saves the file directly to your workspace root |
/tabs |
List all open editor tabs |
/chats |
Show open chat panels (Copilot, Continue, Cline, etc.) and editor tabs |
/context |
Show the currently active file and selected text |
📸 Screenshot
| Command |
Description |
/screenshot |
Capture the full desktop and send as a photo |
🌐 Network Tunnels
| Command |
Description |
/ngrok <port> |
Create a public ngrok tunnel to a local port, get the URL |
/ngrok_stop |
Close the active tunnel |
/ngrok_info |
Show the current tunnel URL and port |
📊 Status
| Command |
Description |
/status |
Show bridge status, active agent, sessions, tunnel, workspace |
/help |
Show all available commands |
Installation
Step 1 — Download the Extension
- Go to the Releases page
- Download the latest
.vsix file (e.g. vscode-telegram-bridge-0.1.2.vsix)
Step 2 — Install in VS Code
Option A — Drag and drop
Drag the .vsix file into the VS Code window. It installs automatically.
Option B — Command Palette
- Open Command Palette (
Ctrl+Shift+P)
- Run Extensions: Install from VSIX...
- Select the downloaded
.vsix file
Option C — Terminal
code --install-extension vscode-telegram-bridge-0.1.2.vsix
Setup Guide
Step 1 — Create a Telegram Bot
- Open Telegram and search for @BotFather
- Send
/newbot
- Choose a name (e.g.
My Dev Bridge) and a username (e.g. mydev_bridge_bot)
- BotFather gives you a bot token — looks like
123456789:ABCdefGHI...
- Copy and save it
Step 2 — Get Your Chat ID
- Search for @userinfobot in Telegram
- Send it
/start
- It replies with your numeric Chat ID (e.g.
987654321)
- Copy it
Step 3 — Set Bot Commands (optional but recommended)
In BotFather, send /mybots → select your bot → Edit Bot → Edit Commands, then paste:
help - Show all commands
status - Bridge and agent status
start_agent - Start agent session
sessions - List all active sessions
send - Send message to active session
kill - Kill a session (shows buttons)
output - Last 20 lines from active session
agent - Switch active agent (claude/copilot)
screenshot - Take and send screenshot
run - Execute terminal command
cwd - Show working directory
file - Read file from workspace
chats - Open tabs and chat panels
tabs - List open editor tabs
context - Active editor file info
ngrok - Create ngrok tunnel
ngrok_stop - Close active tunnel
ngrok_info - Show current tunnel URL
copilot_allow - Approve Copilot terminal permission
copilot_deny - Deny Copilot terminal permission
copilot_open - Open Copilot Chat panel
This enables / autocomplete in the bot chat.
Open VS Code Settings (Ctrl+,) and search telegramBridge, or add directly to settings.json:
{
"telegramBridge.botToken": "YOUR_BOT_TOKEN",
"telegramBridge.allowedChatId": "YOUR_CHAT_ID",
"telegramBridge.autoStart": false,
"telegramBridge.claudeCodePath": "claude",
"telegramBridge.screenshotDelay": 500,
"telegramBridge.ngrokAuthtoken": "YOUR_NGROK_TOKEN"
}
| Setting |
Required |
Description |
botToken |
✅ |
Token from @BotFather |
allowedChatId |
✅ |
Your numeric Telegram Chat ID |
autoStart |
❌ |
Start bridge automatically when VS Code opens |
claudeCodePath |
❌ |
Path to claude CLI (default: claude) |
screenshotDelay |
❌ |
Milliseconds to wait before screenshot (default: 500) |
ngrokAuthtoken |
❌ |
Required only if you use /ngrok |
Step 5 — Start the Bridge
- Open Command Palette (
Ctrl+Shift+P) → Telegram Bridge: Start Bot
- Or set
autoStart: true to start on every VS Code launch
You'll receive this message in Telegram:
✅ VS Code Telegram Bridge connected! Type /help for all commands.
The status bar at the bottom right shows 📡 TG Bridge when running.
Agent Setup
Claude Code
Install and authenticate the Claude CLI:
npm install -g @anthropic-ai/claude-code
claude auth login
If claude isn't on your PATH, set the full path in settings:
"telegramBridge.claudeCodePath": "/home/youruser/.npm-global/bin/claude"
Then in Telegram:
/agent claude
/start_agent
/send Write a function to parse JSON safely
Output streams back to Telegram automatically as Claude responds.
GitHub Copilot
Make sure the GitHub Copilot Chat extension is installed in VS Code (GitHub.copilot-chat).
In Telegram:
/agent copilot
/start_agent
/send Refactor this function to use async/await
Terminal permissions: When Copilot wants to run terminal commands, VS Code shows a permission dialog. Use /copilot_allow from Telegram to approve it, or /screenshot to see the dialog then click manually.
ngrok Setup
ngrok requires a free account for all tunnels.
- Sign up at dashboard.ngrok.com/signup
- Get your authtoken from dashboard.ngrok.com/get-started/your-authtoken
- Add it to VS Code settings:
telegramBridge.ngrokAuthtoken
Then from Telegram:
/ngrok 3000
Response:
✅ Tunnel active!
🔗 https://abc123.ngrok.io
→ localhost:3000
File Operations
Read a file from your machine
/file src/index.ts
- Files under 10KB → sent inline as code block
- Files over 10KB → sent as downloadable document
Read a directory
/file src/components
Lists all files and folders.
Send a file to your machine
Just drop any file or photo into the Telegram chat with your bot. It gets saved to your workspace root automatically.
/sessions and /kill use Telegram inline keyboards — no need to copy-paste session IDs.
/sessions shows:
🟣 Claude Code [#1](https://github.com/joshuadaniel8090/vscode-telegram-bridge/issues/1) [✅ Active] [🗑 Kill]
🔵 Copilot Chat [▶ Set Active] [🗑 Kill]
/kill with no args shows:
🗑 Kill — 🟣 Claude Code [#1](https://github.com/joshuadaniel8090/vscode-telegram-bridge/issues/1) (active)
🗑 Kill — 🔵 Copilot Chat
❌ Cancel
Tap any button to act instantly.
WSL / Windows Notes
If VS Code runs on Windows but your terminal is WSL:
Security
This extension gives full remote access to your machine. Keep it safe:
- Chat ID whitelist — only your configured
allowedChatId is processed. All other senders are silently ignored, including other Telegram accounts.
- Never share your bot token — anyone with it can control your bridge.
- Private bot only — don't add the bot to groups or channels while the bridge is running.
- Bot token in settings — VS Code settings are stored locally. Don't commit
settings.json with your token to version control.
Building from Source
Only needed if you want to modify the extension. For regular use, download the .vsix from Releases.
git clone https://github.com/joshuadaniel-8090/vs-remote
cd vscode-telegram-bridge
npm install
npm run compile
npx @vscode/vsce package
This produces a .vsix file you can install as described above.
Development mode (live reload):
- Open the project folder in VS Code
- Add
.vscode/launch.json:
{
"version": "0.2.0",
"configurations": [
{
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"args": ["--extensionDevelopmentPath=${workspaceFolder}"],
"outFiles": ["${workspaceFolder}/out/**/*.js"],
"preLaunchTask": "${defaultBuildTask}"
}
]
}
- Press F5 — a second VS Code window opens with the extension loaded
- Configure settings in that window → start the bridge → test in Telegram
Changes: save → TypeScript recompiles (watch mode) → Ctrl+R in the Extension Host window.
Project Structure
vscode-telegram-bridge/
├── src/
│ ├── extension.ts Entry point — activation, commands, status bar
│ ├── bot.ts Telegram polling, auth guard, command router
│ ├── handlers.ts One handler function per command
│ ├── config.ts VS Code settings reader and validator
│ ├── logger.ts Timestamped logging to Output Channel
│ ├── ngrok.ts ngrok tunnel lifecycle
│ ├── screenshot.ts Desktop capture utility
│ ├── terminal.ts Shell command executor with output streaming
│ └── agents/
│ ├── claudeCode.ts Claude CLI subprocess manager
│ ├── copilot.ts VS Code Copilot Chat command wrappers
│ └── sessionManager.ts Unified session registry for all agents
├── out/ Compiled JavaScript (generated)
├── package.json
├── tsconfig.json
└── README.md
Roadmap
- [ ] Git commands —
/git status, /git log, /git push, /git diff
- [ ] Scheduled commands —
/schedule <cron> <command>
- [ ] File change watchers — notify on save, build output, log tails
- [ ] More agent adapters — Aider, Gemini CLI, Continue, Cline, Roo Code
- [ ] Multi-agent fan-out — send same prompt to all agents, compare responses
- [ ] Token and cost tracking per agent session
- [ ] Inline confirm/reject buttons for destructive operations
- [ ] Activity bar panel with live bridge status
License
MIT — see LICENSE