跳到正文
cccskills
免费在 GitHub 公开

cleanup

Find disk space and Git clutter left by AI coding work, including old worktrees, merged branches, build artifacts, caches, archives, and session logs. Review a scan plan, confirm selected items, then remove only items that remain eligible when checked again.

中文简介正在准备中。当前显示英语简介。

原文查看原文说明

Reclaim disk space and prune branches left behind by AI coding agents - merged or abandoned git worktrees, merged branches, stale build artifacts (node_modules, .venv, target), old archives and backups, package caches, and old agent session logs. Use when the user runs /cleanup, says the disk is full, or asks to clean up worktrees, branches, or storage.

实测评分 未实测

查看安装方法

适用场景

  • Finding large or stale files when disk space is low
  • Pruning merged branches and abandoned worktrees
  • Reviewing build artifacts, caches, archives, and agent logs

包含的文件(3)

  • SKILL.md4.4 KB
  • LICENSE1.0 KB
  • scripts/agent_cleanup.py52.0 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Cleanup

Free disk space and prune branches with one scan, one confirmation, and one apply. Every deletion goes through scripts/agent_cleanup.py in this skill's directory. Right before acting, it re-checks each git item, artifact folder, archive and the trash, and skips anything that changed since the scan.

1. Scope

Choose what to scan:

  • This repo (default): run from inside it with no --root. The scan covers this repo, the agent worktree folders (Codex, Cursor, Conductor, Vibe Kanban), package caches, agent logs and the trash.
  • Whole machine: the user says disk full, all projects, or everything. Add --root <dir> for each folder that holds their projects. Look for the usual ones (~/code, ~/dev, ~/src, ~/projects, ~/repos, ~/Developer, ~/Documents/*). If none of them exist, ask the user.

Narrow with --only git,artifacts,archives,caches,agents,trash when the user asks for one kind, e.g. "just branches" → --only git. Add --remote only when the user wants merged branches deleted on origin too.

Done when the scan command is chosen.

2. Scan

python3 <skill-dir>/scripts/agent_cleanup.py scan --fetch [--root DIR ...] [--only ...] [--remote]

The scan is read-only, apart from --fetch updating remote-tracking refs. It prints numbered items in four classes and saves the plan:

  • REMOVE: merged into the base branch, regenerable, or a worktree whose directory is already gone (unregistering it keeps its branch).
  • NEEDS-DECISION: holds something unique (uncommitted or ignored files, unmerged or unpushed commits, build output, archives, old logs).
  • KEEP-ACTIVE and SKIP: open PRs, recent work, long-lived branches, the main checkout, locked or rebasing worktrees, anything a running process is inside, unmounted drives. Never act on these.

--help lists the thresholds (--stale-days, --keep-days, --min-size).

Done when the plan is printed with its reclaimable total.

3. One confirmation

Ask once, using your multi-select question tool if you have one, otherwise a single message, then wait for the answer:

  • REMOVE, pre-selected, one line per item: id, size, path and note. When there are many, group lines by kind (worktrees, branches, artifacts, caches) and keep each id visible. Say that caches re-download on demand and artifacts come back on the next install or build.
  • Each NEEDS-DECISION item on its own line, unselected: path, size, and what is unique in it (the note). Agent logs and archives cannot be recovered once deleted.
  • Remote branches, if --remote was used, as a separate question: deleting them affects everyone using the repo.

KEEP-ACTIVE and SKIP get one summary line so the user knows they were seen.

Done when the user has answered.

4. Apply

Pass exactly the ids the user picked:

python3 <skill-dir>/scripts/agent_cleanup.py apply 1 2 5 9-14

Add --remote only when the picked ids include remote branches the user approved in their own question. apply --recommended takes every REMOVE item; use it only when the user approved all of them and nothing else.

apply prints one line per item: done, skipped (changed since the scan, gone, or now in use), refused, or failed with git's reason. Report each one as printed. Leave skipped and refused items in place; the next scan classifies them again. If the plan is more than 24 hours old, apply refuses it: scan again and confirm again.

git worktree remove refuses a worktree with uncommitted changes. Add --force only for ids where the user explicitly accepted losing those changes. A detached worktree's unique commits are saved under refs/agent-cleanup/ before removal.

Done when every picked id has a result line.

5. Report

Tell the user:

  • how much space was freed;
  • what was removed;
  • what was left and why;
  • for each agent-data item, the agent's built-in retention setting named in its note, so the logs stop piling up.

Every action is logged to ~/.local/state/agent-cleanup/history.jsonl.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Handle ActiveCampaign contact and marketing tasks through Rube MCP, a connection for agent tools. Find or create contacts, manage tags and subscriptions, enroll contacts in existing automated workflows, and create follow-up tasks.

中文简介正在准备中。当前显示英语简介。

  • Finding or registering contacts
  • Adding or removing contact tags
  • Subscribing contacts to lists or unsubscribing them
davepoon/buildwithclaude36742026年10月24日 更新

Research competitors’ live Meta and Google ads to identify opening hooks, offers, calls to action, and landing pages. Receive a sourced creative brief and up to three test ideas adapted to your product.

中文简介正在准备中。当前显示英语简介。

  • Find angles for new ad copy
  • Plan creative tests using competitor ads
  • Choose a landing page message
davepoon/buildwithclaude36742026年10月24日 更新

Add website or app tracking, then use command-line tools to review traffic, signups, drop-off, and returning users across projects. Run A/B tests, which compare alternative headlines or buttons, and inspect results to guide changes.

中文简介正在准备中。当前显示英语简介。

  • Adding page-view and key-action tracking
  • Reviewing traffic and referral sources across projects
  • Finding where visitors drop out before signup or purchase
davepoon/buildwithclaude36742026年10月24日 更新

Establish rules for when an AI agent should recall past context and save lasting decisions, corrections, preferences, and failures. Works with Markdown files or memory services, preserving decision history and surfacing conflicting records.

中文简介正在准备中。当前显示英语简介。

  • Carry project conventions into the next session
  • Save user corrections and lasting preferences
  • Record failed approaches and their causes
davepoon/buildwithclaude36742026年10月24日 更新

Audit local AI coding-agent sessions with agenttrace to identify spending, token use, tool failures, and operational problems. Produce readable or structured reports and define pass-or-fail thresholds for automated continuous integration checks.

中文简介正在准备中。当前显示英语简介。

  • Investigating session costs and token waste
  • Finding repeated tool failures and retries
  • Exporting session reports as Markdown or JSON
davepoon/buildwithclaude36742026年10月24日 更新

Audit saved agent sessions for access to private files and evidence that secret values entered an agent's context. Get findings without displaying secrets, identify keys needing rotation, and inspect Claude Code or Codex sessions in a local report.

中文简介正在准备中。当前显示英语简介。

  • Check whether an agent accessed .env files
  • Identify keys that may need rotation
  • Audit private-file access by subagents
davepoon/buildwithclaude36742026年10月24日 更新

查看 davepoon 的全部技能

报告此技能的问题