team-cleanup

team-cleanup is a skill for Claude Code from ketor/cto-fleet. It costs 61 tokens per session (1,194 once invoked), scanned C, original, Apache-2.0.

A cleanup procedure for leftover Claude team and task folders stored under the user’s configuration directory.

In plain words
What is it for?
Use it to list leftover teams, inspect their descriptions and dates, filter them by name pattern, run a dry run, or delete selected or all matching folders.
Why use it?
It helps find abandoned folders before removing them and lets the user limit cleanup or preview what would be deleted.

Skill for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: reads .claude/ paths; names the AskUserQuestion tool.

Good fit Use it to list leftover teams, inspect their descriptions and dates, filter them by name pattern, run a dry run, or delete selected or all matching folders.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ketor/cto-fleet/team-cleanup
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 ketor/cto-fleet --skill team-cleanup
Clone the repo
git clone --depth 1 https://github.com/ketor/cto-fleet

Made for: Claude Code.

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 team-cleanup

README.md
[![agentmods](https://agentmods.dev/badge/skills/ketor/cto-fleet/team-cleanup.svg)](https://agentmods.dev/skills/ketor/cto-fleet/team-cleanup)
Your own site
<a href="https://agentmods.dev/skills/ketor/cto-fleet/team-cleanup"><img src="https://agentmods.dev/badge/skills/ketor/cto-fleet/team-cleanup.svg" alt="Measured on agentmods" height="20"></a>
Per session 61 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,194 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. 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.00061 $0.01194
Opus 5 $0.00030 $0.00597
Sonnet 5 $0.00012 $0.00239
Haiku 4.5 $0.00006 $0.00119

Measured 8d ago against content hash fc2bf8a92459, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade C, and why

team-cleanup scanned grade C with 1 finding 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 8d 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

rm -rf ~/.claude/teams/{team-name}
team-cleanup/SKILL.md · 128 lines

How it starts

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

Preamble (run first)

_UPD=$(~/.claude/skills/cto-fleet/bin/cto-fleet-update-check 2>/dev/null || true)
[ -n "$_UPD" ] && echo "$_UPD" || true

If output shows UPGRADE_AVAILABLE <old> <new>: read ~/.claude/skills/cto-fleet/cto-fleet-upgrade/SKILL.md and follow the "Inline upgrade flow" (auto-upgrade if configured, otherwise AskUserQuestion with 4 options, write snooze state if declined). If JUST_UPGRADED <from> <to>: tell user "Running cto-fleet v{to} (just updated!)" and continue.

参数解析:从 $ARGUMENTS 中检测以下标志:

  • --all:跳过确认,清理全部残留 team
  • --pattern=<glob>:只清理匹配该模式的 team(如 --pattern=team-* 只清理 cto-fleet 创建的 team)
  • --dry-run:只展示清单,不实际删除

执行流程

步骤 1:扫描残留 team

运行以下命令收集信息:

# 列出所有 team 目录
ls -1 ~/.claude/teams/ 2>/dev/null | sort

# 对每个 team,尝试读取描述
for d in ~/.claude/teams/*/; do
  name=$(basename "$d")
  desc=$(CONFIG_PATH="$d/config.json" python3 -c "import json,os; d=json.load(open(os.environ['CONFIG_PATH'])); print(d.get('description','(无描述)'))" 2>/dev/null || echo "(无配置文件)")
  mtime=$(stat -c "%y" "$d" 2>/dev/null | cut -d. -f1 || stat -f "%Sm" "$d" 2>/dev/null)
  echo "$name | $mtime | $desc"
done

同时检查 tasks 目录中是否有对应条目:

ls -1 ~/.claude/tasks/ 2>/dev/null | sort

步骤 2:整理并展示清单

将扫描结果整理为表格,输出给用户:

发现 N 个残留 team:

序号 | Team 名称                    | 创建时间            | 描述
-----|------------------------------|---------------------|------------------
1    | dev-team-20260308-015919     | 2026-03-08 01:59    | (无配置文件)
2    | team-arch-20260308-232007    | 2026-03-08 23:20    | 架构分析: ...
3    | xftp-dev                     | 2026-03-14 16:00    | xftp 开发项目
...

tasks/ 中额外目录(无对应 team):
- subconverter-ua-fix

步骤 3:确认清理范围

如果传递了 --all:跳过此步骤,清理全部。

如果传递了 --pattern:只展示匹配的条目,AskUserQuestion 确认。

否则,用 AskUserQuestion 让用户选择:

选项1:清理全部(N 个 team + 孤立 tasks)
选项2:只清理 cto-fleet 管理的(team-* 前缀,M 个)
选项3:只清理 7 天前的旧 team
选项4:手动指定(输入序号)

Read the full file on GitHub · 128 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. 8d ago First seen · 128 lines · 0 tokens per session scan C fc2bf8a92459

Subscribe to this mod's changes

team-cleanup is a skill published in the GitHub repository ketor/cto-fleet (5 stars, last pushed 3mo ago), licensed Apache-2.0. It adds 61 tokens to every session and 1,194 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.