Skip to content
Approval required
telegram-organization
OpenClawClaudeCodexHermes Agent

Telegram Group Cleanup

Review noisy or inactive Telegram groups and propose organization or exit actions.

Example request

Illustrative scenario, not an executed run.

Review the groups I selected and recommend which to keep, organize, or leave. Make no changes yet.

Expected result

A recommendation list with reasons. Group exits require a separate stored preview and approval.

Before you start

  1. Connect Telegram and select the personal or team context you intend to use.
  2. Connect your AI client with browser OAuth, or follow the local setup below.
  3. Review the workflow’s tools and target conversations. Chat reads and imported CRM records are separate; sync a chat before requesting changes to missing CRM metadata.

A skill does not schedule itself or grant permissions. Describe whether you want suggestions, a dry run, or an action. Client controls and each tool’s safeguards govern execution.

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

Required tool permissions

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

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.
  • Browser OAuth connections you can review and revoke.
  • Shared team context and tool-specific action safeguards.
  • No local Telegram worker, database, or MCP runtime to operate.
Chiho.ai Telegram CRM workspace
Connect with browser OAuth

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.
Local tgchats command-line workflow

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

Keep building your workflow

Read the related Telegram workflow guide

For unattended jobs, review advanced service-token setup separately.