telegram-agent: Instructions file for Codex

AGENTS.md

telegram-agent AGENTS.md is an instructions file for Codex, OpenCode from Frejixxx/telegram-agent. It costs 1,165 tokens per session, scanned A, original, MIT.

A project guide for coding agents working on a local Telegram tool. It describes the project's purpose, files, architecture, configuration, and main entry points.

In plain words
What is it for?
Use it when developing, debugging, or extending the Telegram agent, its MCP server, setup wizard, authentication, search, digests, or reply features.
Why use it?
It gives an agent the context needed to navigate the codebase and make changes in the right places. This reduces guesswork about how the Telegram tool is structured.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: reads ~/.codex paths; mentions AGENTS.md; mentions Codex.

This is Frejixxx/telegram-agent's own configuration. It tells Codex and OpenCode how to work on telegram-agent itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything telegram-agent configures →

Reuse

Borrowing it

Nothing to install: this file belongs to Frejixxx/telegram-agent. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/Frejixxx/telegram-agent/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/Frejixxx/telegram-agent

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 telegram-agent AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/frejixxx/telegram-agent/agents-md/github.svg)](https://agentmods.dev/instructions/frejixxx/telegram-agent/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/frejixxx/telegram-agent/agents-md"><img src="https://agentmods.dev/badge/instructions/frejixxx/telegram-agent/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for telegram-agent AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/frejixxx/telegram-agent/agents-md"><img src="https://agentmods.dev/badge/instructions/frejixxx/telegram-agent/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,165 This file is loaded in full into every session.
When invoked 1,165 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.01165 $0.01165
Opus 5.5 $0.00466 $0.00466
Sonnet 5.5 $0.00233 $0.00233
Haiku 4.5 $0.00117 $0.00117

Measured 2mo ago against content hash 31fe8aee1e73, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

telegram-agent AGENTS.md scanned grade A with 0 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 2mo 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 111 lines

How it starts

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

AGENTS.md

Project Identity

Telegram Agent is a local Codex plugin and MCP server for Telegram setup, inbox triage, dialog lookup, selected-chat context, message search, SQLite-backed digests/search/watchlists, maintainer intelligence, ordinary-user personal briefings, smart inbox ranking, local memory search, secret-safe sensitive search, contact briefs, follow-up tracking, prompt-injection detection, GitHub issue drafts, Codex context packs, local reply drafts, scoped reply sessions, and explicitly authorized sends. It is a CommonJS Node.js project.

Runtime Map

  • MCP entry point: scripts/telegram-agent-server.js.
  • Intelligence/cache module: scripts/intelligence-store.js.
  • Auth metadata module: scripts/auth-store.js.
  • Browser setup wizard: scripts/setup-web.js and scripts/setup-web-ui.js.
  • Demo entry point: scripts/demo.js.
  • Terminal login fallback: scripts/login.js.
  • Codex plugin manifest: .codex-plugin/plugin.json.
  • MCP server config: .mcp.json and .codex/config.toml.
  • Skill instructions loaded by Codex: skills/telegram-agent/SKILL.md.

The MCP server runs over stdio, implements initialize, tools/list, and tools/call, and returns tool output as JSON text content.

Directory Map

  • scripts/: first-party runtime and login code.
  • fixtures/: synthetic demo sources/messages; no real Telegram data.
  • skills/: Codex skill instructions for safe Telegram tool usage.
  • .codex-plugin/: plugin manifest consumed by Codex plugin install/cache.
  • .codex/: local Codex MCP config for this plugin.
  • .github/: GitHub Actions workflows.
  • test/: Node node:test unit tests.
  • node_modules/: vendored dependencies from npm install; do not edit.

Core Architecture

scripts/telegram-agent-server.js owns:

  • MCP tool schemas;
  • Telegram client loading/caching;
  • dialog and entity summaries;
  • message normalization and chat stats;
  • draft file creation/list/delete/send;
  • direct send gate via TELEGRAM_AGENT_ALLOW_SEND;
  • JSON-RPC framing over stdio.

Read the full file on GitHub · 111 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. 2mo ago First seen · 111 lines · 1,165 tokens per session scan A 31fe8aee1e73

Subscribe to this mod's changes

telegram-agent AGENTS.md is an instructions file published in the GitHub repository Frejixxx/telegram-agent (1 stars, last pushed 4mo ago), licensed MIT. It adds 1,165 tokens to every session, about $0.0047 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

telegram-agent AGENTS.md compared with instructions from other repositories

telegram-agent AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
telegram-agent AGENTS.mdFrejixxx/telegram-agentInstructions file14mo agoMITA1,165Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA5,649GitHub Copilot
langchain AGENTS.mdlangchain-ai/langchainInstructions file149ktodayMITA4,680Codex, OpenCode
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA3,093GitHub Copilot
vscode model-prompts.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA2,022GitHub Copilot