Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Send explicit, user-requested Telegram messages and files from an agent session through the local Agentgram command-line tool.
.claude/skills/hashgraph-online-agentgram/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-05 | ✗→✓ | ▲ Improved | 156% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 378% | 0% |
| case-20 | ✓→✗ | ▼ Worse | 146% | 0% |
| case-18 | ✓→✓ | = Same ✓ | 98% | 0% |
| case-19 | ✓→✓ | = Same ✓ | 14% | 0% |
Agentgram is a small Telegram messaging helper for agents. Use this skill when the user asks to send a Telegram message or file, verify Telegram messaging setup, find a chat id, or update the local Agentgram install.
Before sending messages, prefer the installed agentgram command. If it is not on PATH and Agentgram is installed as a Codex plugin, resolve the plugin root from this skill file at <plugin-root>/skills/agentgram/SKILL.md and use <plugin-root>/bin/agentgram (../../bin/agentgram relative to this file). Use ./bin/agentgram only after verifying the current checkout is Agentgram itself, with .codex-plugin/plugin.json name agentgram and skills/agentgram/SKILL.md present. In any other repository, report that Agentgram is not installed instead of running project-local fallback scripts or making an ad hoc Telegram API call.
shagentgram send "message text" agentgram send --split "long message text" agentgram send --as-file --filename report.md "long message text" agentgram send-file ./report.md --caption "Report" agentgram inbox agentgram inbox --limit 100 agentgram inbox --limit 500 --ack agentgram inbox --since 3h agentgram inbox --include-plain agentgram inbox --format compact --output /tmp agentgram inbox --format jsonl --output /tmp agentgram inbox --ack agentgram inbox --include-plain --download-files --download-dir /tmp --ack agentgram download-file <file_id> --output /tmp agentgram chat-id agentgram doctor agentgram update agentgram update --check
Agentgram reads:
TELEGRAM_BOT_TOKENTELEGRAM_CHAT_IDSecrets must come from environment variables or a user-owned local config file, never from tracked repository files, chat output, PR bodies, logs, or generated plugin packages.
AGENTGRAM_CMD: agentgram onPATH, <plugin-root>/bin/agentgram from an installed Agentgram plugin, or ./bin/agentgram only from a verified Agentgram checkout.
$AGENTGRAM_CMD doctor before sending, unless the user explicitly asksfor a best-effort send without preflight.
doctor only fails because TELEGRAM_CHAT_ID is missing and the userprovided the target chat id for this message, proceed with the selected send command plus --chat-id <id>, such as $AGENTGRAM_CMD send --chat-id <id> "message" or $AGENTGRAM_CMD send-file --chat-id <id> <path>.
doctor reports missing TELEGRAM_CHAT_ID and the user did not providea chat id, run $AGENTGRAM_CMD chat-id only after the user has messaged the bot or added it to the target chat.
--chat-id only when the user provided a specific override for thatmessage.
--parse-mode HTML or --parse-mode MarkdownV2 only when the user asksfor formatted Telegram output or the message clearly requires it.
Use $AGENTGRAM_CMD send "message text" for explicit short text messages. Plain text messages are limited to 4096 visible characters by Telegram.
Use $AGENTGRAM_CMD send-file <path> when the user explicitly asks to send a file, report, log, diff, archive, generated artifact, or named local path. Do not glob paths, archive directories, or infer a file to send. If the requested path is ambiguous, ask the user to identify the exact file before sending. send-file accepts --caption, --parse-mode HTML|MarkdownV2, --silent, and --chat-id.
Use $AGENTGRAM_CMD send --split "long text" only when the user asks to send long text or the text exceeds Telegram's message limit and should remain in the chat as text. Split mode currently supports plain text only; do not combine it with --parse-mode.
Use $AGENTGRAM_CMD send --as-file --filename report.md "long text" when the user asks to send long text as a document, or when a long report/log/diff is better delivered as a file. Omit --filename only when the default agentgram-message.txt is acceptable.
Do not send automatic status updates merely because an agent task completed. Do not send files automatically just because a task generated one. Agentgram sends should be explicit and user-requested.
Use $AGENTGRAM_CMD inbox when the user asks to read recent Telegram messages they forwarded to the Agentgram bot, such as "read the recent messages I forwarded to you" or "import the Telegram context I just forwarded".
Use $AGENTGRAM_CMD inbox --limit 100 when the user asks for the last 100 pending forwarded messages without consuming them. Peek reads support at most 100 pending updates. Use $AGENTGRAM_CMD inbox --limit 370 --ack --format compact --output /tmp when the user asks to read and consume a larger forwarded batch, such as "the last 370 messages"; acknowledged reads support up to 500 pending updates, read Telegram in 100-update batches, stage each rendered batch durably before acknowledging it, and render the final output globally sorted after all batches are imported. Use $AGENTGRAM_CMD inbox --since 3h when the user asks for messages from the last 3 hours. Use $AGENTGRAM_CMD inbox --include-plain when the user says they also sent direct notes to the bot, or that the forwarded context is mixed with direct messages.
The default inbox mode is --peek, which reads without consuming Telegram updates. Use $AGENTGRAM_CMD inbox --ack only after a successful import, or when the user explicitly asks to consume or clear the forwarded messages. For large inbox imports, prefer --format compact --output /tmp so Codex can read the generated private file in chunks and avoid terminal-output truncation. Read the generated path with commands such as sed -n '1,120p' <path>, then delete only that exact generated file with rm -- <path> after importing the context. Use --format json only for single-batch inbox reads up to 100 updates; use --format jsonl for structured multi-batch output.
Inbox uses Telegram Bot API pending updates only. It is not full Telegram chat history and does not use an MTProto user session. Pending updates can expire, can be consumed by another process using the same bot token, and cannot be read with getUpdates while an outgoing webhook is active. If Telegram reports a webhook conflict, tell the user to remove the webhook or use a separate bot token for Agentgram inbox reads.
Agentgram does not write message content, captions, sender names, raw updates, or transcripts to local files unless the user or agent explicitly passes --output PATH. Forwarded authorship depends on Telegram forward_origin metadata and sender privacy settings; hidden or uncertain authors are marked in the output. Forwarded inbox output is ordered by the original Telegram forward_origin.date when available, with bot receive order as the tie-breaker. In JSON/JSONL, original_date_iso is the original group timestamp and date_iso is when the forwarded copy reached the Agentgram bot.
Use $AGENTGRAM_CMD inbox --include-plain --download-files --download-dir /tmp --ack when the user asks to download or inspect a file they sent or forwarded to the Agentgram bot. The file must be sent or forwarded to the bot chat; files sent only to the user's personal saved messages are not visible to the bot. If multiple files are present, list the downloaded paths or attachment names and ask which one to inspect unless the user's request identifies the file clearly.
Use $AGENTGRAM_CMD download-file <file_id> --output /tmp only when you already have a concrete file_id from agentgram inbox --format json or --format jsonl. Prefer inbox --download-files for normal user requests because agents usually do not know the file_id ahead of time.
Downloaded files are written locally with private permissions and no overwrite, and Agentgram prints path, byte count, SHA-256 digest, read hints, and delete hints. Do not print or reconstruct Telegram file download URLs because they contain the bot token. Public Telegram Bot API downloads through getFile are limited to 20 MB; for larger files, tell the user that Agentgram would need a future local Bot API server setup or another transfer path.
Use $AGENTGRAM_CMD update --check for a read-only status check on git-based installs. Use $AGENTGRAM_CMD update only when the user asks to update Agentgram. The update command refuses dirty git checkouts, runs git pull --ff-only, validates the local CLI/plugin files, and prints any Codex refresh instructions it can detect. For Codex marketplace installs, update with codex plugin marketplace upgrade and then reinstall agentgram@agentgram.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 11,568 | 14,219 | +23% | 1 | 1 | 0% | 551 | 2,714 | +393% | 0 | 0 | — |
case-02 | fail→fail | 4,187 | 17,506 | +318% | 1 | 1 | 0% | 424 | 2,674 | +531% | 0 | 0 | — |
case-03 | fail→fail | 24,346 | 7,839 | -68% | 1 | 1 | 0% | 4,841 | 2,668 | -45% | 0 | 0 | — |
case-04 | fail→fail | 10,113 | 15,711 | +55% | 1 | 1 | 0% | 1,655 | 2,418 | +46% | 0 | 0 | — |
case-05 | fail→pass | 8,285 | 9,147 | +10% | 1 | 1 | 0% | 1,130 | 2,898 | +156% | 0 | 0 | — |
case-06 | fail→fail | 6,849 | 11,754 | +72% | 1 | 1 | 0% | 1,312 | 2,577 | +96% | 0 | 0 | — |
case-07 | fail→pass | 8,876 | 20,942 | +136% | 1 | 1 | 0% | 792 | 3,782 | +378% | 0 | 0 | — |
case-08 | fail→fail | 12,456 | 6,478 | -48% | 1 | 1 | 0% | 1,218 | 2,484 | +104% | 0 | 0 | — |
case-09 | fail→fail | 15,602 | 10,281 | -34% | 1 | 1 | 0% | 1,946 | 2,377 | +22% | 0 | 0 | — |
case-10 | fail→fail | 15,856 | 11,167 | -30% | 1 | 1 | 0% | 1,988 | 2,469 | +24% | 0 | 0 | — |
case-11 | fail→fail | 18,837 | 5,910 | -69% | 1 | 1 | 0% | 2,653 | 2,450 | -8% | 0 | 0 | — |
case-12 | fail→fail | 13,718 | 6,454 | -53% | 1 | 1 | 0% | 1,355 | 2,502 | +85% | 0 | 0 | — |
case-13 | fail→fail | 10,397 | 16,820 | +62% | 1 | 1 | 0% | 1,478 | 2,469 | +67% | 0 | 0 | — |
case-14 | fail→fail | 5,857 | 24,198 | +313% | 1 | 1 | 0% | 381 | 5,501 | +1344% | 0 | 0 | — |
case-15 | fail→fail | 3,071 | 17,369 | +466% | 1 | 1 | 0% | 314 | 2,461 | +684% | 0 | 0 | — |
case-16 | fail→fail | 8,623 | 15,440 | +79% | 1 | 1 | 0% | 1,179 | 2,364 | +101% | 0 | 0 | — |
case-17 | fail→fail | 10,872 | 12,529 | +15% | 1 | 1 | 0% | 953 | 2,477 | +160% | 0 | 0 | — |
case-18 | pass→pass | 10,528 | 6,347 | -40% | 1 | 1 | 0% | 1,599 | 3,164 | +98% | 0 | 0 | — |
case-19 | pass→pass | 18,021 | 8,421 | -53% | 1 | 1 | 0% | 2,359 | 2,698 | +14% | 0 | 0 | — |
case-20 | pass→fail | 13,553 | 10,103 | -25% | 1 | 1 | 0% | 1,244 | 3,055 | +146% | 0 | 0 | — |
case-21 | pass→pass | 12,792 | 15,604 | +22% | 1 | 1 | 0% | 2,487 | 4,333 | +74% | 0 | 0 | — |
case-22 | pass→pass | 17,004 | 9,110 | -46% | 1 | 1 | 0% | 2,612 | 3,954 | +51% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 6 counted toward the lift figure. The other 16 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of 0 percentage points is the difference between those two pass rates over the 6 comparable cases. 4 cases got worse with the skill loaded, and they are included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.