Agent2Telegram AGENTS.md

Agent2Telegram AGENTS.md is an instructions file for Codex, OpenCode from petrludwig-collab/Agent2Telegram. It costs 1,286 tokens per session, scanned B, original, MIT.

An installation guide for Agent2Telegram, a bridge that lets a user talk to an AI coding agent through Telegram. It covers setup, security rules, prerequisites, verification, and questions the agent must ask the user.

In plain words
What is it for?
Use it to check prerequisites, install and configure Agent2Telegram, handle required user decisions, and confirm that the Telegram connection works.
Why use it?
It removes guesswork from setting up the bridge on a fresh machine while protecting the machine from unauthorized Telegram users and keeping the bot token secret.

Instructions file for CodexOpenCode

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 instructions/petrludwig-collab/agent2telegram/agents-md
Clone the repo
git clone --depth 1 https://github.com/petrludwig-collab/Agent2Telegram

Made for: Codex, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for Agent2Telegram AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/petrludwig-collab/agent2telegram/agents-md.svg)](https://agentmods.dev/instructions/petrludwig-collab/agent2telegram/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/petrludwig-collab/agent2telegram/agents-md"><img src="https://agentmods.dev/badge/instructions/petrludwig-collab/agent2telegram/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,286 This file is loaded in full into every session.
When invoked 1,286 The same file — it is already loaded in full.
Security scan B 1 finding. 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.01286 $0.01286
Opus 5 $0.00643 $0.00643
Sonnet 5 $0.00257 $0.00257
Haiku 4.5 $0.00129 $0.00129

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

Security

Grade B, and why

Agent2Telegram AGENTS.md scanned grade B with 1 finding 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 4d 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.

…and `chmod 600` it. To get the user's id: have them message the bot, then read it from
AGENTS.md · 97 lines

How it starts

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

AGENTS.md — install playbook for an AI agent

This file is written for an AI coding agent (Codex, Claude Code…) tasked with installing Agent2Telegram on a fresh machine for a non‑technical user. Follow it as a recipe. Do not improvise around the security rules.

Your goal

Get the Agent2Telegram bridge running so the user can talk to their agent from Telegram, then verify it actually works and hand the user a short summary.

Hard rules (do not break)

  1. Never weaken security. The bridge lets a Telegram user run commands on this machine. The allowed_user_ids list must contain only the owner's real Telegram user id. Never set it to empty "to make it work", never add unknown ids, never disable the check.
  2. Never print, paste, or commit the bot token. It is a secret. It lives only in ~/.config/agent2telegram/config.json (mode 0600) or the TELEGRAM_BOT_TOKEN env var.
  3. Do not use shell=True or interpolate user input into shell strings anywhere.
  4. If a step needs a secret or a decision only the user can make (token, which agent, their Telegram id), ask the user — don't guess.

Prerequisites to check first

Run these and fix what's missing before installing:

  • python3 --version → must be 3.10+. If missing, install Python 3.
  • git --version → needed to fetch the repo. Install if missing.
  • The agent CLI to bridge must be installed and logged in:
    • Claude Code: claude --version and a prior claude login.
    • Codex: codex --version and a prior codex login.
    • Test it works headlessly, e.g. claude -p "say hi" or codex exec "say hi". If the agent CLI isn't installed/authenticated, stop and ask the user to do that (it requires an interactive login you can't complete for them).

Install steps

git clone https://github.com/petrludwig-collab/Agent2Telegram.git
cd Agent2Telegram
python3 -m pip install --user .          # or: --user --break-system-packages

Configure

Prefer the interactive wizard if the user is present:

python3 -m agent2telegram setup

If you must configure non‑interactively, ask the user for (a) which agent and (b) the bot token and their Telegram user id, then write ~/.config/agent2telegram/config.json:

{ "agent": "codex", "token": "<ASK THE USER>", "allowed_user_ids": [<ASK THE USER>] }

…and chmod 600 it. To get the user's id: have them message the bot, then read it from getUpdates, or ask them to send /id to the bot once it's running.

Read the full file on GitHub · 97 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. 4d ago First seen · 97 lines · 1,286 tokens per session scan B f851d7a3336e

Subscribe to this mod's changes

Agent2Telegram AGENTS.md is an instructions file published in the GitHub repository petrludwig-collab/Agent2Telegram (19 stars, last pushed today), licensed MIT. It adds 1,286 tokens to every session, about $0.0064 per session on Opus 5. A static security scan graded it B with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other instructions, from other repositories

WhatsAppToDiscord AGENTS.md

AGENTS.md instructions for arespawn/WhatsAppToDiscord, covering agent notes (agents.md), project snapshot, fast start, where the source of truth lives and critical guardrails.

arespawn/WhatsAppToDiscord · 731 tokens

antigravity-testing-kit GEMINI.md

Instructions for anhtester/antigravity-testing-kit, covering gemini ai - global automation agent rules, git pull restriction rule, browser rules (mandatory), 🖥️ viewport & mode and 🔄 thứ tự debug bắt buộc (playwright mcp).

anhtester/antigravity-testing-kit · 3,029 tokens

toh-framework CLAUDE.md

Claude Code instructions for wasintoh/toh-framework, covering claude.md — toh framework (repo development guide), what this is, everyday commands, verification protocol and single source, transformed per ide.

wasintoh/toh-framework · 3,979 tokens

awesome-copilot-id AGENTS.md

AGENTS.md instructions for GulajavaMinistudio/awesome-copilot-id, covering communication, explanation and documentation, markdown formatting, user communication style and workflow & methodology.

GulajavaMinistudio/awesome-copilot-id · 7,686 tokens

codevira CLAUDE.md

Instructions for sachinshelke/codevira, covering codevira — persistent project memory, when to call which codevira tool, at the start of every session, before modifying any file and before adopting a pattern, library, or naming convention.

sachinshelke/codevira · 2,807 tokens

agent-skills AGENTS.md

AGENTS.md instructions for racastellanosm/agent-skills, covering agents.md, 1. vision & architectural invariants, 2. repository architecture & layout, 3. harness support & installation paths and 4. scripting & tooling guardrails.

racastellanosm/agent-skills · 2,799 tokens