Delete Agent With Telegram Group
by @sheetaa
Safely and thoroughly delete an OpenClaw agent and its artifacts. Use when user asks to remove an agent completely, including workspace, agent files under ~/...
clawhub install delete-agent-with-telegram-groupπ About This Skill
name: delete-agent-with-telegram-group description: Safely and thoroughly delete an OpenClaw agent and its artifacts. Use when user asks to remove an agent completely, including workspace, agent files under ~/.openclaw/agents, bindings, Telegram group routing config, dedicated Telegram group, and related cron jobs. Always run local cleanup via script with dry-run first; if Telegram group deletion is requested, require a separate explicit confirmation before any browser/session control or irreversible group deletion.
Delete Agent (Clean)
Permanently remove an agent and its related local config/files.
Safety Rules
--dry-run,
2) explicit confirmation for local deletion,
3) separate explicit confirmation for Telegram browser/session-controlled group deletion.
Inputs
Collect:
agent_id (required)delete_workspace (yes/no)delete_telegram_group_config (yes/no; usually yes)delete_telegram_group (yes/no; requires explicit confirmation)delete_cron_jobs (yes/no; usually yes)Script-first Commands
Dry-run:
python3 scripts/delete_agent.py --agent-id --dry-run
Execute (after confirmation):
python3 scripts/delete_agent.py --agent-id --yes --delete-workspace --delete-telegram-group-config --delete-cron-jobs
Script Safety Guardrails
scripts/delete_agent.py validates agent_id format: [a-z0-9-]+.claw-.What the script removes
~/.openclaw/openclaw.json (agents.list)bindings[] with matching agentId)channels.telegram.groups.
~/.openclaw/agents/
--delete-workspace)~/.openclaw/cron/jobs.json (if --delete-cron-jobs)Dedicated Telegram Group Deletion
This skill does not bundle Telegram deletion automation code; it uses external browser automation tooling or manual user actions.
After local script deletion and only if user confirmed delete_telegram_group=yes:
1. Require a separate explicit confirmation: user agrees to browser/session control and irreversible group deletion.
2. Identify dedicated group chat_id from removed bindings.
3. Use browser automation (Telegram Web) to open the group and run Delete Group.
4. In Telegram delete dialog, enable Delete for all members when available, then confirm deletion.
5. Report final group status clearly: deleted / left-only / pending-manual.
Post-step
openclaw.json.bak.*, jobs.json.bak.*) so user can retain recovery points.