本文へ移動
cccskills
無料GitHub で公開日本語紹介

cleanup

AIコーディング作業で残ったGit worktreeや不要なビルド成果物、キャッシュ、古いログを調べ、確認を経て整理するためのスキルです。

原文原文の説明を見る

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.

実行スコア 未検証

インストール方法を見る

こんなときに便利

  • 容量不足の原因を調べたいとき
  • 不要なworktreeやブランチを整理したいとき
  • 古いキャッシュやログを確認したいとき

日本語での紹介

できること

ストレージを調べ、AIコーディング作業のあとに残ったGit worktreeやマージ済みブランチ、古いビルド成果物、アーカイブ、バックアップ、パッケージキャッシュ、エージェントのセッションログなどを整理します。まず対象をスキャンして、削除候補、判断が必要な項目、保持する項目を分類した計画を作ります。削除直前にも各項目の状態を確認し、スキャン後に変化したものは対象から外します。利用者が選んだ項目だけを適用し、結果を報告します。

こんなときに便利

ディスク容量が足りなくなったときや、作業後のworktreeやブランチが増えて整理したいときに使えます。リポジトリ内だけを対象にするか、複数のプロジェクトフォルダーを含めて調べるかを指定できます。対象をブランチ、キャッシュなど特定の種類に絞ることもできます。

使い方の例

  • 「このリポジトリの不要なworktreeを調べて」
  • 「ディスク容量が少ないので、プロジェクト全体を整理したい」
  • 「マージ済みブランチだけスキャンして」

注意点

削除対象を適用する前に、利用者による確認が必要です。リモートブランチの削除は、リポジトリを使う他の人にも影響します。未コミット変更や未プッシュコミットなど、固有の内容を含む項目は個別判断の対象です。

この紹介文は、公開されている SKILL.md をもとに AI(OpenAI Codex)が作成しました。正確な仕様は下の原文を確認してください。

含まれるファイル(3)

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

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

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 のプライバシーポリシーと利用規約が適用されます。

同じリポジトリのスキル

activecampaign-automation

無料概要あり

ActiveCampaign の連絡先登録・検索、タグ付け、配信リストの登録・解除をエージェントに任せられます。既存の自動化フローへの追加やフォロー用タスク作成にも対応します。

  • 連絡先を検索・登録したいとき
  • 連絡先のタグを追加・削除
  • 配信リストへの登録・解除
davepoon/buildwithclaude3,6742026年10月24日 更新

ad-angle-research

無料概要あり

競合が配信中のMeta・Google広告を調べ、目を引く表現や特典、行動を促す文言、リンク先を整理し、自社で試す広告の切り口を出典付きでまとめるスキル。

  • 広告コピーの切り口を探したいとき
  • 競合広告を基にテストを計画したいとき
  • ランディングページの訴求を決めたいとき
davepoon/buildwithclaude3,6742026年10月24日 更新

agent-analytics

無料概要あり

サイトやアプリにアクセス解析を導入し、訪問数、登録までの離脱、継続利用をCLIで分析します。複数プロジェクトの確認や見出し・ボタンのA/Bテストにも対応します。

  • ページ閲覧と重要な操作の計測導入
  • 複数サイトの訪問数や流入元の確認
  • 登録や購入までの離脱を調べたいとき
davepoon/buildwithclaude3,6742026年10月24日 更新

agent-memory-discipline

無料概要あり

AIエージェントが作業前に過去の記憶を参照し、決定・訂正・失敗を作業後に保存する基準を定め、セッションをまたぐ好みやプロジェクト方針の扱いを整えます。

  • プロジェクトの規約を次回も引き継ぐ
  • 利用者の訂正や継続的な好みの保存
  • 失敗した方法と原因の記録
davepoon/buildwithclaude3,6742026年10月24日 更新

agenttrace-session-audit

無料概要あり

ローカルのAIコーディングエージェントの実行記録を調べ、費用やトークン消費、ツール失敗を整理します。問題の優先付けや、CIで使う合否基準の設定も支援します。

  • 実行費用やトークンの無駄の調査
  • ツール失敗や再試行の繰り返しの確認
  • Markdown・JSONの報告書作成
davepoon/buildwithclaude3,6742026年10月24日 更新

agentwhy-session-audit

無料概要あり

保存済みの作業記録から、エージェントによる秘密ファイルへのアクセスや値の取り込みを調べます。秘密の値を表示せず、交換すべきキーの判断材料を示します。

  • .envへのアクセスを調べたいとき
  • 交換が必要なキーの確認
  • サブエージェントの秘密ファイル監査
davepoon/buildwithclaude3,6742026年10月24日 更新

davepoon のスキルをすべて見る

このスキルの問題を報告する