A sidekick to Claude Code, reachable over Telegram, on your own server.
Message a bot from your phone and it runs a Claude Code session on your machine,
then replies. Send a voice note and it's transcribed; ask for a file and it comes
back; start a long job and it pings you when it's done. It's one bot.py
and a few small scripts — worth reading before you run it.
It's a sidekick, not a replacement. The heavy lifting still happens in Claude Code at the desk — that's where most of the work actually gets done. This is for the in-between moments: firing off a task from your phone, nudging something along, or a quick question or fix when you're away from the keyboard.
ALLOWED_USER_IDS setting — your Telegram ID, and no one else's — is
what keeps that door shut. Run it somewhere you're happy to give an agent that much
room, and read bot.py first.
Open Claude Code on the server you want to run it on, and paste this:
Install ayu-bot on this server: fetch https://ayubot.xyz/ayu-bot/install.txt and follow it, asking me for any tokens it needs.
It downloads the code, shows you what it's about to run, sets up a virtual environment, and walks you through making your bot — pausing to ask for your Telegram token and user ID along the way. When it's finished, you message your bot and it answers.
which claude should print a path). ayu-bot just drives it./newbot, copy the token.tar xzf ayu-bot.tar.gz && cd ayu-bot
python3 -m venv .venv
.venv/bin/pip install -r requirements.txt
cp .env.example .env.env — set TELEGRAM_BOT_TOKEN, ALLOWED_USER_IDS
(your id only) and CLAUDE_CODE_PATH (from which claude)../run.shUse a process manager so it survives reboots and crashes:
pm2 start run.sh --name ayu-bot
pm2 saveA systemd unit example is in the README.md inside the tarball.
Everything lives in .env:
| Key | Notes |
|---|---|
TELEGRAM_BOT_TOKEN | from @BotFather |
ALLOWED_USER_IDS | your Telegram id(s), comma-separated — yours only |
CLAUDE_CODE_PATH | output of which claude |
CLAUDE_MODEL | optional — defaults to claude-opus-4-8; claude-sonnet-4-6 is cheaper |
OPENAI_API_KEY | optional — turns on voice-note transcription |