explaingit

lozzkappa/claude-code-telegram-bot

Analysis updated 2026-05-18

3Audience · developerComplexity · 4/5Setup · hard

TLDR

A setup guide and file-based workaround for a Claude Code bug that silently drops incoming Telegram messages sent to its bot plugin.

Mindmap

mindmap
  root((repo))
    What it does
      Fixes Telegram plugin bug
      File based inbox
      tmux message injection
    Tech stack
      Claude Code CLI
      bun
      tmux
      bash
    Use cases
      Run Claude as Telegram bot
      Work around notification bug
      Restart on stalled sessions
    Audience
      Developers
      Claude Code users
    Setup
      Needs Linux server
      Needs Telegram bot token
    Notes
      Zero token idle cost
      Includes watchdog restart

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Get Claude Code responding reliably to Telegram messages despite the plugin's notification bug.

USE CASE 2

Run a persistent Claude Code Telegram bot on a home server or Raspberry Pi.

USE CASE 3

Add a typing indicator and stall watchdog to a self-hosted Claude Code bot.

USE CASE 4

Learn how to patch the official Telegram plugin's server code.

What is it built with?

Claude Code CLIbuntmuxbashTypeScript

How does it compare?

lozzkappa/claude-code-telegram-bot0marildo/imagoabdurrafey237/rag-chatbot
Stars333
LanguagePythonJupyter Notebook
Setup difficultyhardeasymoderate
Complexity4/52/53/5
Audiencedevelopergeneralgeneral

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · hard Time to first run · 1h+

Requires manually patching plugin source code and a Linux server with tmux and bun installed.

The README does not state license terms in the shown portion.

In plain English

This repository is a setup guide and workaround, not a standalone app, for running Claude Code as a Telegram bot. The author found that a specific version range of Claude Code has a confirmed bug: when the official Telegram plugin is installed and Claude Code is launched with channel support, incoming Telegram messages are received by the plugin's server but silently dropped by Claude Code itself, even though the bot can still send replies. As of the time this README was written, there was no official fix. The workaround swaps out the broken notification path for a simple file based system. The Telegram plugin's server script is patched to write every incoming message to a local inbox file, in addition to sending the notification that Claude Code normally ignores. A separate bash script then polls that file every 5 seconds, and when it finds new messages while Claude is idle, it types a short instruction directly into Claude's terminal session using tmux, telling it to check and reply to the Telegram inbox. Claude then reads the file, replies through Telegram, and clears it. This entire polling loop runs in plain bash, so it uses no AI tokens while waiting, and the README reports response times of about five to nine seconds. An optional cron job exists as a last resort fallback but is disabled by default since the watcher handles things on its own. Setting it up requires a Linux server, the Claude Code CLI, the bun JavaScript runtime the Telegram plugin depends on, a bot token from Telegram's BotFather, and tmux for running Claude in a persistent terminal session. The guide walks through installing the plugin, creating a credentials file and an access control list restricting who can message the bot, editing the Claude configuration file to register the plugin as an MCP server, and directly patching the plugin's server code to add the inbox workaround and a persistent typing indicator so users see "typing" for the whole time Claude is working. A launch script starts everything inside a tmux session with the right environment variables and includes a watchdog that restarts the session if the inbox is not cleared within five minutes, guarding against Claude getting stuck or running out of context.

Copy-paste prompts

Prompt 1
Walk me through patching the Telegram plugin's server.ts with the inbox workaround from this guide.
Prompt 2
Help me write the run-bot.sh launch script for a Claude Code Telegram bot using tmux.
Prompt 3
Explain how the inbox watcher and watchdog restart logic work together in this setup.
Prompt 4
Show me how to configure the access.json allowlist so only I can message my Claude Code bot.

Frequently asked questions

What is claude-code-telegram-bot?

A setup guide and file-based workaround for a Claude Code bug that silently drops incoming Telegram messages sent to its bot plugin.

What license does claude-code-telegram-bot use?

The README does not state license terms in the shown portion.

How hard is claude-code-telegram-bot to set up?

Setup difficulty is rated hard, with roughly 1h+ to a first successful run.

Who is claude-code-telegram-bot for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.