tg-check

tg-check is a skill for Claude Code from tonydzi/second-brain-starter-kit. It costs 70 tokens per session (1,589 once invoked), scanned A, original, MIT.

A local self-test for two ways of connecting to Telegram: an MCP connector and a user-account library. It combines a scripted check with a live in-session probe because the connector cannot be fully verified by a script alone.

In plain words
What is it for?
Use it to check both Telegram connection paths on the current computer and print a separate diagnosis and fix for each.
Why use it?
It distinguishes a broken connection from a healthy one and avoids starting a second Telegram client that could invalidate the existing session.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions Claude Code.

Part of the second-brain-skills plugin — 259 skills, 3 agents, 1 plugin shipped together

Good fit Use it to check both Telegram connection paths on the current computer and print a separate diagnosis and fix for each.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/tonydzi/second-brain-starter-kit/tg-check
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.

Any agent
npx skills add tonydzi/second-brain-starter-kit --skill tg-check
Clone the repo
git clone --depth 1 https://github.com/tonydzi/second-brain-starter-kit

Made for: Claude Code.

Or install second-brain-skills, the plugin that ships this one along with the rest of its 259 skills, 3 agents, 1 plugin.

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 tg-check

README.md
[![agentmods](https://agentmods.dev/badge/skills/tonydzi/second-brain-starter-kit/tg-check/github.svg)](https://agentmods.dev/skills/tonydzi/second-brain-starter-kit/tg-check)
Your own site
<a href="https://agentmods.dev/skills/tonydzi/second-brain-starter-kit/tg-check"><img src="https://agentmods.dev/badge/skills/tonydzi/second-brain-starter-kit/tg-check/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 tg-check

Your own site · 80×15
<a href="https://agentmods.dev/skills/tonydzi/second-brain-starter-kit/tg-check"><img src="https://agentmods.dev/badge/skills/tonydzi/second-brain-starter-kit/tg-check.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 70 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,589 The whole file, excluding the scripts and references it only reads on demand.
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.00070 $0.01589
Opus 5.5 $0.00028 $0.00636
Sonnet 5.5 $0.00014 $0.00318
Haiku 4.5 $0.00007 $0.00159

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

Security

Grade A, and why

tg-check 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.

skills/tg-check/SKILL.md · 87 lines

How it starts

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

/tg-check — both Telegram rails on THIS machine

The operator's order (2026-06-27): "every computer checks whether BOTH of its Telegram rails work — MCP and telethon." A local self-test: this computer checks its own two Telegram rails. Not to be confused with the hub-only connector-health-daily (centralized). The root canon = the house rule reglament-shina-telegram-bez-mcp-i-svoya-sessiya-na-mashinu.

Why two steps (this matters, don't shortcut it)

  • The telethon rail is checked DETERMINISTICALLY and SAFELY (a shared lock _refresh_work_acct_a.lock → no AUTH_KEY_DUPLICATED).
  • MCP cannot honestly be checked by a script — it is a harness stdio server, reachable only by the LLM inside a session. The script gives the best deterministic signal (is the process alive? a fresh fatal in the log?), while the REAL MCP verdict comes from THIS skill — probing the tool inside the session. Memory mcp-health-check: NEVER spin up a second Telethon client as a health check (AUTH_KEY_DUPLICATED).

Step 1 — the deterministic detector (0 tokens)

PYTHONIOENCODING=utf-8 python "$USERPROFILE/.claude/scripts/tg_channels_check.py"

Prints the per-machine matrix: MCP (by process + the tail of mcp_errors.log — a fresh AuthKeyDuplicated = the RED root cause; TypeNotFound = an outdated telethon) and the telethon rail (GREEN/RED via tg_bus_read.py --check). Exit 1 = something is RED. Flags: --json, --notify (pings the bus on RED).

Step 2 — the REAL in-session MCP test (this decides the MCP verdict)

  • Are the Telegram MCP tools present in this session at all? If mcp__telegram__* are NOT loaded (absent from the tool list / ToolSearch cannot find them) → MCP is RED: not loaded into the session.
  • If they are — call ONE cheap read tool: mcp__telegram__list_accounts (or get_me, expecting the work account). Answered without an error → MCP is GREEN. An error (AuthKeyDuplicated / timeout) → RED + the reason from the error.
  • ⚠️ Exactly ONE cheap call. Don't call get_history/search_dialogs (heavy → they can take the MCP down).

Read the full file on GitHub · 87 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 · 87 lines · 70 tokens per session scan A b8d8f5ceaf90

Subscribe to this mod's changes

tg-check is a skill published in the GitHub repository tonydzi/second-brain-starter-kit (16 stars, last pushed yesterday), licensed MIT. It adds 70 tokens to every session and 1,589 once invoked, about $0.0003 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-09-09.

Related

tg-check compared with skills from other repositories

tg-check next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
tg-checktonydzi/second-brain-starter-kitSkill16yesterdayMITA70Claude Code
wiki-lintAgriciDaniel/claude-obsidianSkill17ktodayMITA79Claude Code
wikiAgriciDaniel/claude-obsidianSkill17ktodayMITA84Claude Code
defuddleAgriciDaniel/claude-obsidianSkill17ktodayMITA61Claude Code
wiki-modeAgriciDaniel/claude-obsidianSkill17ktodayMITA83Claude Code
wiki-foldAgriciDaniel/claude-obsidianSkill17ktodayMITA76Claude Code
molio-doctorzhuzhaoyun/MolioSkill453todaynoneA0Claude Code, Codex