auth

auth is a command for coding agents from sanjar-x/claudegram. It costs 14 tokens per session (431 once invoked), scanned A, original, MIT.

A command workflow for signing in to a Telegram account through connected tools. It uses a phone verification code and, when required, a two-factor authentication password.

In plain words
What is it for?
Use it to check Telegram authorization, request and submit a login code, complete two-factor authentication, and confirm that the session is ready.
Why use it?
It provides a defined login sequence and handles common problems such as an invalid or expired code. It avoids relying on a terminal command that needs interactive input.

Command

Part of the claudegram plugin — 7 skills, 3 commands, 5 hooks, 1 MCP server shipped together

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/sanjar-x/claudegram/auth
Clone the repo
git clone --depth 1 https://github.com/sanjar-x/claudegram

Or install claudegram, the plugin that ships this one along with the rest of its 7 skills, 3 commands, 5 hooks, 1 MCP server.

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 auth

README.md
[![agentmods](https://agentmods.dev/badge/commands/sanjar-x/claudegram/auth.svg)](https://agentmods.dev/commands/sanjar-x/claudegram/auth)
Your own site
<a href="https://agentmods.dev/commands/sanjar-x/claudegram/auth"><img src="https://agentmods.dev/badge/commands/sanjar-x/claudegram/auth.svg" alt="Measured on agentmods" height="20"></a>
Per session 14 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 431 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 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.00014 $0.00431
Opus 5 $0.00007 $0.00216
Sonnet 5 $0.00003 $0.00086
Haiku 4.5 $0.00001 $0.00043

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

Security

Grade A, and why

auth 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 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.

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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

  • auth — 100% identical, 0 lines differ
commands/auth.md · 30 lines

What it actually says

Двухшаговый интерактивный логин в Telegram прямо из активной Claude-сессии.

Шаги:

  1. Запусти mcp__plugin_claudegram_claudegram__health_check — если уже authorized: true, скажи юзеру и выйди.
  2. Иначе вызови auth_request_code() — Telegram пришлёт SMS-код на привязанный номер. Покажи юзеру phone (маскированный).
  3. Спроси у юзера код через AskUserQuestion (поле code, 5 цифр). Если в userConfig не было пароля 2FA — спроси и его (опционально).
  4. Вызови auth_submit_code(code=<код>, password_2fa=<2fa или "">).
  5. Если в ответе needs_2fa: true — спроси пароль и повтори с ним.
  6. Если в ответе error: PhoneCodeInvalidError/Expired — предложи запросить новый код через auth_request_code().
  7. После успеха вызови health_check — должен показать ok=true, authorized=true, self_id. Скажи юзеру что готово.

Важно: НЕ предлагай ! claudegram-auth через Bash — он требует интерактивного stdin, который Bash tool в Claude Code не предоставляет (commands/auth.md устаревший подход). Используй ТОЛЬКО эти MCP-tools.

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 · 30 lines · 14 tokens per session scan A 5f89c4050512

Subscribe to this mod's changes

auth is a command published in the GitHub repository sanjar-x/claudegram (2 stars, last pushed 4mo ago), licensed MIT. It adds 14 tokens to every session and 431 once invoked, about $0.0001 per session on Opus 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.