[etm]
module 08v1.0· updated 2026-04-19

Autonomous Agent on Telegram

Wire a Claude Code agent to a Telegram bot — it runs while you sleep

01 / 07

See it work

Placeholder — real preview will be a screen recording of an agent replying in Telegram in real time.

02 / 07

Is this for me?

Yes, if you want an AI agent that runs 24/7, listens to your Telegram, and does work on its own — intel scans, content drafts, code commits, whatever you tell it. Once set up, you message it like a person. It replies like a person. Except it never sleeps.

03 / 07

What you need

  • A Mac or PC
  • Claude Code installed — Anthropic Pro or Max plan recommended, agents need long sessions (Module 01 walks you through install)
  • A Telegram account
  • 30 minutes of quiet setup time
  • A project that would benefit from an autonomous helper (examples inside)
time · 30 minutes first-time setup. Spawning additional agents after takes 5 min.coding · no

You'll paste commands but never write code. If 'terminal' scares you, finish module 01 first — it has a gentler terminal intro.

04 / 07

Do it

  1. step 1 / 6

    Install the framework

    Generate install command below → copy → Terminal → enter. The kit lands in ~/.claude/skills/autonomous-agent-telegram/ and includes the bus scripts (send, receive, restart), the fast-checker daemon, a minimal agent config template, and a launchd plist for always-on operation.

  2. step 2 / 6

    Create a Telegram bot with @BotFather

    Open Telegram. Search for @BotFather. Send /newbot. Give it a name + username. BotFather returns a bot token (looks like 8309826713:AAE...). Save this — you'll paste it next step.

    Also grab your personal chat ID: message @userinfobot and send anything — it replies with your numeric ID.

  3. step 3 / 6

    Name your agent + wire the token

    In Claude Code, type:

    Use autonomous-agent-telegram to scaffold a new agent called [pick-a-name] for project [pick-a-project]
    

    Example: scaffold a new agent called 'scout' for project 'my-newsletter'. The skill creates a folder, writes the CLAUDE.md instructions file, and prompts you for the bot token + chat ID. Paste them. Done.

  4. step 4 / 6

    Start the fast-checker daemon

    This is the piece that makes the agent LIVE. The daemon polls Telegram every few seconds for new messages and funnels them into the agent's running session:

    bash ~/.claude/skills/autonomous-agent-telegram/scripts/start-daemon.sh [your-agent-name]
    

    You'll see a console tail. Leave it running in a terminal window (or install the launchd plist to auto-start at login — instructions in the skill's README).

  5. step 5 / 6

    Talk to your agent

    Open Telegram. Find your bot (the username you gave BotFather). Send a message: hey scout, what's up? Within 1-5 seconds, your agent responds. It has context of its project via the CLAUDE.md file. Talk to it like a person.

    Try: summarize my latest git commits, pull the top 10 tweets from my X feed and tell me what matters, build me a landing page for [topic] and commit when done.

  6. step 6 / 6

    Give it crons (optional, transforms the agent from reactive to proactive)

    Edit ~/your-project/agent-name/config.json → add a crons array:

    "crons": [
      { "name": "morning-digest", "interval": "0 7 * * *", "prompt": "Scan my X feed, send me the top 5 signals by 7:15." },
      { "name": "daily-build", "interval": "0 14 * * *", "prompt": "Pick the next task from TASKS.md, build it, commit, ping me." }
    ]
    

    Save. The agent auto-schedules at every fire. Now it's not just reactive — it initiates.

05 / 07

Make it yours

Adapt it to your own workflow
  • Newsletter writer? Agent scans industry news daily, pulls top 5 signals, drafts a newsletter section you review+polish. Cuts 2 hours off your weekly writing.
  • Indie hacker? Agent auto-commits small fixes from your TODO.md on a cron, pings you on Telegram with the diff. Sleep-shipping.
  • Creator? Agent drafts 3 content ideas every morning based on yesterday's trending tweets. You pick one, it's executed by another agent (see module 12 — the build loop).
  • Agency operator? One agent per client — each has its own CLAUDE.md with the client's brand voice + constraints. They handle routine Q&A + first drafts in the client's own Telegram.
06 / 07

Stuck?

  • Bot doesn't respond when I message it.

    Daemon isn't running. `bash ~/.claude/skills/autonomous-agent-telegram/scripts/start-daemon.sh [agent-name]` in a terminal. Leave the window open. If you want always-on, load the launchd plist from the skill's README.

  • Agent responds but context-drifts — forgets what project it's on.

    You didn't fill out the CLAUDE.md properly. Open it and write a clear 'who you are / what you work on / what's the priority' — 10 lines is enough. Agents without a clear CLAUDE.md wander.

  • Token exposed in a public repo.

    Rotate immediately. Go to @BotFather → `/revoke` → old token is dead, generate new one. The `.env` files with tokens should be in `.gitignore` from the start. Never check tokens into git.

  • Crons fire at weird times / not at all.

    Session-scoped crons only fire while the agent's session is open. For true always-on scheduling, use the bundled launchd plist (Mac) or crontab setup — both covered in the skill's README.

  • Agent uses too many Claude credits.

    Claude Pro plan has daily caps. For long-running agents use Max plan OR install RTK (Rust Token Killer — search GitHub for `rust-token-killer`) as a CLI proxy — 60-90% token reduction on common commands. Max plan + RTK = near-unlimited agent runtime.

💰 money moves that use this

all money moves →
07 / 07

Next up

module 010
Telegram Bot Orchestration

Now that one agent works, the next module is the BOT LAYER on its own — how to wire messages, reactions, webhooks, agent-to-agent talk without a framework. Smaller surface, still useful for anyone building any Telegram bot project.

open module →