Claude Code on your server,
from Telegram

Full server access from your phone. Bash, files, search, scheduled tasks — everything Claude Code can do, in a single Telegram chat. Send follow-ups mid-task and they're injected instantly — no waiting.

0
File — the entire bot
0
Dependencies — total
0
Setup to first message
terminal
$ git clone https://github.com/cogent42/cogent42.git
$ cd cogent42 && node setup.js

Requires Node.js 18+, a Telegram bot token, and a Claude Code subscription

Why cogent42

The anti-platform.

OpenClaw has 247k GitHub stars and 17,000+ open issues. It supports 20+ channels, dozens of models, a plugin marketplace, and YAML configs you'll spend an afternoon debugging.

cogent42 is the opposite. One file. One user. One server. One chat. It does exactly one thing — puts Claude Code in your Telegram — and does it without breaking.

Single file, not a framework

The entire bot is one file. No plugin system, no adapters, no abstractions. Audit every line in one sitting.

Three deps, not thirty

telegraf, claude-agent-sdk, dotenv. That's it. Fewer dependencies means fewer things that break on update.

Your server, not a service

Runs on your machine, uses your Claude Code subscription. No middleman, no API keys, no per-token billing.

Powerful features, zero config

Auto-escalation, knowledge extraction, scheduled tasks, progress streaming — five env vars and you're done.

cogent42 vs OpenClaw

Complexity is the enemy of reliability.

Codebase 1 file Large monorepo
Lines of code ~1,400 100,000+
Dependencies 3 Dozens
Config 5 env vars YAML + JSON
Setup time 2 minutes 15–30 minutes
Setup command node setup.js Multi-step install
Open issues < 10 17,000+
By design

What we left out (on purpose).

Plugin system

Plugins mean version conflicts and security surface area. One file you control completely.

Web UI

Your Telegram app IS the UI. Already on your phone, already encrypted, already has notifications.

Multi-model

Claude Code is the best coding agent. Why add a router to pick between worse options?

Multi-channel

One channel means one thing to debug. A direct, private line to your server.

Database

State lives in flat JSON files. No migrations, no schemas. cat is your DB viewer.

Docker

Clone, run setup, done. No containers, no compose files. Node.js is all you need.

Philosophy

Fewer parts, fewer failures.

OpenClaw's 17,000+ open issues aren't an anomaly — they're the natural cost of complexity. Every plugin, adapter, and config layer is another thing that can break.

cogent42 has one file. You can read every line. There are no plugin version conflicts because there are no plugins. There are no config parsing errors because there are five environment variables.

Fewer moving parts. Fewer failure modes. That's the whole thesis.

Capabilities

What you get.

Full server access

Bash, file read/write/edit, code search. Everything Claude Code can do, from your phone.

Mid-task injection

Send follow-ups while the bot is working. Short messages auto-inject with ⚡. Longer ones give you inject/queue buttons.

Persistent memory

Facts and decisions extracted into a knowledge base that carries across conversations.

Scheduled tasks

Plain English scheduling. No cron syntax.

Smart model routing

Sonnet by default. Auto-escalates to Opus when needed.

Live progress

Real-time tool calls and status updates as Claude works.

One-command updates

Type /update in Telegram. Latest version, safe restart.

Your existing plan

Uses your Claude Code subscription. No extra API keys.

Single-user lock

Locked to your Telegram ID. Others silently rejected.

Photos & documents

Send images and files. Screenshot debugging, document analysis.

Getting started

Three steps. Two minutes.

1

Get your tokens

Create a bot via @BotFather on Telegram. Have your Claude Code subscription ready.

2

Run the setup

node setup.js installs dependencies, authenticates, configures the bot, and optionally sets up PM2.

3

Message your bot

Open Telegram, send a message. Claude executes on your server and replies with live progress.

Reference

Commands.

/startWelcome message and command reference
/resetExtract knowledge, archive session, start fresh
/cancelAbort the current in-flight query
/scheduleSchedule a recurring task in plain English
/schedulesView and manage scheduled tasks
/unscheduleRemove a scheduled task by ID
/statusVersion, uptime, disk, memory, model, schedules
/historySession statistics
/opusSwitch to Claude Opus 4.6
/sonnetSwitch to Claude Sonnet 4.6
/knowledgeView all stored knowledge entries
/updateUpdate bot to latest version and restart
Setup

Configuration.

TELEGRAM_BOT_TOKEN required
Bot token from @BotFather
TELEGRAM_USER_ID required
Your Telegram user ID from @userinfobot
MAX_TURNS optional
Max agentic turns per query. Default: 25
WORKING_DIRECTORY optional
Directory where Claude operates. Default: ~
BOT_NAME optional
Display name for your bot. Default: cogent42
BOT_PERSONALITY optional
Personality prompt (e.g. "concise and direct")
Security note

cogent42 runs with bypassPermissions mode, giving Claude unrestricted access to your server — bash, filesystem, everything. Only run this on machines you're comfortable giving full access to. The bot is locked to a single Telegram user ID; unauthorized users are silently rejected.