Updating Production Code via Telegram
If you think OpenClaw is too complex for your needs and just want a straightforward way to update or fix your code using Telegram, there's a simpler alternative. An open source...
If you think OpenClaw is too complex for your needs and just want a straightforward way to update or fix your code using Telegram, there's a simpler alternative. An open-source project called Claude Code Telegram by Richard Atkinson allows you to send instructions over Telegram to your server running Claude Code.
This setup is minimal: no complex orchestration, no dashboards, and no exposed control planes to worry about. Just a direct path from you to Telegram, then to your server, and finally to your code.
Here's how to set it up on a DigitalOcean Droplet.
Create a DigitalOcean Droplet
First, you'll need to create a DigitalOcean Droplet. If you don't have a server yet, a basic Ubuntu droplet will do.
In the DigitalOcean control panel:
- Click Create → Droplets
- Choose Ubuntu (any latest LTS version will work)
- Select a basic plan (the smallest size is fine for testing)
- Choose your region
- Add your SSH key if available
- Click Create Droplet
Once your droplet is ready, connect to it via SSH with:
ssh root@your_droplet_ip
Replace your_droplet_ip with the IP address provided after creating the droplet. If you encounter an error, wait a couple of minutes and try again.
Configuring Your Droplet
After setting up your droplet, configure it to handle the necessary dependencies and services to allow message sending over Telegram to Claude Code.
Step 1. Update Package Lists
sudo apt update
Step 2. Install Zsh
sudo apt install zsh -y
Step 3. Install Essential Build Tools
sudo apt install build-essential procps curl file git -y
Step 4. Install GitHub CLI
sudo apt install gh
Authenticate the GitHub CLI by running:
gh auth login
Follow the prompts, selecting GitHub.com, choosing HTTPS, and using a generated token with repo and read:org permissions.
Step 5. Install Oh My Zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
Step 6. Install Python Dependencies
sudo apt install -y curl python3-venv python3-pip
Step 7. Generate an SSH Deploy Key
ssh-keygen -t ed25519 -C "do-droplet-deploy-key" -f ~/.ssh/github_deploy_key
Step 8. Add the Public Key to GitHub
Fetch your public key with:
cat ~/.ssh/github_deploy_key.pub
Copy and add it to GitHub under SSH and GPG keys.
Step 9. Configure SSH to Use the Key
cat >> ~/.ssh/config <<'EOF'
Host github.com
HostName github.com
User git
IdentityFile ~/.ssh/github_deploy_key
IdentitiesOnly yes
EOF
Step 10. Lock Down SSH Config Permissions
chmod 600 ~/.ssh/config
Step 11. Pre-Register GitHub’s Host Identity
ssh-keyscan -H github.com >> ~/.ssh/known_hosts
Step 12. Set known_hosts Permissions
chmod 644 ~/.ssh/known_hosts
Step 13. Install Poetry
curl -sSL https://install.python-poetry.org | python3 -
Step 14. Add Poetry to Your PATH
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
Step 15. Verify Poetry Installation
poetry --version
Install Claude Code
Step 1. Install Claude Code
curl -fsSL https://claude.ai/install.sh | bash
Step 2. Set Your Anthropic API Key
nano ~/.zshrc
Add the following line with your API key:
export ANTHROPIC_API_KEY="sk-..."
Reload:
source ~/.zshrc
Step 3. Clone Claude Code Telegram
git clone git@github.com:RichardAtCT/claude-code-telegram.git
cd claude-code-telegram
Step 4. Install Bot Dependencies
make dev
Ignore any warnings about pre-commit not being configured.
Set Up Telegram
Step 1. Create a Telegram Bot
In Telegram:
- Message @BotFather
- Run
/newbot - Choose a name ending with
bot - Save the token
Step 2. Configure the Bot
mkdir /root/projects
cp .env.example .env
nano .env
Populate the .env file with:
TELEGRAM_BOT_TOKEN=<your token>
TELEGRAM_BOT_USERNAME=<your bot username>
APPROVED_DIRECTORY=/root/projects
ALLOWED_USERS=<your Telegram user ID>
USE_SDK=true
Step 3. Run the Bot
For the first run, use debug mode:
make run-debug
For normal operation, use:
make run
Conclusion
With this setup, you can send commands via Telegram like: "Let’s remove the about link from the header nav on the repository." Claude Code will then process the request locally on your server, make the necessary changes, and send a response back over Telegram. This approach offers a simple and effective way to manage code without the complexity of more extensive frameworks.