Skip to content

Repository files navigation

relay

A persistent AI assistant — text your agent on Telegram, it works in your codebase.

relay is a lightweight C daemon that routes Telegram messages to Claude Code (or Gemini, or OpenAI Codex) running on your machine. Configure workspaces, switch between them like browser tabs, and your agent picks up exactly where you left off.

No cloud infrastructure. No web UI. Just a process on your machine and your Telegram app.

Architecture notes — why C, how the agent bus works, the trade-offs I took. → Seven days, 194 tasks, one daemon — retrospective on how do-work built relay in a week.


Quick Start

git clone git@github.com:rawphp/relay.git
cd relay
./install.sh

The installer asks for a name, your Telegram credentials, and your first workspace. It builds the daemon, creates the runtime directory, and writes your config. Done in under two minutes.

Full installation guide


How It Works

You (Telegram) → relay daemon → Claude Code subprocess → You (Telegram)

Send a message. The daemon routes it to Claude Code in your active workspace, streams the response back to Telegram, and saves the session so the conversation continues next time.


Features

Multi-workspaceConfigure any number of project directories and switch between them from Telegram
Per-workspace providersUse Claude for one project, Codex for another, Gemini for a third
Persistent sessionsConversations survive daemon restarts — picks up where you left off
Identity filesGive your agent a personality, goals, and memory that persist across sessions
Memory systemOptional semantic search over past conversations — relevant context injected automatically
Agent busAgents discover each other automatically, exchange messages, and persist offline messages — with human observer notifications
No cloudRuns entirely on your machine — only outbound connections are to Telegram and your LLM

Telegram Commands

Telegram commands

CommandDescription
/startGet started
/helpShow available commands
/statusShow daemon and memory status
/restartRestart the daemon
/clearStart a new conversation
/closeClose the active space
/space <name>Switch space
/spacesList all spaces
/session <number>Select session from listing
/sessionsBrowse resumable sessions
/workspaceShow current workspace info
/reloadReload config without restart
/busShow recent agent bus activity

Requirements

  • macOS or Linux
  • Xcode Command Line Tools or gcc
  • curl
  • At least one LLM CLI, installed and authenticated:
  • A Telegram bot token — @BotFather
  • Your Telegram user ID — @userinfobot

Documentation

Installation & ConfigurationPrerequisites, install.sh, relay.conf reference
OperationsCLI commands, updating, multi-agent setup
Identity FilesCustomizing your agent's personality and memory
ArchitectureHow the daemon works internally
Development GuideBuilding, testing, and extending relay

Updating

cd relay
git pull
./update.sh

Rebuilds the binary, redeploys to all registered agents, restarts. Config, identity files, sessions, and transcripts are never touched.


License

MIT

About

Text your AI agent on Telegram and it works in your codebase

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages