telegram-setup

An interactive command for connecting PACT notifications to Telegram, a messaging service. It guides you through creating a Telegram bot and configuring the notification bridge.

In plain words
What is it for?
Use it to check an existing Telegram setup, configure one from scratch, reconfigure it, or send a test notification.
Why use it?
It avoids having to manually assemble the bot setup and configuration steps, while keeping bot tokens and API keys out of displayed tool output.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/synaptic-labs-ai/pact-plugin/telegram-setup
Clone the repo
git clone --depth 1 https://github.com/Synaptic-Labs-AI/PACT-Plugin
Per session 7 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,859 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 2 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00007 $0.01859
Opus 5 $0.00003 $0.00929
Sonnet 5 $0.00001 $0.00372
Haiku 4.5 $0.00001 $0.00186

Measured 2d ago against content hash 261ad402c771, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

telegram-setup scanned grade B with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

chmod 600 ~/.claude/pact-telegram/.env # matches a default-root pin in code — do not migrate

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

**Security**: NEVER echo, log, or display bot tokens or API keys in any tool output. Store values in variables only. All curl commands must use `-s` (silent mode).
pact-plugin/commands/telegram-setup.md · 155 lines

How it starts

The opening of the file, as written. The whole thing — 155 lines — stays where its author put it; the contents beside it link to each section on GitHub.

pact-telegram Setup

Walk the user through configuring the pact-telegram bridge. This is an interactive setup -- use AskUserQuestion at each step and Bash for automation.

Security: NEVER echo, log, or display bot tokens or API keys in any tool output. Store values in variables only. All curl commands must use -s (silent mode).


Step 1: Check Existing Configuration

Check if ~/.claude/pact-telegram/.env (matches a default-root pin in code — do not migrate) already exists:

test -f ~/.claude/pact-telegram/.env && echo "EXISTS" || echo "MISSING"  # matches a default-root pin in code — do not migrate
  • If EXISTS: Tell the user "pact-telegram is already configured." Use AskUserQuestion to ask: "Would you like to (A) reconfigure from scratch, (B) test the existing setup, or (C) cancel?"
    • A: Continue to Step 2 (will overwrite existing config)
    • B: Skip to Step 9 (send test notification)
    • C: Stop -- tell user setup cancelled
  • If MISSING: Continue to Step 2.

Step 2: Create a Telegram Bot

  1. Tell the user: "Open Telegram and message @BotFather. Send /newbot, follow the prompts to name your bot, then paste the bot token here. It looks like 123456789:ABCdefGHIjklMNOpqrsTUVwxyz_0123456."
  2. Use AskUserQuestion to collect the bot token.
  3. Store the token -- do NOT echo or log it.

Step 3: Validate Token Format

Validate the token matches the pattern \d+:[A-Za-z0-9_-]{35}:

echo "$TOKEN" | grep -qE '^\d+:[A-Za-z0-9_-]{35}$'
  • If valid: Continue to Step 4.
  • If invalid: Tell the user the format looks wrong and ask them to paste it again (AskUserQuestion). Retry up to 2 more times, then give up with an error message.

Step 4: Detect Chat ID

  1. Tell the user: "Now send /start (or any message) to your new bot in Telegram. I will detect your chat ID automatically."
  2. Use AskUserQuestion to confirm the user has sent the message.
  3. Call the Telegram getUpdates API:
    curl -s "https://api.telegram.org/bot${TOKEN}/getUpdates"
    
  4. Parse the JSON response to extract result[0].message.chat.id.
  5. If no updates found, ask the user to send another message and retry (up to 3 attempts with a 3-second wait between each).
  6. Once detected, show the chat ID and ask the user to confirm: "Detected chat ID: {chat_id}. Is this correct?" (AskUserQuestion)

Read the full file on GitHub · 155 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 155 lines · 7 tokens per session scan B 261ad402c771

Subscribe to this mod's changes

telegram-setup is a command published in the GitHub repository Synaptic-Labs-AI/PACT-Plugin (71 stars, last pushed 2d ago), licensed MIT. It adds 7 tokens to every session and 1,859 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it B with 2 findings (asks for root, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.