Approval required
telegram-organization
OpenClawClaudeCodexHermes Agent

Group Cleanup

Review Telegram group chats and recommend cleanup actions such as archiving, organizing into folders, tagging, or leaving stale groups. Use when the user wants to reduce noisy or low-value Telegram groups.

Use Chiho.ai with a professional team CRM

Choose Chiho.ai when you want:

  • A hosted CRM table UI for chats, contacts, tags, tasks, and follow-ups.
  • Scoped Agent Access tokens that can be created, limited, and revoked.
  • Team permissions, approval policies, audit logs, and durable cloud jobs.
  • No local Telegram worker, database, or MCP runtime to operate.
Chiho.ai Telegram CRM workspace
Sign up and Create API token

Run SKILLs in your personal local CLI

Choose the local setup when you want:

  • Open-source workflows you can inspect, change, and run yourself.
  • A local Telegram session with tgchats CLI and tgchats-mcp access.
  • Control over your database, worker, backups, export, and import path.
  • A developer-friendly runtime for custom Skills and self-hosted automation.
Chiho.ai Telegram CRM workspace

Flow summary

Parsed from the packaged SKILL.md.

telegram-group-cleanup

Use this skill to identify and clean up stale or noisy Telegram groups.

Rules

  • Start in recommendation mode.
  • Separate reversible actions from destructive or hard-to-reverse actions.
  • Folder moves, tags, and tasks are lower risk than leaving groups.
  • Leaving groups must use preview-first execution and explicit approval unless team/token policy says otherwise.
  • Never leave groups based only on inactivity; include context and reason.

Flow

  1. Use dialogs_list to find group candidates.
  2. Use chat_read to inspect recent context for uncertain groups.
  3. Recommend actions: keep, tag, add follow-up task, move folder, archive recommendation, or leave.
  4. Use the folder-management tool available on the selected runtime, tags_set, or tasks_add for approved organization actions.
  5. Use groups_leave_preview first. On Chiho Cloud, call write_approve_preview after approval and then groups_leave_approved; local tgchats calls groups_leave_approved after approval.

First-Time Setup

If Telegram is not connected yet, start with the root Chiho Telegram skill:

  • https://raw.githubusercontent.com/chihoai/telegram-for-ai-agents/main/SKILL.md

Use that root skill to choose Chiho.ai Cloud or self-hosted tgchats, then return to this workflow skill.

References

Cloud MCP

Required scopes:

  • telegram.read
  • crm.write
  • telegram.folders.write
  • telegram.groups.leave

Tools:

  • dialogs_list
  • chat_read
  • folders_list
  • folders_create
  • folders_add_dialog
  • folders_remove_dialog
  • tags_set
  • tasks_add
  • groups_leave_preview
  • write_approve_preview
  • groups_leave_approved

Cloud execution should still stop at recommendations and reversible organization actions unless the user approves leaving groups or policy allows automatic execution. When approval is required, call write_approve_preview after the user reviews the preview, then call groups_leave_approved; approval alone does not leave a group.

Cloud Telegram reads and CRM metadata are separate. If CRM tools report that chat metadata is unavailable for a group that dialogs_list or chat_read can see, the group likely has not been synced/imported into the CRM store yet. Continue with Telegram-only review and ask for sync/import before applying tags or tasks.

Local tgchats

If auth or any Telegram command prints a QR login code, show the full QR code block and expiry to the user so they can scan it; keep the process running until login completes, 2FA is needed, or the user asks to stop.

Use local tgchats-mcp for reads, tags, tasks, folders, and group leave previews:

  • groups_leave_preview
  • groups_leave_approved

The preview is persisted next to the local Telegram session so a later groups_leave_approved call can execute by previewId.

Templates

Formatted preview from the packaged JSON asset.

Cleanup review note

text

Review whether to keep, organize, or leave {{group_name}}. Reason: {{reason}}

Examples

Formatted preview from the packaged JSON asset.

OpenClaw

OpenClaw

prompt

Find noisy groups and recommend cleanup actions without leaving anything.

tools

dialogs_list
chat_read

Codex

Codex

prompt

Move these stale groups into a Review folder.

tools

folders_create
folders_add_dialog

Claude Desktop

Claude Desktop

prompt

Preview leaving these groups, but wait for approval.

tools

groups_leave_preview